comp.lang.ada
 help / color / mirror / Atom feed
* Lotto simulation
@ 2014-06-15 17:07 montgrimpulo
  2014-06-15 18:54 ` Stefan.Lucks
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: montgrimpulo @ 2014-06-15 17:07 UTC (permalink / raw)


Hi,

this is a placeholder of the task which I am trying to solve in Ada.
As you may know in German Lotto there are 49 numbers 1..49 
from which you have to select 6 numbers to place a bet.

First Round:
By defining a subtype valid for positive numbers from 1 .. 49,
the use of Ada.Discrete_Random, and the definition of an appropriate Generator
you may get a random number in the range of 1 .. 49.

Second Round:
Here does my problem start. Now I have a set of numbers where
one number - which was randomly selected in the first round -
is missing. How do I use the random function to select another 
random number out of the rest ?

Third to the Six's Round:
same problem.

Any ideas to answer that question ?

A workaround would be
to test in each round, if that number has already been selected.
However, the probability would not be the same as with a reduced
set as the selection would be always from the full set.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-06-16 20:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-15 17:07 Lotto simulation montgrimpulo
2014-06-15 18:54 ` Stefan.Lucks
2014-06-15 19:53   ` J-P. Rosen
2014-06-16  5:25     ` Stefan.Lucks
2014-06-16  7:49       ` J-P. Rosen
2014-06-16 11:15         ` Stefan.Lucks
2014-06-16 13:40           ` J-P. Rosen
2014-06-16 14:13             ` Natasha Kerensikova
2014-06-16 17:51             ` Randy Brukardt
2014-06-15 19:56 ` Denis McMahon
2014-06-15 20:10 ` Dirk Heinrichs
2014-06-15 20:43   ` Simon Wright
2014-06-16 20:22     ` Dirk Heinrichs
2014-06-15 20:54 ` Simon Wright
2014-06-15 22:09 ` Jeffrey Carter
2014-06-16 11:40 ` Markus Schöpflin
2014-06-16 14:25   ` Jacob Sparre Andersen
2014-06-16 12:02 ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox