Workings & Source for Project Euler solutions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
541 B

#! /usr/bin/python3
from decimal import *
import random
total=[]
for i in range(1000):
print(i)
for o in range(10):
balls=[]
bag=[]
for color in range(70):
balls.append(int(random.uniform(0,7)))
for choice in range(10):
choose=int(random.uniform(0,70))
while balls[choose]==-1:
choose=int(random.uniform(0,70))
bag.append(balls[choose])
balls[choose]=-1
allCount=len(set(balls))
total.append(allCount)
a=Decimal(sum(total))
b=Decimal(len(total))
c=Decimal(a/b)
print(getcontext())
print(c)
print(total)