Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Unique List

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg389] Re: [mg383] Re: [mg358] Unique List
  • From: Istvan.Nemes at risc.uni-linz.ac.at
  • Date: Sun, 08 Jan 95 12:08:51 +0100

>>OK, time for a little fun...

>How come nobody remembered Union? It needs no package; it is one of the
>core operators.  Also, this one maintains the random order of the original
>trials.  And thanks to Dana Scott for the improvement 42->52.


>len=5;
>While[len != 6,
 	       hand = Table[Random[Integer,{1,52}],{6}];
 	       len = Length[Union[hand]]
>	     ]
>hand

>I think a lot of us forget that readability is very important to
>non-hotshot users of Mathematica, who are the audience.
>
>Martin McClain


Your algorithm terminates with probability 1, however, for any positive
integer n, the probability that the function you gave will not terminate
after calling Random n times, is positive.

Istvan Nemes


  • Prev by Date: Problem with Contexts
  • Next by Date: Get Parts of Expression by Position list
  • Previous by thread: Re: Unique List
  • Next by thread: Re: Unique List