Question
Now that you can simulate coin flips, and do it lots of times, lets try to explore the reality of coins a bit further. People
Now that you can simulate coin flips, and do it lots of times, lets try to explore the reality of coins a bit further. People generally think that getting a streak of coin flips, where the same side comes up over and over again, is extremely rare. In reality, it happens quite often. Write a function, coin_streak, that takes as input a number which is the streak length, and performs random flips until a streak of that number is achieved. The function should record the total number of flips needed to get a streak.
So, the function should look like the following:
Number of flips needed for streak of 10: 874
Important Note: we are using the programming language Python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started