Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Fair, truly random random number generator Date: Sat, 29 Oct 2016 11:57:17 -0700 Organization: None to speak of Lines: 22 Message-ID: References: <37481339-6cc2-4bef-b550-4c868b3159d2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="9851b5181cfe42247cab77ffca4b7981"; logging-data="22699"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NGUyZ2tN2XrTAzuC91cRZ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:P9zJNxdqrsLS9SGI+5HeRBA9TiE= sha1:xCLfTdF4ahHp6ipzoyziqLgOxtg= Xref: csiph.com comp.lang.c:95397 "Mr. Man-wai Chang" writes: [...] > I just want to play my MP3 songs in shuffle mode. I noticed that most > shuffling algorithms are not random enough, as I could hear a pattern > being repeated. :) You don't need an unusually high-quality PRNG to shuffle songs, unless you're using the shuffle order for cyptography. It's very likely that you're hearing patterns that aren't really there. Humans in general are *very* good at detecting patterns -- whether they're real or not. If you're using a random number generator to shuffle songs, you won't be able to tell the difference between a typical low-quality rand() implementation and a high-quality hardware implementation. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"