




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Math 1280 - Assignment - Unit 06.docx.docx
Typology: Assignments
1 / 8
This page cannot be seen from the preview
Don't miss anything!





?pbinom The arguments to the pbinom function are:
2) You can use the dbinom() command (function) in R to determine the probability of getting 0 heads when you flip a fair coin four times (the probability of getting heads is 0.5): dbinom(0, size=4, prob=0.5) [1] 0. Find the equivalent values for getting 1, 2, 3, or 4 heads when you flip the coin four times. TIP: after you run the first dbinom() command, press the up arrow and make a small change and run it again. probability of getting exactly 1 head:
dbinom(1, size=4, prob=0.5)
probability of getting exactly 2 heads:
dbinom(2, size=4, prob=0.5)
probability of getting exactly 3 heads:
dbinom(3, size=4, prob=0.5)
probability of getting exactly 4 heads:
dbinom(4, size=4, prob=0.5)
5) Read Yakir (2011, pp. 68-69) carefully to review the meaning of the pbinom function (related to tests that a value will be “equal to” versus “less than or equal to” a criterion value). What is the probability of getting fewer than 2 heads when you flip a fair coin 3 times (round to 2 decimal places)?
pbinom(1, size=3,prob=0.5) [1] 0.
6) What is the probability of getting no more than 3 heads when you flip a fair coin 5 times (be sure to understand the wording differences between this question and the previous one—round to 2 decimal places)? 0.
pbinom(3, size=5,prob=0.5) [1] 0.
Information The exponential distribution is a continuous distribution. The main R functions that we will use for the exponential distribution are pexp() and qexp(). Here is an example of the pexp() function. Leaves are falling from a tree at a rate of 10 leaves per minute. The rate is 10, or we can say that lambda = 10 (meaning 10 leaves fall per minute). The leaves do not fall like clockwork, so the time between leaves falling varies. If the time between leaves falling can be modeled with an exponential distribution, then the probability that the time between leaves falling will be less than 5 seconds (which is 5/60 of a minute) would be: (note: this is an explanation of how pexp() works, you will answer a different question below) pexp(5/60, rate=10) which is about 0.565 (meaning that the probability is a bit higher than 50% that the next time-span between leaves falling will be less than 5 seconds).
For tasks 7-12, assume that the time interval between customers entering your store can be modeled using an exponential distribution. You know that you have an average of 4 customers per minute, so the rate is 4, or you can say that lambda = 4 according to Yakir (2011, p. 79-80). It is easiest to keep everything in the original units of measurement (minutes), but you can also translate that to seconds because a rate of “4 customers per minute” is the same as “4 customer per 60 seconds,” and you can divide each number by 4 to get a rate of “1 customer per 15 seconds” or a rate of “1/ customers per second.” 7) What is the expectation for the time interval between customers entering the store? Be sure to specify the units of measurement in your answer (see Yakir, 2011, pp. 79-80). Round to 3 decimal places:
1/(1/15) [1] 15 8) What is the variance of the the time interval? Be sure to specify the units of measurement in your answer. Round to 3 decimal places: lmb.seconds=1/ v=1/(lmb.seconds ^ 2) v [1] 225 9) The pexp() function is introduced at the bottom of Yakir, 2011, p. 79, and there are some tips above. What is the probability that the time interval between customers entering the store will be less than 15.5 seconds. Be sure to enter values so that everything is in the same unit of measurement. Be sure to specify the units of measurement in your answer. Round your answer to 3 decimal places: round(pexp(15.5,rate=1/15,lower.tail=TRUE),2) [1] 0. 10) What is the probability that the time interval between customers entering the store will be between 10.7 seconds and 40.2 seconds (see Yakir (2011, p. 79-80)? round(pexp(40.2,rate=1/15,lower.tail=TRUE) -pexp(10.7,rate=1/15,lower.tail=TRUE),2) [1] 0.
1-pnorm(9,7,3) [1] 0. round(1-pnorm(9,7,3),2)
qnorm(.04,mean=7,sd=3) [1] 1. round(qnorm(.04,mean=7,sd=3),2) [1] 1.
round(1-pnorm(7+3,mean=7,sd=3),2) [1] 0. Reference:
Yakir, B. (2011). Introduction to statistical thinking (with R, without calculus). Retrieved from https://my.uopeople.edu/pluginfile.php/140868/mod_resource/content/2/ MATH1208AnnotatedBook.pdf