The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: Matching random numbers
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Dave Seaman

Posts: 2,446
Registered: 12/6/04
Re: Matching random numbers
Posted: Aug 16, 1996 2:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <4uphfg$>,
A. Ortiz-Tapia <> wrote:
>Dear mathgroupers,
>I have written the following program:

[ Program deleted ]

>The purpose of this program is to produce two inpendent random numbers;
>match this two numbers by "converting" them to integers, then if they
>are equal print either of them (I choosed x), *and* increment the value
>of a variable, such that at the end I can have 5000 "matched" random
>numbers. The program, so far, gives out *only one number*.

If I understand you correctly, an easy way would be to evaluate


where match[] is a function defined to return a single "matched"
value. For example:

match[] :=
While[Round[100x] != Round[100y],
x = Random[];
y = Random[]

Dave Seaman
++++ stop the execution of Mumia Abu-Jamal ++++
++++ if you agree copy these lines to your sig ++++
++++ see ++++

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.