In: Statistics and Probability
R programming
What is the probability that someone needs to ask more than 12 people to successfully get directions from 5? Your answer should be 3.21%. Show the code that leads to this result, and explain why.
#Rcode below
p=seq(0,1,.01)
z=0
for (i in 5:12){
z=z+p^i*(1-p)^(i-5)
}
z
p=0.9919
z=0
for (i in 5:12){
z=z+p^i*(1-p)^(i-5)
}
z
1-z
#output of R code
Even p=0.9919 is more accurate which gives you 3.21% exact
Hope the above answer has helped you in understanding the problem. Please upvote the ans if it has really helped you. Good Luck!!