tft_mrdka

mail@pastecode.io avatar
unknown
python
2 years ago
1.0 kB
6
Indexable
Never
import random
import pandas as pd 
vysledky= list(range(0,100000))
pravdepodobnosti_postav= [1]*19+[2]*30+[3]*35+[4]*15+[5]*1
chteny_pocet_samir = 4
for opakovani in range(0,100000):
#samira, prvni pozice 
    pocet_3_cost_v_shopu= list(range(0,13))*18
    pocet_3_cost_v_shopu.sort()
    pocet_opakovani = 36 
    pocet_samir = 0
    
    karticky_costy =random.sample(pravdepodobnosti_postav, 5)
    
    for i in range(0,pocet_opakovani):
        pocet_3_cost_z_5 = 0
        for j in range(0,5):
            if karticky_costy[j]==3:
                pocet_3_cost_z_5=pocet_3_cost_z_5+1
        shop = random.sample(pocet_3_cost_v_shopu,pocet_3_cost_z_5)
        for k in range(0,pocet_3_cost_z_5):
            if shop[k]== 0:
                pocet_samir = pocet_samir +1
                pocet_3_cost_v_shopu = pocet_3_cost_v_shopu[1:]
    vysledky[opakovani]= pocet_samir

pd_vysledky = pd.DataFrame(vysledky)
pd_vysledky.columns = ["vysledky"]
sum(pd_vysledky["vysledky"]>4)/100000