[OT] Algorithm question

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Mon May 1 03:17:16 PDT 2017


On Monday, 1 May 2017 at 09:58:39 UTC, Timon Gehr wrote:
> On 01.05.2017 11:51, Moritz Maxeiner wrote:
>>     [...]
>
> This deterministically chooses 0. (uniform is right-exclusive.) 
> I assume you mean uniform(0,2).

Yes.

>
>> [...]
>
> Counterexample: [1,0,1,1].
>
> The first element is chosen with probability 1/2, which is not 
> 1/3.

Dang. Serves me right for not doing the full analysis. Thanks for 
the counter example and sorry for wasting your time.

>
>> [...]
>
> I don't understand this input model.
>

Since the idea was nonsense, it doesn't matter, anyway.


More information about the Digitalmars-d mailing list