CoCalc Public Filesclasswork.ipynbOpen with one click!
Authors: Julia Burnside, MIRALIA MOREAU, Jose Armando Sanchez Diaz
Views : 126
Compute Environment: Ubuntu 20.04 (Default)

Fliping a coin 10 times 0- tails

1- heads This discussion problem is about flipping a fair coin 10 times and calculating the probability that at least 4 consecutive tails.I use the code to do it that way , however the way I was thinking to do was to use the formula where n= 10 and (x>=4)and then I would take [1 -p(x=3)+p(x=2)+p(x=1)+p(x=0) the result would be the probability for at least 4 tails when flipping a coin 10 times.

In [1]:
import numpy as np
In [2]:
flips=np.random.randint(0,2, size=10)
In [4]:
array([0, 0, 0, 0, 1, 1, 0, 0, 1, 1])
In [ ]:
since I already know that tails=0 and heads =1, therefore I will say according to what I observe I think the probability to get 4 consecutive tails is 1/10.