165k views
0 votes
Which of the following code lines will compute the probability of getting at most 2 heads in 5 coin flips?

Hint: You may verify the answer by hand by checking the binomial distribution table in Quercus.
1. pbinom (2,5,0.5)
2. dbinom(5, 2,0.5)
3. pbinom (5,2,0.5)
4. dbinom (2,5,0.5)

User Gyscos
by
7.4k points

1 Answer

3 votes

Final answer:

The correct answer is '1. pbinom (2,5,0.5)' as this calculates the cumulative probability of obtaining at most 2 heads in 5 fair coin flips.

Step-by-step explanation:

The correct code line that will compute the probability of getting at most 2 heads in 5 coin flips is 1. pbinom (2,5,0.5). This function, pbinom, calculates the cumulative probability of getting a certain number of successes (in this case, heads) in a specified number of Bernoulli trials (coin flips), given a certain probability of success on any given trial. Option 1 gives us the cumulative probability of getting 0, 1, or 2 heads in 5 flips of a fair coin, where the probability of getting a head on any single flip is 0.5. Therefore, the pbinom function fits the scenario where each outcome is equally likely, such as a fair coin toss.

User Chenna
by
7.0k points