Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pylab import *
- def pf():
- L = []
- pile = 0
- for i in range(0,100):
- L.append(randint(0,2))
- if (L[i] == 1):
- pile += 1
- return pile
- def exo1() :
- prop53 = 0
- prop49 = 0
- for i in range (0,20000):
- jeu = pf()
- if (jeu > 53):
- prop53 += 1
- elif (jeu < 49):
- prop49 += 1
- prop53 = prop53 / 20000 * 100
- prop49 = prop49 / 20000 * 100
- print("Proportions de 53 : " ,prop53)
- print("Proportions de 49 : " ,prop49)
- def pf_cons():
- L = []
- prob = []
- for j in range (3,9):
- pile = 0
- cons = 0;
- last_cons = False
- for i in range(0,100):
- L.append(randint(0,2))
- if (L[i] == 1):
- pile += 1
- if( pile >= j and last_cons == False):
- cons += 1
- last_cons = True
- else:
- pile = 0
- last_cons = False
- print(L)
- prob.append(cons)
- return prob
- hist(pf_cons(),6)
- show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement