Re: VERY URGENT C PROGRAM
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Tue, 11 Apr 2006 14:03:28 -0400
Keith Thompson wrote:
"William J. Leary Jr." <Bill_Leary@xxxxxxx> writes:.... snip ...
I implemented this thing for a deck of cards in C (almost on topic!)
some years ago. Well, a lot of years ago now that I think of is,
since I ran it on a VAX. I had it run in the background (UNIX) and
keep count of how many times it had to "toss" before getting a
result. Over a couple of weeks it ran anywhere from ten passes to
many many thousands. One run didn't terminate after several days.
I had to kill it.
How big was the deck? If it was a standard 52-card deck, I'd be
astonished if it *ever* sorted; there are 52!, or about 8e67,
permutations. (That's 8 * 10**67, not 0x8E67.)
The quality of the PRNG has something to do with the results. I
don't believe there is any such that can guarantee a sort in this
case. So you need an external truly random mechanism.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
.
- References:
- VERY URGENT C PROGRAM
- From: dembla
- Re: VERY URGENT C PROGRAM
- From: major
- Re: VERY URGENT C PROGRAM
- From: Joe Estock
- Re: VERY URGENT C PROGRAM
- From: Robert Gamble
- Re: VERY URGENT C PROGRAM
- From: Skarmander
- Re: VERY URGENT C PROGRAM
- From: Kenneth Brody
- Re: VERY URGENT C PROGRAM
- From: William J. Leary Jr.
- Re: VERY URGENT C PROGRAM
- From: Keith Thompson
- VERY URGENT C PROGRAM
- Prev by Date: Re: Some Questions
- Next by Date: Re: How does assert benefit your code really?
- Previous by thread: Re: VERY URGENT C PROGRAM
- Next by thread: Re: VERY URGENT C PROGRAM
- Index(es):
Relevant Pages
|