From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.197.172 with SMTP id iv12mr3457545obc.1.1402852079654; Sun, 15 Jun 2014 10:07:59 -0700 (PDT) X-Received: by 10.140.41.35 with SMTP id y32mr263981qgy.1.1402852079618; Sun, 15 Jun 2014 10:07:59 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!h3no3430398igd.0!news-out.google.com!a8ni4126qaq.1!nntp.google.com!i13no2261930qae.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 15 Jun 2014 10:07:59 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.233.148.43; posting-account=ZoAlyAoAAACOOtSiXyaM8n3y8T4ScfeH NNTP-Posting-Host: 109.233.148.43 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <77cc4476-8c57-481b-afb9-8f53f8b16e37@googlegroups.com> Subject: Lotto simulation From: montgrimpulo Injection-Date: Sun, 15 Jun 2014 17:07:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 1948 Xref: number.nntp.dca.giganews.com comp.lang.ada:186926 Date: 2014-06-15T10:07:59-07:00 List-Id: 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.