Set hits = 0
iterations:
{
Randomly pick four numbers x1, y1, x2, y2 between 0 and 1
if (x2-x1)^2 + (y2-y1)^2 > 1, increment hits by 1
}
probability = hits / iterations
Set hits = 0
iterations:
{
Randomly pick four numbers x1, y1, x2, y2 between 0 and 1
if (x2-x1)^2 + (y2-y1)^2 > 1, increment hits by 1
}
probability = hits / iterations
• 你的答案夠準確了.精確答案:Pi-13/6=0.974925986 -Blue_Diamond- ♂ (0 bytes) () 02/14/2011 postreply 23:50:20
WENXUECITY.COM does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by other users.
Copyright ©1998-2025 wenxuecity.com All rights reserved. Privacy Statement & Terms of Use & User Privacy Protection Policy