In: Statistics and Probability
Suppose that a certain member of the Los Angeles Clippers is
considered a streaky player. That is, many people believe that his
shots are not independent. If he makes a shot, they believe he is
more likely to make his next shot and vice-versa. As evidence,
people point to a recent game where this player took 30 shots and
had a streak of 6 made shots in a row. Is this evidence of
streakiness or could it have occurred simply by chance? Assuming
this player makes 70% of his shots and that his shots are
independent,
design and conduct a simulation (do 10 runs) to estimate the
probability of having at least one streak of 6 or more made shots
in 30 attempts.
Here is the R code for simulation:
We have generated 30 Bernoulli samples each time. Thes Bernoulli random variables represent if the player was able to score in a game with probability.
Here "for" loop represents that simulation is done 10 times.
"if" statement counts the number of instances where the players get consecutive ones for 6 times i.e. he is able to score 6 consecutive baskets.
Please comment below if you have any doubts regarding the solution.