can this code be improved

D

David Segall

Print Guy said:
Yes, the odds are 1 in 6 if you roll a dice once. But what if you roll
a 6 sided dice 5000000 times? I still think that 4 or 5 will occur
more times... I don't have time to roll a dice that many times, but it
makes sense that it should apply no matter how many times you roll the
die as long as it is a large number of times.
If you agree that the odds are 1 in 6 for the first roll then the odds
must be 1 in 6 for the second roll since the dice has no way of
"knowing" that it has been rolled once already. That is still true for
the third roll right up to the 5000000th roll.

Incidentally, why did you decide that it was four or five that would
come up more often? Why not one or six?
 
P

Print Guy

David said:
If you agree that the odds are 1 in 6 for the first roll then the odds
must be 1 in 6 for the second roll since the dice has no way of
"knowing" that it has been rolled once already. That is still true for
the third roll right up to the 5000000th roll.

Incidentally, why did you decide that it was four or five that would
come up more often? Why not one or six?


Experience?
Anyway this whole discussion has been fantastic. But I didn't win last
night. I used some of the programs we came up with in this thread
(including my original) and didn't come close to picking the right
numbers.. Even a piece of code that I found in the Horstman book didn't
pick the numbers... oh well
 
P

Patricia Shanahan

Print said:
Experience?

But you said you didn't have time to do the number of rolls at which you
expected the bias to show up?
Anyway this whole discussion has been fantastic. But I didn't win last
night. I used some of the programs we came up with in this thread
(including my original) and didn't come close to picking the right
numbers.. Even a piece of code that I found in the Horstman book didn't
pick the numbers... oh well

Assuming a difference in probabilities of numbers may be one of the
worst strategies for picking lottery numbers.

The people running the lottery can monitor their own equipment for bias,
and they have far more data than you do. You only get to see the few
numbers from actual lottery runs. They get all the output, including as
many test runs as they feel like doing between lottery runs.

On the other hand, there may be enough people assuming a bias that the
numbers that happen to have shown up most in recent lottery runs are
particularly popular. If so, picking those numbers would increase the
risk that, in the extremely unlikely event of a win, you would have to
share the prize.

Almost any strategy you can think of for picking the number will be
chosen by others. There is one strategy, picking your numbers at random,
with equal probability, for which that doesn't matter.

Patricia
 
Z

zero

Experience?

Seems to me like you're confusing Gaussian distributed values (for
example test scores, or people's heights) with truly random values (such
as lottery numbers - if the lottery is fair - or dice rolls). For
people's heights its it indeed true that there will be more people of
say 1.8m (6') than people of 2.3m (7'5"). With dice however there is no
reason to assume that the number 4 is likely to come up more often than
the number 1. Although it may be counterintuitive, rolling the number 6
5 times in a row is just as likely as rolling the (exact) sequence 5 2 4
5 3.
 
P

Print Guy

Patricia said:
But you said you didn't have time to do the number of rolls at which you
expected the bias to show up?


Assuming a difference in probabilities of numbers may be one of the
worst strategies for picking lottery numbers.

The people running the lottery can monitor their own equipment for bias,
and they have far more data than you do. You only get to see the few
numbers from actual lottery runs. They get all the output, including as
many test runs as they feel like doing between lottery runs.

On the other hand, there may be enough people assuming a bias that the
numbers that happen to have shown up most in recent lottery runs are
particularly popular. If so, picking those numbers would increase the
risk that, in the extremely unlikely event of a win, you would have to
share the prize.

Almost any strategy you can think of for picking the number will be
chosen by others. There is one strategy, picking your numbers at random,
with equal probability, for which that doesn't matter.

Patricia

20 rolls
1 = 4
2 = 4
3 = 3
4= 1
5=5
6=3

So I guess it would take more than 20 rolls before any kind of bias
would show up.

A while ago, I went back in "time" and wrote down all the winning
number combination for about 10 draws... if I remember correctly 14 was
a good number....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top