-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnormal_binom_distribution.R
More file actions
55 lines (31 loc) · 1.23 KB
/
normal_binom_distribution.R
File metadata and controls
55 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#normal distribution examples
#computing normal probabilities with R
#calculate P(Z <--2.0785)
pnorm(q = -2.0785, mean = 0, sd=1)
#calculate P(x <= 10) for X ~ N(7.1429, 6.1224)
pnorm(q=2, mean=50/7, sd= sqrt(300/49))
#natural births on a monday problem
#use R to calculate P(Y<=2)
pbinom(q=2, size=50, prob=1/7)
#use R to calculate P(X<=2) for X ~ N(50/7, 300/49)
pnorm(q=2, mean=50 / 7, sd=sqrt(300/49))
#probability that more than 2 but fewer than 10 of the 50 births occur on a monday
#calculate P(x < 9.5) - P(X < 2.5) for the previous x mean and variance values
pnorm(q=9.5, mean=50/7, sd= sqrt(300/49)) -
pnorm(q=2.5, mean=50/7, sd=sqrt(300/49))
#added tutorial questions
dbinom(x=8, size=10, prob=0.7)
#P (x < 3)
pbinom(q=3, size=10, prob=0.7)
#cumulative function for more than 1 X value
pnorm(q = -2, mean=0, sd=1, lower.tail = F)
pnorm(q=0.4, mean=0, 1, lower.tail = F)
#exact probability of P(X<=100)
pbinom(50, size=3000, prob=0.02)
#normal approximation
pnorm(-1.304)
#n = 30, p = 0.05,
#calculate probability that 3 animals are caught in these 30 traps for a given week
dbinom(x=3, size=30, prob = 0.05)
#calculate and find when P(Y<3)
pbinom(q=2, size=30, prob=0.05)