Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import random
n = 100000
avr = 0

for i in range(n):

	total=0
	a,b,c = random.randint(1,6),random.randint(1,6),random.randint(1,6)
	total += a+b+c
	if [a,b,c].count(a) == 3:
		while True:
			a,b,c = random.randint(1,6),random.randint(1,6),random.randint(1,6)
			total += a+b+c
			if [a,b,c].count(a) != 3:
				break

	if [a,b,c].count(a) == 2 or [a,b,c].count(b) == 2:
		while True:
			a,b = random.randint(1,6),random.randint(1,6)
			total += a+b
			if a!=b:
				break

	avr+=total

print(avr*n**-1)