Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The memory management on the PowerPC can be used to frighten small children. -- Linus Torvalds


devel / comp.lang.c / Re: Compute Unique Numbers in a Set

SubjectAuthor
* Compute Unique Numbers in a SetAlbert
+* Re: Compute Unique Numbers in a SetChris M. Thomasson
|`* Re: Compute Unique Numbers in a SettTh
| `- Re: Compute Unique Numbers in a SetChris M. Thomasson
+* Re: Compute Unique Numbers in a SetRichard Damon
|`* Re: Compute Unique Numbers in a SetBen Bacarisse
| `* Re: Compute Unique Numbers in a SetRichard Damon
|  `* Re: Compute Unique Numbers in a SetBen Bacarisse
|   `* Re: Compute Unique Numbers in a SetRichard Damon
|    `* Re: Compute Unique Numbers in a SetBen Bacarisse
|     `* Re: Compute Unique Numbers in a SetRichard Damon
|      `* Re: Compute Unique Numbers in a SetBen Bacarisse
|       `* Re: Compute Unique Numbers in a SetRichard Damon
|        `* Re: Compute Unique Numbers in a SetBen Bacarisse
|         `* Re: Compute Unique Numbers in a SetRichard Damon
|          `* Re: Compute Unique Numbers in a SetBen Bacarisse
|           `* Re: Compute Unique Numbers in a SetRichard Damon
|            `- Re: Compute Unique Numbers in a SetBen Bacarisse
+- Re: Compute Unique Numbers in a SetTim Rentsch
+* Re: Compute Unique Numbers in a SetBen Bacarisse
|+* Re: Compute Unique Numbers in a SetMike Terry
||`- Re: Compute Unique Numbers in a SetBen Bacarisse
|`- Re: Compute Unique Numbers in a SetTim Rentsch
+- Re: Compute Unique Numbers in a SetManu Raju
+* Re: Compute Unique Numbers in a Setantispam
|`* Re: Compute Unique Numbers in a SetRichard Damon
| +* Re: Compute Unique Numbers in a SetTim Rentsch
| |`- Re: Compute Unique Numbers in a SetRichard Damon
| `- Re: Compute Unique Numbers in a Setantispam
+- Re: Compute Unique Numbers in a Setjak
+* Re: Compute Unique Numbers in a SetRosario19
|`- Re: Compute Unique Numbers in a SetRosario19
+* Re: Compute Unique Numbers in a SetKenny McCormack
|+* Re: Compute Unique Numbers in a Setjak
||+- Re: Compute Unique Numbers in a Setjak
||`* Re: Compute Unique Numbers in a SetTim Rentsch
|| `- Re: Compute Unique Numbers in a SetÖö Tiib
|`- Re: Compute Unique Numbers in a SetKenny McCormack
+- Re: Compute Unique Numbers in a SetBart
+* Re: Compute Unique Numbers in a SetStefan Ram
|`* Re: Compute Unique Numbers in a SetRichard Damon
| `* Re: Compute Unique Numbers in a SetBen Bacarisse
|  +- Re: Compute Unique Numbers in a SetRichard Damon
|  +- Re: Compute Unique Numbers in a SetSiri Cruise
|  +- Re: Compute Unique Numbers in a SetTim Rentsch
|  +- Re: Compute Unique Numbers in a SetDavid Brown
|  `* Re: Compute Unique Numbers in a SetTim Rentsch
|   `* Re: Compute Unique Numbers in a SetKenny McCormack
|    `- Re: Compute Unique Numbers in a SetDavid Brown
+* Re: Compute Unique Numbers in a SetBonita Montero
|+- Re: Compute Unique Numbers in a SetBonita Montero
|+* Re: Compute Unique Numbers in a SetKenny McCormack
||`* Re: Compute Unique Numbers in a SetBonita Montero
|| +* Re: Compute Unique Numbers in a SetBonita Montero
|| |+* Re: Compute Unique Numbers in a SetBart
|| ||+* Re: Compute Unique Numbers in a SetBonita Montero
|| |||`* Re: Compute Unique Numbers in a SetBart
|| ||| `* Re: Compute Unique Numbers in a SetBonita Montero
|| |||  `* Re: Compute Unique Numbers in a SetBart
|| |||   `- Re: Compute Unique Numbers in a SetBonita Montero
|| ||`* Re: Compute Unique Numbers in a SetBart
|| || `* Re: Compute Unique Numbers in a SetIke Naar
|| ||  `* Re: Compute Unique Numbers in a SetBart
|| ||   `- Re: Compute Unique Numbers in a SetChris M. Thomasson
|| |+- Re: Compute Unique Numbers in a SetPaavo Helde
|| |`* Re: Compute Unique Numbers in a SetAlf P. Steinbach
|| | `* Re: Compute Unique Numbers in a SetBonita Montero
|| |  +- Re: Compute Unique Numbers in a SetMalcolm McLean
|| |  +* Re: Compute Unique Numbers in a SetBen Bacarisse
|| |  |`* Re: Compute Unique Numbers in a SetMalcolm McLean
|| |  | +* Re: Compute Unique Numbers in a SetMalcolm McLean
|| |  | |`* Re: Compute Unique Numbers in a SetBen Bacarisse
|| |  | | `* Re: Compute Unique Numbers in a SetMalcolm McLean
|| |  | |  `* Re: Compute Unique Numbers in a SetBen Bacarisse
|| |  | |   `- Re: Compute Unique Numbers in a SetMalcolm McLean
|| |  | `- Re: Compute Unique Numbers in a SetBen Bacarisse
|| |  `* Re: Compute Unique Numbers in a SetBonita Montero
|| |   +- Re: Compute Unique Numbers in a SetMalcolm McLean
|| |   +* Re: Compute Unique Numbers in a SetKenny McCormack
|| |   |`* Re: Compute Unique Numbers in a SetBonita Montero
|| |   | `* Re: Compute Unique Numbers in a SetKenny McCormack
|| |   |  `* Re: Compute Unique Numbers in a SetBonita Montero
|| |   |   `- Re: Compute Unique Numbers in a SetKenny McCormack
|| |   `* Re: Compute Unique Numbers in a SetBonita Montero
|| |    +* Re: Compute Unique Numbers in a SetBart
|| |    |`- Re: Compute Unique Numbers in a SetBonita Montero
|| |    `- Re: Compute Unique Numbers in a SetKenny McCormack
|| `* Re: Compute Unique Numbers in a SettTh
||  `* Re: Compute Unique Numbers in a SetBonita Montero
||   `- Re: Compute Unique Numbers in a SetKenny McCormack
|`- Re: Compute Unique Numbers in a SetChris M. Thomasson
+- Re: Compute Unique Numbers in a SetBen Bacarisse
`- Re: Compute Unique Numbers in a SetJohn Forkosh

Pages:1234
Re: Compute Unique Numbers in a Set

<b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24234&group=comp.lang.c#24234

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2150:b0:702:698:9025 with SMTP id m16-20020a05620a215000b0070206989025mr4324747qkm.498.1673318672507;
Mon, 09 Jan 2023 18:44:32 -0800 (PST)
X-Received: by 2002:a05:6214:37c4:b0:4bb:70e9:7372 with SMTP id
nj4-20020a05621437c400b004bb70e97372mr2395804qvb.30.1673318672223; Mon, 09
Jan 2023 18:44:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 9 Jan 2023 18:44:31 -0800 (PST)
In-Reply-To: <95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:b128:4a33:2631:c41c;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:b128:4a33:2631:c41c
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk> <95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com>
Subject: Re: Compute Unique Numbers in a Set
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Tue, 10 Jan 2023 02:44:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3602
 by: Malcolm McLean - Tue, 10 Jan 2023 02:44 UTC

On Tuesday, 10 January 2023 at 02:28:48 UTC, Malcolm McLean wrote:
> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
> > Bonita Montero <Bonita....@gmail.com> writes:
> >
> > > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
> > >
> > >> When n is large and is near or equal to the number of possible
> > >> values, this loop becomes inefficient: for the last number you can
> > >> expect on average n iterations to find that number, because each call
> > >> of uid has a 1/n chance of finding it.
> > >
> > > I know that the loop becomes inefficient then, but tell me a better
> > > alternative algorithm.
> > An alternative that works well in those cases (and in some others) has
> > already been described where each candidate is chosen with the
> > appropriate probability. I originally set it out as an exercises since
> > I thought the OP was doing homework, but the gist of it was explained.
> > > You'd have a list of eligible numbers and
> > > randomly chose one of them. That would also take a lot of time to
> > > remove the number from the list.
> > No need:
> >
> > void choose(int choose_n, int from_m, int *output)
> > {
> > for (int i = 0, j = 0; j < choose_n; i++)
> > if (true_with_probability(choose_n - j, from_m - i))
> > output[j++] = i + 1;
> > }
> >
> > Obviously using one would not use this to choose 3 numbers from a set of
> > millions!
> >
> We're choosing M values from N.
> If we choose a random member, i, then we have two sets, 0 to i-1, and i+1 to N-1,
> and M-1 values left to choose.
> So basically we would expect a binomial distribution, with each remaining value
> having an (i-1)/(N-1) chance of ending up in the first set. We then recurse.
> However the whole point of the problem is that the distribution is discrete, and this
> isn't quite correct, because we could end up with more values to choose than
> members of the set. This would happen very rarely if N is large in relation to M,
> but it could happen.
> I'm not quite sure how to correct for this.
>
Ah. It's the hypergeometric distribution. Very messy.

Re: Compute Unique Numbers in a Set

<87v8lft7u1.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24235&group=comp.lang.c#24235

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Compute Unique Numbers in a Set
Date: Tue, 10 Jan 2023 02:57:26 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <87v8lft7u1.fsf@bsb.me.uk>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk>
<95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e096f54318738fad801eff705e3dc5c5";
logging-data="379467"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tNgms2yIq0gWzITQgRRxSenk+SoLflMA="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:aPdyjk0J2zjY77D+FjtAqGWa1kk=
sha1:SXVnY9Ng8lmaPO6tnZHC2AA9exE=
X-BSB-Auth: 1.b0eae5e7faa9c7241a79.20230110025726GMT.87v8lft7u1.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 10 Jan 2023 02:57 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
>> Bonita Montero <Bonita....@gmail.com> writes:
>>
>> > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
>> >
>> >> When n is large and is near or equal to the number of possible
>> >> values, this loop becomes inefficient: for the last number you can
>> >> expect on average n iterations to find that number, because each call
>> >> of uid has a 1/n chance of finding it.
>> >
>> > I know that the loop becomes inefficient then, but tell me a better
>> > alternative algorithm.
>> An alternative that works well in those cases (and in some others) has
>> already been described where each candidate is chosen with the
>> appropriate probability. I originally set it out as an exercises since
>> I thought the OP was doing homework, but the gist of it was explained.
>> > You'd have a list of eligible numbers and
>> > randomly chose one of them. That would also take a lot of time to
>> > remove the number from the list.
>> No need:
>>
>> void choose(int choose_n, int from_m, int *output)
>> {
>> for (int i = 0, j = 0; j < choose_n; i++)
>> if (true_with_probability(choose_n - j, from_m - i))
>> output[j++] = i + 1;
>> }
>>
>> Obviously using one would not use this to choose 3 numbers from a set of
>> millions!
>>
> We're choosing M values from N.

This function chooses "choose_n" from "from_m". Not great names I
admit...

> If we choose a random member, i, then we have two sets, 0 to i-1, and
> i+1 to N-1, and M-1 values left to choose.
> So basically we would expect a binomial distribution, with each
> remaining value having an (i-1)/(N-1) chance of ending up in the first
> set. We then recurse.
> However the whole point of the problem is that the distribution is>
> discrete, and this isn't quite correct, because we could end up with
> more values to choose than members of the set. This would happen very
> rarely if N is large in relation to M, but it could happen. I'm not
> quite sure how to correct for this.

I can't follow this. Do you think there is a problem with the
algorithm?

Every candidate is considered, and i is chosen with a probability that
takes account of how many numbers have already been selected (j) and how
many candidates remain (from_m - i).

--
Ben.

Re: Compute Unique Numbers in a Set

<87pmbnt7bo.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24236&group=comp.lang.c#24236

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Compute Unique Numbers in a Set
Date: Tue, 10 Jan 2023 03:08:27 +0000
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <87pmbnt7bo.fsf@bsb.me.uk>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk>
<95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
<b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e096f54318738fad801eff705e3dc5c5";
logging-data="379467"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qkyjdzuFuho9JFCAQ80Xibu+92t3VDKY="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:O4QTgJka8bo6LXo/6v9OLON7R+Q=
sha1:Ts5GT54GxpEw8GNVJgiwLik/7CM=
X-BSB-Auth: 1.5a9efb5a4d812a64ce21.20230110030827GMT.87pmbnt7bo.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 10 Jan 2023 03:08 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Tuesday, 10 January 2023 at 02:28:48 UTC, Malcolm McLean wrote:
>> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
>> > Bonita Montero <Bonita....@gmail.com> writes:
>> >
>> > > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
>> > >
>> > >> When n is large and is near or equal to the number of possible
>> > >> values, this loop becomes inefficient: for the last number you can
>> > >> expect on average n iterations to find that number, because each call
>> > >> of uid has a 1/n chance of finding it.
>> > >
>> > > I know that the loop becomes inefficient then, but tell me a better
>> > > alternative algorithm.
>> > An alternative that works well in those cases (and in some others) has
>> > already been described where each candidate is chosen with the
>> > appropriate probability. I originally set it out as an exercises since
>> > I thought the OP was doing homework, but the gist of it was explained.
>> > > You'd have a list of eligible numbers and
>> > > randomly chose one of them. That would also take a lot of time to
>> > > remove the number from the list.
>> > No need:
>> >
>> > void choose(int choose_n, int from_m, int *output)
>> > {
>> > for (int i = 0, j = 0; j < choose_n; i++)
>> > if (true_with_probability(choose_n - j, from_m - i))
>> > output[j++] = i + 1;
>> > }
>> >
>> > Obviously using one would not use this to choose 3 numbers from a set of
>> > millions!
>> >
>> We're choosing M values from N.
>> If we choose a random member, i, then we have two sets, 0 to i-1, and i+1 to N-1,
>> and M-1 values left to choose.
>> So basically we would expect a binomial distribution, with each remaining value
>> having an (i-1)/(N-1) chance of ending up in the first set. We then recurse.
>> However the whole point of the problem is that the distribution is discrete, and this
>> isn't quite correct, because we could end up with more values to choose than
>> members of the set. This would happen very rarely if N is large in relation to M,
>> but it could happen.
>> I'm not quite sure how to correct for this.
>>
> Ah. It's the hypergeometric distribution. Very messy.

What quantity are you referring to? There may be something that has a
messy distribution in all of this but (a) I don't know what quantity you
are talking about and (b) I don't think it matters.

--
Ben.

Re: Compute Unique Numbers in a Set

<10075776-987b-4a31-9fd5-9942a02a67f4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24237&group=comp.lang.c#24237

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:47cb:0:b0:3ab:652f:504e with SMTP id d11-20020ac847cb000000b003ab652f504emr2618506qtr.277.1673320799467;
Mon, 09 Jan 2023 19:19:59 -0800 (PST)
X-Received: by 2002:ae9:e509:0:b0:6fe:daa7:270 with SMTP id
w9-20020ae9e509000000b006fedaa70270mr3508508qkf.182.1673320799172; Mon, 09
Jan 2023 19:19:59 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 9 Jan 2023 19:19:58 -0800 (PST)
In-Reply-To: <87pmbnt7bo.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:64ea:e65c:3e2c:95ed;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:64ea:e65c:3e2c:95ed
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk> <95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
<b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com> <87pmbnt7bo.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <10075776-987b-4a31-9fd5-9942a02a67f4n@googlegroups.com>
Subject: Re: Compute Unique Numbers in a Set
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Tue, 10 Jan 2023 03:19:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4771
 by: Malcolm McLean - Tue, 10 Jan 2023 03:19 UTC

On Tuesday, 10 January 2023 at 03:08:40 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>
> > On Tuesday, 10 January 2023 at 02:28:48 UTC, Malcolm McLean wrote:
> >> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
> >> > Bonita Montero <Bonita....@gmail.com> writes:
> >> >
> >> > > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
> >> > >
> >> > >> When n is large and is near or equal to the number of possible
> >> > >> values, this loop becomes inefficient: for the last number you can
> >> > >> expect on average n iterations to find that number, because each call
> >> > >> of uid has a 1/n chance of finding it.
> >> > >
> >> > > I know that the loop becomes inefficient then, but tell me a better
> >> > > alternative algorithm.
> >> > An alternative that works well in those cases (and in some others) has
> >> > already been described where each candidate is chosen with the
> >> > appropriate probability. I originally set it out as an exercises since
> >> > I thought the OP was doing homework, but the gist of it was explained.
> >> > > You'd have a list of eligible numbers and
> >> > > randomly chose one of them. That would also take a lot of time to
> >> > > remove the number from the list.
> >> > No need:
> >> >
> >> > void choose(int choose_n, int from_m, int *output)
> >> > {
> >> > for (int i = 0, j = 0; j < choose_n; i++)
> >> > if (true_with_probability(choose_n - j, from_m - i))
> >> > output[j++] = i + 1;
> >> > }
> >> >
> >> > Obviously using one would not use this to choose 3 numbers from a set of
> >> > millions!
> >> >
> >> We're choosing M values from N.
> >> If we choose a random member, i, then we have two sets, 0 to i-1, and i+1 to N-1,
> >> and M-1 values left to choose.
> >> So basically we would expect a binomial distribution, with each remaining value
> >> having an (i-1)/(N-1) chance of ending up in the first set. We then recurse.
> >> However the whole point of the problem is that the distribution is discrete, and this
> >> isn't quite correct, because we could end up with more values to choose than
> >> members of the set. This would happen very rarely if N is large in relation to M,
> >> but it could happen.
> >> I'm not quite sure how to correct for this.
> >>
> > Ah. It's the hypergeometric distribution. Very messy.
> What quantity are you referring to? There may be something that has a
> messy distribution in all of this but (a) I don't know what quantity you
> are talking about and (b) I don't think it matters.
>
The alorithm is we choose M values from a set of N.
So choose a single value, call it i, using a standard uniform random number.
Now we've got M-1 values to choose, from two sets, 0 to i-1, and i+1 to N-1.
So if we take another rnadom number, we can work out how many values
we need from the first set, and thus how many values from the second set,
and we recurse.
But what is the distribution of those values? It's close to binomial. But it's
binomial without repalcement. Which is the hypergeomtric distribution.

However if we can draw one number from the hypergeomtric distribution,
in constant time, then the algorithm is O(M).

Re: Compute Unique Numbers in a Set

<87cz7mthzl.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24238&group=comp.lang.c#24238

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Compute Unique Numbers in a Set
Date: Tue, 10 Jan 2023 17:30:22 +0000
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <87cz7mthzl.fsf@bsb.me.uk>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk>
<95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
<b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com>
<87pmbnt7bo.fsf@bsb.me.uk>
<10075776-987b-4a31-9fd5-9942a02a67f4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="e096f54318738fad801eff705e3dc5c5";
logging-data="636422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DVrzZXr//Q2mA4bUSn8Xc8tQMDiYWr4M="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:M6B2zOxI7cbpiG6iAC/jzVMFvGY=
sha1:+X1rX5PQTbXFCTqrARzWz9EiEfU=
X-BSB-Auth: 1.ae40893d785e94c4f31c.20230110173022GMT.87cz7mthzl.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 10 Jan 2023 17:30 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Tuesday, 10 January 2023 at 03:08:40 UTC, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>
>> > On Tuesday, 10 January 2023 at 02:28:48 UTC, Malcolm McLean wrote:
>> >> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
>> >> > Bonita Montero <Bonita....@gmail.com> writes:
>> >> >
>> >> > > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
>> >> > >
>> >> > >> When n is large and is near or equal to the number of possible
>> >> > >> values, this loop becomes inefficient: for the last number you can
>> >> > >> expect on average n iterations to find that number, because each call
>> >> > >> of uid has a 1/n chance of finding it.
>> >> > >
>> >> > > I know that the loop becomes inefficient then, but tell me a better
>> >> > > alternative algorithm.
>> >> > An alternative that works well in those cases (and in some others) has
>> >> > already been described where each candidate is chosen with the
>> >> > appropriate probability. I originally set it out as an exercises since
>> >> > I thought the OP was doing homework, but the gist of it was explained.
>> >> > > You'd have a list of eligible numbers and
>> >> > > randomly chose one of them. That would also take a lot of time to
>> >> > > remove the number from the list.
>> >> > No need:
>> >> >
>> >> > void choose(int choose_n, int from_m, int *output)
>> >> > {
>> >> > for (int i = 0, j = 0; j < choose_n; i++)
>> >> > if (true_with_probability(choose_n - j, from_m - i))
>> >> > output[j++] = i + 1;
>> >> > }
>> >> >
>> >> > Obviously using one would not use this to choose 3 numbers from a set of
>> >> > millions!
>> >> >
>> >> We're choosing M values from N.
>> >> If we choose a random member, i, then we have two sets, 0 to i-1, and i+1 to N-1,
>> >> and M-1 values left to choose.
>> >> So basically we would expect a binomial distribution, with each remaining value
>> >> having an (i-1)/(N-1) chance of ending up in the first set. We then recurse.
>> >> However the whole point of the problem is that the distribution is discrete, and this
>> >> isn't quite correct, because we could end up with more values to choose than
>> >> members of the set. This would happen very rarely if N is large in relation to M,
>> >> but it could happen.
>> >> I'm not quite sure how to correct for this.
>> >>
>> > Ah. It's the hypergeometric distribution. Very messy.
>> What quantity are you referring to? There may be something that has a
>> messy distribution in all of this but (a) I don't know what quantity you
>> are talking about and (b) I don't think it matters.
>>
> The alorithm is we choose M values from a set of N.

What algorithm? You posted in direct reply to what I posted. Are you
commenting on that code or just making some tangential remarks? If it's
the latter, a reply to the head post would have been more logical.

> So choose a single value, call it i, using a standard uniform random
> number.

OK, so you are not talking about the algorithm I posted, right?

Ah. I've seen a post in comp.lang.c++ with code and, yes, you are not
commenting on what I wrote.

--
Ben.

Re: Compute Unique Numbers in a Set

<a77b1106-54ef-46b4-a83a-3a488820074bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24239&group=comp.lang.c#24239

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:20dd:b0:705:97e9:68a3 with SMTP id f29-20020a05620a20dd00b0070597e968a3mr509468qka.132.1673372741956;
Tue, 10 Jan 2023 09:45:41 -0800 (PST)
X-Received: by 2002:a05:622a:22a1:b0:3a9:86d1:6b63 with SMTP id
ay33-20020a05622a22a100b003a986d16b63mr3405668qtb.3.1673372741700; Tue, 10
Jan 2023 09:45:41 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 10 Jan 2023 09:45:41 -0800 (PST)
In-Reply-To: <87cz7mthzl.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:7155:6daf:f67d:873a;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:7155:6daf:f67d:873a
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <87eds3uwdh.fsf@bsb.me.uk> <95e531a1-54f0-459c-8a90-552253495293n@googlegroups.com>
<b95f9698-560d-4bfd-9941-146f8d1c4341n@googlegroups.com> <87pmbnt7bo.fsf@bsb.me.uk>
<10075776-987b-4a31-9fd5-9942a02a67f4n@googlegroups.com> <87cz7mthzl.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a77b1106-54ef-46b4-a83a-3a488820074bn@googlegroups.com>
Subject: Re: Compute Unique Numbers in a Set
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Tue, 10 Jan 2023 17:45:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5259
 by: Malcolm McLean - Tue, 10 Jan 2023 17:45 UTC

On Tuesday, 10 January 2023 at 17:30:37 UTC, Ben Bacarisse wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>
> > On Tuesday, 10 January 2023 at 03:08:40 UTC, Ben Bacarisse wrote:
> >> Malcolm McLean <malcolm.ar...@gmail.com> writes:
> >>
> >> > On Tuesday, 10 January 2023 at 02:28:48 UTC, Malcolm McLean wrote:
> >> >> On Monday, 9 January 2023 at 23:22:24 UTC, Ben Bacarisse wrote:
> >> >> > Bonita Montero <Bonita....@gmail.com> writes:
> >> >> >
> >> >> > > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
> >> >> > >
> >> >> > >> When n is large and is near or equal to the number of possible
> >> >> > >> values, this loop becomes inefficient: for the last number you can
> >> >> > >> expect on average n iterations to find that number, because each call
> >> >> > >> of uid has a 1/n chance of finding it.
> >> >> > >
> >> >> > > I know that the loop becomes inefficient then, but tell me a better
> >> >> > > alternative algorithm.
> >> >> > An alternative that works well in those cases (and in some others) has
> >> >> > already been described where each candidate is chosen with the
> >> >> > appropriate probability. I originally set it out as an exercises since
> >> >> > I thought the OP was doing homework, but the gist of it was explained.
> >> >> > > You'd have a list of eligible numbers and
> >> >> > > randomly chose one of them. That would also take a lot of time to
> >> >> > > remove the number from the list.
> >> >> > No need:
> >> >> >
> >> >> > void choose(int choose_n, int from_m, int *output)
> >> >> > {
> >> >> > for (int i = 0, j = 0; j < choose_n; i++)
> >> >> > if (true_with_probability(choose_n - j, from_m - i))
> >> >> > output[j++] = i + 1;
> >> >> > }
> >> >> >
> >> >> > Obviously using one would not use this to choose 3 numbers from a set of
> >> >> > millions!
> >> >> >
> >> >> We're choosing M values from N.
> >> >> If we choose a random member, i, then we have two sets, 0 to i-1, and i+1 to N-1,
> >> >> and M-1 values left to choose.
> >> >> So basically we would expect a binomial distribution, with each remaining value
> >> >> having an (i-1)/(N-1) chance of ending up in the first set. We then recurse.
> >> >> However the whole point of the problem is that the distribution is discrete, and this
> >> >> isn't quite correct, because we could end up with more values to choose than
> >> >> members of the set. This would happen very rarely if N is large in relation to M,
> >> >> but it could happen.
> >> >> I'm not quite sure how to correct for this.
> >> >>
> >> > Ah. It's the hypergeometric distribution. Very messy.
> >> What quantity are you referring to? There may be something that has a
> >> messy distribution in all of this but (a) I don't know what quantity you
> >> are talking about and (b) I don't think it matters.
> >>
> > The alorithm is we choose M values from a set of N.
> What algorithm? You posted in direct reply to what I posted. Are you
> commenting on that code or just making some tangential remarks? If it's
> the latter, a reply to the head post would have been more logical.
> > So choose a single value, call it i, using a standard uniform random
> > number.
> OK, so you are not talking about the algorithm I posted, right?
>
> Ah. I've seen a post in comp.lang.c++ with code and, yes, you are not
> commenting on what I wrote.
>
You said "We would not use this algorithm to choose 3 numbers froma set of millions".
I was responding to that by providing an algorithm which does work well with such
a pair of sets. Sorry if that wasn't clear.

Re: Compute Unique Numbers in a Set

<tpr12i$1i7r6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24243&group=comp.lang.c#24243

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 08:26:56 +0100
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <tpr12i$1i7r6$1@dont-email.me>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 Jan 2023 07:26:10 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b466e1060080fe119cf4d64a354bc62d";
logging-data="1646438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194sQzUsW7HAVXH0bJnIXduXyj8GWVxtkU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:bHkNMB4ZpmVsLQebDUMdLbAiODk=
Content-Language: de-DE
In-Reply-To: <tphg58$866f$1@dont-email.me>
 by: Bonita Montero - Fri, 13 Jan 2023 07:26 UTC

Am 09.01.2023 um 17:42 schrieb Bonita Montero:
> Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
>
>> When n is large and is near or equal to the number of possible values,
>> this loop becomes inefficient: for the last number you can expect on
>> average n iterations to find that number, because each call of uid has
>> a 1/n chance of finding it.
>
> I know that the loop becomes inefficient then, but tell me a better
> alternative algorithm. You'd have a list of eligible numbers and
> randomly chose one of them. That would also take a lot of time to
> remove the number from the list.

Now I make a list of eligible numbers, randomly chode one of them
and remove the item from the list:

#include <iostream>
#include <charconv>
#include <random>
#include <concepts>
#include <vector>

using namespace std;

int main( int argc, char **argv )
{ try
{
if( argc < 4 )
return
cout << argv[0] << " n from to" << endl,
EXIT_FAILURE;
auto parse = []( char const *str, char const *err )
{
size_t value;
if( from_chars_result fcr = from_chars( str, str + strlen( str ),
value ); (bool)fcr.ec || *fcr.ptr )
throw invalid_argument( err );
return value;
};
size_t n = parse( argv[1], "wrong number of values" );
if( !n )
return EXIT_SUCCESS;
size_t
from = parse( argv[2], "wrong from-value" ),
to = parse( argv[3], "wrong to-value" );
if( from > to )
swap( from, to );
if( n - 1 > to - from )
return
cout << "n is too small" << endl,
EXIT_FAILURE;
vector<size_t> free;
free.resize( to - from + 1 );
for( size_t i = from; size_t &v : free )
v = i++;
mt19937_64 mt;
size_t above = to;
while( free.size() )
{
auto pick = free.begin() + (uniform_int_distribution<size_t>( 0,
free.size() - 1 ))( mt );
//cout << *pick << endl;
free.erase( pick );
}
}
catch( exception const &exc )
{
return
cout << exc.what() << endl,
EXIT_FAILURE;
}
}

But that's _much_ slower.

Re: Compute Unique Numbers in a Set

<c3e7f965-5fad-43cd-8c54-e6e35d71ae66n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24244&group=comp.lang.c#24244

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:514f:b0:3b2:2f35:c9c9 with SMTP id ew15-20020a05622a514f00b003b22f35c9c9mr191747qtb.96.1673609534821;
Fri, 13 Jan 2023 03:32:14 -0800 (PST)
X-Received: by 2002:a25:d0cd:0:b0:7c0:10aa:961e with SMTP id
h196-20020a25d0cd000000b007c010aa961emr1446050ybg.346.1673609534588; Fri, 13
Jan 2023 03:32:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 13 Jan 2023 03:32:14 -0800 (PST)
In-Reply-To: <tpr12i$1i7r6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:3d92:90be:9952:ed68;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:3d92:90be:9952:ed68
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c3e7f965-5fad-43cd-8c54-e6e35d71ae66n@googlegroups.com>
Subject: Re: Compute Unique Numbers in a Set
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Fri, 13 Jan 2023 11:32:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4157
 by: Malcolm McLean - Fri, 13 Jan 2023 11:32 UTC

On Friday, 13 January 2023 at 07:26:24 UTC, Bonita Montero wrote:
> Am 09.01.2023 um 17:42 schrieb Bonita Montero:
> > Am 09.01.2023 um 12:03 schrieb Alf P. Steinbach:
> >
> >> When n is large and is near or equal to the number of possible values,
> >> this loop becomes inefficient: for the last number you can expect on
> >> average n iterations to find that number, because each call of uid has
> >> a 1/n chance of finding it.
> >
> > I know that the loop becomes inefficient then, but tell me a better
> > alternative algorithm. You'd have a list of eligible numbers and
> > randomly chose one of them. That would also take a lot of time to
> > remove the number from the list.
> Now I make a list of eligible numbers, randomly chode one of them
> and remove the item from the list:
>
> #include <iostream>
> #include <charconv>
> #include <random>
> #include <concepts>
> #include <vector>
> using namespace std;
>
> int main( int argc, char **argv )
> {
> try
> {
> if( argc < 4 )
> return
> cout << argv[0] << " n from to" << endl,
> EXIT_FAILURE;
> auto parse = []( char const *str, char const *err )
> {
> size_t value;
> if( from_chars_result fcr = from_chars( str, str + strlen( str ),
> value ); (bool)fcr.ec || *fcr.ptr )
> throw invalid_argument( err );
> return value;
> };
> size_t n = parse( argv[1], "wrong number of values" );
> if( !n )
> return EXIT_SUCCESS;
> size_t
> from = parse( argv[2], "wrong from-value" ),
> to = parse( argv[3], "wrong to-value" );
> if( from > to )
> swap( from, to );
> if( n - 1 > to - from )
> return
> cout << "n is too small" << endl,
> EXIT_FAILURE;
> vector<size_t> free;
> free.resize( to - from + 1 );
> for( size_t i = from; size_t &v : free )
> v = i++;
> mt19937_64 mt;
> size_t above = to;
> while( free.size() )
> {
> auto pick = free.begin() + (uniform_int_distribution<size_t>( 0,
> free.size() - 1 ))( mt );
> //cout << *pick << endl;
> free.erase( pick );
> }
> }
> catch( exception const &exc )
> {
> return
> cout << exc.what() << endl,
> EXIT_FAILURE;
> }
> }
> But that's _much_ slower.
>
Yes. If you construct a list of "free" choice, then the algorithm is at least O(N), where
N is the number of items to choose from. If you use a vector and delete, then it's
O(NM), where M is the number of choices. However you can change this by using
a container which allows for O(log N) deletion.

Run time is inherently at least O(M), where M is the number of choices. The question is
how far you can get down the other factors. And you need to avoid catastrophic behaviour
when M gets close to N. The other behaviour to avoid is an N term in the runtime, if N can
be very large.

Re: Compute Unique Numbers in a Set

<tprics$2h9b5$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24245&group=comp.lang.c#24245

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 12:21:48 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tprics$2h9b5$1@news.xmission.com>
References: <todbqe$16sg$1@gioia.aioe.org> <tpgsar$5mge$1@dont-email.me> <tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
Injection-Date: Fri, 13 Jan 2023 12:21:48 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2663781"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 13 Jan 2023 12:21 UTC

In article <tpr12i$1i7r6$1@dont-email.me>,
some lunatic <Bonita.Montero@gmail.com> wrote:
....
>Now I make a list of eligible numbers, randomly chode one of them
>and remove the item from the list:
>
>#include <iostream>
>#include <charconv>
>#include <random>
>#include <concepts>
>#include <vector>

You still just don't seem to get this whole topicality thing, do ya?

--
Reading any post by Fred Hodgin, you're always faced with the choice of:
lunatic, moron, or troll.

I always try to be generous and give benefit of the doubt, by assuming troll.

Re: Compute Unique Numbers in a Set

<tprl89$1k839$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24246&group=comp.lang.c#24246

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 14:11:21 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tprl89$1k839$1@dont-email.me>
References: <todbqe$16sg$1@gioia.aioe.org> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
<tprics$2h9b5$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 Jan 2023 13:10:33 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b466e1060080fe119cf4d64a354bc62d";
logging-data="1712233"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wCJcKeCSFdRysjgjeFcuHjdi1Uxp2css="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:ijVSG7N1kp9RfI+yPjhfrwq28yM=
Content-Language: de-DE
In-Reply-To: <tprics$2h9b5$1@news.xmission.com>
 by: Bonita Montero - Fri, 13 Jan 2023 13:11 UTC

Am 13.01.2023 um 13:21 schrieb Kenny McCormack:
> In article <tpr12i$1i7r6$1@dont-email.me>,
> some lunatic <Bonita.Montero@gmail.com> wrote:
> ...
>> Now I make a list of eligible numbers, randomly chode one of them
>> and remove the item from the list:
>>
>> #include <iostream>
>> #include <charconv>
>> #include <random>
>> #include <concepts>
>> #include <vector>
>
> You still just don't seem to get this whole topicality thing, do ya?

My code is beyond that topic. You may elect only a small number
of values like in the original code, but you might also chose
million of numbers.

Re: Compute Unique Numbers in a Set

<tprntf$2hb2h$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24247&group=comp.lang.c#24247

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 13:55:59 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tprntf$2hb2h$1@news.xmission.com>
References: <todbqe$16sg$1@gioia.aioe.org> <tpr12i$1i7r6$1@dont-email.me> <tprics$2h9b5$1@news.xmission.com> <tprl89$1k839$1@dont-email.me>
Injection-Date: Fri, 13 Jan 2023 13:55:59 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2665553"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 13 Jan 2023 13:55 UTC

In article <tprl89$1k839$1@dont-email.me>,
some lunatic <Bonita.Montero@gmail.com> wrote:
>Am 13.01.2023 um 13:21 schrieb Kenny McCormack:
>> In article <tpr12i$1i7r6$1@dont-email.me>,
>> some lunatic <Bonita.Montero@gmail.com> wrote:
>> ...
>>> Now I make a list of eligible numbers, randomly chode one of them
>>> and remove the item from the list:
>>>
>>> #include <iostream>
>>> #include <charconv>
>>> #include <random>
>>> #include <concepts>
>>> #include <vector>
>>
>> You still just don't seem to get this whole topicality thing, do ya?
>
>My code is beyond that topic. You may elect only a small number
>of values like in the original code, but you might also chose
>million of numbers.

Whoooooosh!!!

--
Many people in the American South think that DJT is, and will be remembered
as, one of the best presidents in US history. They are absolutely correct.

He is currently at number 46 on the list. High praise, indeed!

Re: Compute Unique Numbers in a Set

<tpro7o$1ki63$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24248&group=comp.lang.c#24248

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 15:02:15 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <tpro7o$1ki63$1@dont-email.me>
References: <todbqe$16sg$1@gioia.aioe.org> <tpr12i$1i7r6$1@dont-email.me>
<tprics$2h9b5$1@news.xmission.com> <tprl89$1k839$1@dont-email.me>
<tprntf$2hb2h$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 Jan 2023 14:01:28 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b466e1060080fe119cf4d64a354bc62d";
logging-data="1722563"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19x0JnNN634oBknLlHJltY0syASSzjs6kc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:HeFeHewSvYMlpsMEZX/JdBXXiJg=
In-Reply-To: <tprntf$2hb2h$1@news.xmission.com>
Content-Language: de-DE
 by: Bonita Montero - Fri, 13 Jan 2023 14:02 UTC

Am 13.01.2023 um 14:55 schrieb Kenny McCormack:
> In article <tprl89$1k839$1@dont-email.me>,
> some lunatic <Bonita.Montero@gmail.com> wrote:
>> Am 13.01.2023 um 13:21 schrieb Kenny McCormack:
>>> In article <tpr12i$1i7r6$1@dont-email.me>,
>>> some lunatic <Bonita.Montero@gmail.com> wrote:
>>> ...
>>>> Now I make a list of eligible numbers, randomly chode one of them
>>>> and remove the item from the list:
>>>>
>>>> #include <iostream>
>>>> #include <charconv>
>>>> #include <random>
>>>> #include <concepts>
>>>> #include <vector>
>>>
>>> You still just don't seem to get this whole topicality thing, do ya?
>>
>> My code is beyond that topic. You may elect only a small number
>> of values like in the original code, but you might also chose
>> million of numbers.
>
> Whoooooosh!!!

It's not the absolute number of values which can be chosen
but the flexibility or finding the most efficient way to
have this flexibility.

Re: Compute Unique Numbers in a Set

<tprp68$2hb2h$2@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24249&group=comp.lang.c#24249

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Fri, 13 Jan 2023 14:17:44 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tprp68$2hb2h$2@news.xmission.com>
References: <todbqe$16sg$1@gioia.aioe.org> <tprl89$1k839$1@dont-email.me> <tprntf$2hb2h$1@news.xmission.com> <tpro7o$1ki63$1@dont-email.me>
Injection-Date: Fri, 13 Jan 2023 14:17:44 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2665553"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 13 Jan 2023 14:17 UTC

In article <tpro7o$1ki63$1@dont-email.me>,
some lunatic <Bonita.Montero@gmail.com> wrote:
>Am 13.01.2023 um 14:55 schrieb Kenny McCormack:
>> In article <tprl89$1k839$1@dont-email.me>,
>> some lunatic <Bonita.Montero@gmail.com> wrote:
>>> Am 13.01.2023 um 13:21 schrieb Kenny McCormack:
>>>> In article <tpr12i$1i7r6$1@dont-email.me>,
>>>> some lunatic <Bonita.Montero@gmail.com> wrote:
>>>> ...
>>>>> Now I make a list of eligible numbers, randomly chode one of them
>>>>> and remove the item from the list:
>>>>>
>>>>> #include <iostream>
>>>>> #include <charconv>
>>>>> #include <random>
>>>>> #include <concepts>
>>>>> #include <vector>
>>>>
>>>> You still just don't seem to get this whole topicality thing, do ya?
>>>
>>> My code is beyond that topic. You may elect only a small number
>>> of values like in the original code, but you might also chose
>>> million of numbers.
>>
>> Whoooooosh!!!
>
>It's not the absolute number of values which can be chosen
>but the flexibility or finding the most efficient way to
>have this flexibility.

Due anziani che convivono da una vita:
Lei: "Caro, ormai ci potremmo anche sposare...".
Lui: "Ma cara, alla nostra eta', chi ci prenderebbe?".

--
"Women should not be enlightened or educated in any way. They should be
segregated because they are the cause of unholy erections in holy men.

-- Saint Augustine (354-430) --

Re: Compute Unique Numbers in a Set

<tpvpke$ssh$1@reader2.panix.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24262&group=comp.lang.c#24262

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix3.panix.com!not-for-mail
From: fork...@panix.com (John Forkosh)
Newsgroups: comp.lang.c
Subject: Re: Compute Unique Numbers in a Set
Date: Sun, 15 Jan 2023 02:49:50 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <tpvpke$ssh$1@reader2.panix.com>
References: <todbqe$16sg$1@gioia.aioe.org>
Injection-Date: Sun, 15 Jan 2023 02:49:50 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix3.panix.com:166.84.1.3";
logging-data="29585"; mail-complaints-to="abuse@panix.com"
User-Agent: tin/2.6.0-20210823 ("Coleburn") (NetBSD/9.3 (amd64))
 by: John Forkosh - Sun, 15 Jan 2023 02:49 UTC

Albert <invalid@gmail.com> wrote:
> Is this the best way to generate unique random numbers in a set of 6
> numbers? <snip>

I think what you're looking for (not sure whether or not it's already
been mentioned in this long thread) is a "partial permutation",
swapping used numbers with unused ones, but we don't need to save the
used ones. Here's my general solution, and cc -DTESTDRIVE for the
main() test driver...

/* ---
* uniqrand.c
* Generate nuniq random numbers in the range lorand...hirand
* ---
* (optional) command-line arguments:
* ./uniqrand nuniq lorand hirand seedval
* 100 1 999 864297531 <-- default test values
* ------------------------------------------------------------------------ */

/* --- standard headers --- */
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h> /* for MIN(i,j) macro */

/* --- standard headers --- */
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h> /* for MIN(i,j) macro */

/* --- entry point --- */
int *uniqrand ( int nuniq, int lorand, int hirand ) {
/* --- allocations and declarations --- */
int iuniq = 0; /* index 0...nuniq-1 */
int range = 1+abs(hirand-lorand); /* random number range */
int *randvals = NULL, /* nuniq ints returned to caller */
*rangevals = NULL; /* all numbers lorand...hirand */
/* --- initialization --- */
if ( nuniq<1 || nuniq>range ) goto end_of_job; /* input error */
randvals = (int *)malloc((nuniq+99)*sizeof(int)); /* caller free()'s */
rangevals = (int *)malloc((range+99)*sizeof(int)); /* we free() work area */
if ( randvals==NULL || rangevals==NULL ) goto end_of_job; /* malloc error */
rangevals[0] = MIN(lorand,hirand); /* in case hirand<lorand */
for ( iuniq=1; iuniq<range; iuniq++ ) /* all numbers lorand...hirand... */
rangevals[iuniq] = rangevals[0] + iuniq; /* ...or vice versa */
/* --- generate nuniq unique random numbers from lorand to hirand --- */
for ( iuniq=0; iuniq<nuniq; iuniq++ ) {
int thisrand = rand()%range; /* random number 0...range-1 */
randvals[iuniq] = rangevals[thisrand]; /* unique random lorand...hirand */
rangevals[thisrand] = rangevals[--range]; } /* replace used number */
/* --- end-of-job --- */
end_of_job:
if ( rangevals != NULL ) free((void *)rangevals);
return ( randvals );
} /* --- end-of-function uniqrand() --- */

#if defined(TESTDRIVE)
/* --- entry point --- */
int main ( int argc, char *argv[] ) {
/* --- command-line arguments --- */
int nuniq = ( argc>1? atoi(argv[1]) : 100 ),
lorand = ( argc>2? atoi(argv[2]) : 1 ),
hirand = ( argc>3? atoi(argv[3]) : 999 ),
seedval = ( argc>4? atoi(argv[4]) : 164897532 );
/* --- allocations and declarations --- */
int *uniqrand(), *randvals=NULL; /* randvals from uniqrand() */
int iuniq = 0; /* randvals[] index */
/* --- initialization --- */
if ( seedval > 0 ) srand(seedval); /* initialize rand() */
/* --- call uniqrand() and display results --- */
if ( (randvals=uniqrand(nuniq,lorand,hirand)) == NULL ) goto end_of_job;
for ( iuniq=0; iuniq<nuniq; iuniq++ )
printf("%7d%s",randvals[iuniq],
(iuniq==nuniq-1?"\n":((iuniq+1)%8==0?",\n":",")) );
/* --- end-of-job --- */
end_of_job:
if ( randvals != NULL ) free((void *)randvals);
exit ( 0 );
} /* --- end-of-function main() --- */
#endif
/* --- end-of-file uniqrand.c --- */

John Forkosh ( mailto: j@f.com where j=john and f=forkosh )

Re: Compute Unique Numbers in a Set

<tq14n7$2cgbf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24264&group=comp.lang.c#24264

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Sun, 15 Jan 2023 16:06:00 +0100
Organization: A noiseless patient Spider
Lines: 89
Message-ID: <tq14n7$2cgbf$1@dont-email.me>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 15 Jan 2023 15:05:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="184ed867bf9879843a619d951f737d2b";
logging-data="2507119"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zNp1mUgU2vvmSbga7kdJ7hyyUoR2O+EQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:2j4wXOUXBHVNf9nqNkvY4GbY42k=
In-Reply-To: <tpr12i$1i7r6$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Sun, 15 Jan 2023 15:06 UTC

Now it's perfect:

#include <iostream>
#include <unordered_set>
#include <charconv>
#include <random>
#include <concepts>

using namespace std;

int main( int argc, char** argv )
{ try
{
if( argc < 4 )
return
cout << argv[0] << " n from to" << endl,
EXIT_FAILURE;
auto parse = []( char const *str, char const *err )
{
size_t value;
if( from_chars_result fcr = from_chars( str, str + strlen( str ),
value ); (bool)fcr.ec || *fcr.ptr )
throw invalid_argument( err );
return value;
};
size_t n = parse( argv[1], "wrong number of values" );
if( !n )
return EXIT_SUCCESS;
size_t
from = parse( argv[2], "wrong from-value" ),
to = parse( argv[3], "wrong to-value" );
if( from > to )
swap(from, to);
if( n - 1 > to - from )
return
cout << "n is too small" << endl,
EXIT_FAILURE;
unordered_set<size_t> values;
mt19937_64 mt;
uniform_int_distribution<size_t> uid( from, to );
if( to - from != (size_t)-1 && to - from + 1 < n / 2 )
{
values.reserve( n );
while( values.size() < n )
{
size_t value;
do
value = uid( mt );
while( values.contains( value ) );
values.emplace( value );
}
}
else
{
if( to - from == (size_t)-1 )
throw bad_alloc();
values.reserve( to - from + 1 );
size_t i = from - 1;
do
values.emplace( ++i );
while( i != to );
while( values.size() > n )
for( ; ; )
{
auto itRemove = values.find( uid( mt ) );
if( itRemove == values.end() )
continue;
values.erase( itRemove );
break;
}
}
for( size_t value : values )
cout << value << endl;
}
catch( exception const &exc )
{
return
cout << exc.what() << endl,
EXIT_FAILURE;
}
}

If less than half of the range of numbers is selected (n < (to - from
+ 1) / 2) the unordered map is filled up to n elements and if an element
is found that's already there another value is chosen. If more than half
of the range is selected (n >= (to - from + 1) / 2) the set is filled up
to contain the whole range and the elements are incrementally removed at
a random value.

Re: Compute Unique Numbers in a Set

<tq19i3$603$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24265&group=comp.lang.c#24265

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!aioe.org!uabYU4OOdxBKlV2hpj27FQ.user.46.165.242.75.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Sun, 15 Jan 2023 16:27:48 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tq19i3$603$1@gioia.aioe.org>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
<tq14n7$2cgbf$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="6147"; posting-host="uabYU4OOdxBKlV2hpj27FQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Bart - Sun, 15 Jan 2023 16:27 UTC

On 15/01/2023 15:06, Bonita Montero wrote:
> Now it's perfect:

You said that last time too:

On 08/01/2023 05:01, Bonita Montero wrote:
> Now it's perfect:
>

I guess it's more perfect?

Re: Compute Unique Numbers in a Set

<tq1ac5$2d37g$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24266&group=comp.lang.c#24266

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Sun, 15 Jan 2023 17:42:29 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <tq1ac5$2d37g$1@dont-email.me>
References: <todbqe$16sg$1@gioia.aioe.org> <tpdas0$3oa34$1@dont-email.me>
<tpdef6$2a759$1@news.xmission.com> <tpdfp6$3osch$1@dont-email.me>
<tpdim3$3p3kb$1@dont-email.me> <tpgsar$5mge$1@dont-email.me>
<tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me>
<tq14n7$2cgbf$1@dont-email.me> <tq19i3$603$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 15 Jan 2023 16:41:41 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="184ed867bf9879843a619d951f737d2b";
logging-data="2526448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Kfo+5b56iZvmMnS0cGBWSDlNB9tUJbQY="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:UUc4lJMts977v9f/qSdXlZJgyBs=
Content-Language: de-DE
In-Reply-To: <tq19i3$603$1@gioia.aioe.org>
 by: Bonita Montero - Sun, 15 Jan 2023 16:42 UTC

Am 15.01.2023 um 17:27 schrieb Bart:
> On 15/01/2023 15:06, Bonita Montero wrote:
>> Now it's perfect:
>
> You said that last time too:
>
> On 08/01/2023 05:01, Bonita Montero wrote:
> > Now it's perfect:
> >
>
>
> I guess it's more perfect?

The code I've shown yet is also perfect in terms of performance,
but not just functionally.

Re: Compute Unique Numbers in a Set

<tq1c42$2kgfi$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24267&group=comp.lang.c#24267

  copy link   Newsgroups: comp.lang.c comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Compute Unique Numbers in a Set
Date: Sun, 15 Jan 2023 17:11:30 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tq1c42$2kgfi$1@news.xmission.com>
References: <todbqe$16sg$1@gioia.aioe.org> <tphg58$866f$1@dont-email.me> <tpr12i$1i7r6$1@dont-email.me> <tq14n7$2cgbf$1@dont-email.me>
Injection-Date: Sun, 15 Jan 2023 17:11:30 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2769394"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 15 Jan 2023 17:11 UTC

In article <tq14n7$2cgbf$1@dont-email.me>,
Bonita Montero <Bonita.Montero@gmail.com> wrote:
>Now it's perfect:

I just need 11,780 votes. Give me a break here.

--
If Jeb is Charlie Brown kicking a football-pulled-away, Mitt is a '50s
housewife with a black eye who insists to her friends the roast wasn't
dry.

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor