Write an R function max.streak(p) that gives the length of the maximum "streak" of either all...

50.1K

Verified Solution

Question

Basic Math

Write an R function max.streak(p) that gives the length of themaximum "streak" of either all heads or all tails in 100 flips of a(possibly biased) coin whose probabilty of showing heads is pp.

Use your function to determine the expected length(rounded to the nearest integer) of the maximum streak seen in 100flips of a coin when the probability of seeing "heads" is0.700.70.

As a check of your work, note that the expected length of themaximum streak seen in 100 flips of a fair coin should be veryclose to 7.

Answer & Explanation Solved by verified expert
3.5 Ratings (454 Votes)
R    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students