Update second.py

This commit is contained in:
Daniel
2022-12-05 14:50:45 +02:00
committed by GitHub
parent cfd9442eec
commit 1b9db2417c

View File

@@ -1,11 +1,17 @@
import random
counter = 0
for _ in range(1000000):
part1 = random.uniform(0, 1)
part2 = random.uniform(0, 1-part1)
part3 = 1 - part1 - part2
for _ in range(100000):
b1 = random.uniform(0, 1)
b2 = random.uniform(0, 1)
if b2 > b1:
part1 = b1
part2 = b2 - b1
part3 = 1 - b2
else:
part1 = b2
part2 = b1 - b2
part3 = 1 - b1
if part1+part2 > part3 and part1+part3 > part2 and part2+part3 > part1:
counter+=1
print(counter/1000000)
print(counter/100000)