Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Next Advisor Conference
Message
From
15/11/2003 11:58:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/11/2003 11:47:17
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Conferences & events
Miscellaneous
Thread ID:
00846318
Message ID:
00850260
Views:
24
Here is some quick-and-dirty VFP-code:
* Simulate 2 dice
dimension anumbers(12)
anumbers = 0
rand(0)
for i = 1 to 10000
	die1 = int(rand() * 6 + 1)
	die2 = int(rand() * 6 + 1)
	sum = die1 + die2
	anumbers(sum) = anumbers(sum) + 1
next

clear
for i = 2 to 12
	? i, anumbers(i)
next
>You get more precise results with more rolls. 'Tis easier to simulate this with a computer. Excel can come in quite handy, or you can use a small program in VFP.
>
>>Hi Hilmar,
>>
>>I'm a little wierd, so I actually tried the experiment. I too expected the results to form a pyramid, but to my surprise when I graphed the number out, they fit a bell curve more than a pyramad. Maybe the dice I rolled were not honest or maybe I didn't roll the dice enough times, so I can't explain it.
>>
>>Regards,
>>
>>LelandJ
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform