<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>random number generator</title>
		<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator</link>
		<description>Posts in the discussion thread &quot;random number generator&quot;</description>
				<copyright></copyright>
		<lastBuildDate></lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520560</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520560</link>
				<description></description>
				<pubDate>Sun, 28 Jun 2009 03:20:20 +0000</pubDate>
				<wikidot:authorName>thornahawk</wikidot:authorName>				<wikidot:authorUserId>14508</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The Second Edition of the book is freely available: <a href="http://www.nrbook.com/nr3/">http://www.nrbook.com/nr3/</a></p> <p>thornahawk</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520538</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520538</link>
				<description></description>
				<pubDate>Sun, 28 Jun 2009 02:19:53 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>hahaha. i've never heard of that way before, but it sure is effective.</p> <p>as for the algorithm, i guess i'll use either</p> <div class="code"> <pre> <code>E+round((3^16-10)fPart((2^16-1+E+round(fPart(((331((Sum of Original String+E))/2)/(2^32-1)))(2^32-1),0)2-E)/(3^16-10)),0→F</code> </pre></div> <p>or</p> <div class="code"> <pre> <code>E+round((3^16+26)fPart((2^16+1+E+round(fPart(((331((Sum of Original String+E))/2)/(2^16+1)))(2^16+1),0)2-E)/(3^16+26)),0→F</code> </pre></div> <p>but i dont know which one to chose. both are good, from what i have seen</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520525</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520525</link>
				<description></description>
				<pubDate>Sun, 28 Jun 2009 01:50:31 +0000</pubDate>
				<wikidot:authorName>Weregoose</wikidot:authorName>				<wikidot:authorUserId>7090</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>If you'll only have one random number per run (and if the seed doesn't carry over from one generation of the program to the next), then it doesn't matter what the function is: whatever input it's given would itself have to be random in order for the expression to yield an unpredictable answer, and the randomness of that input would have to be computed somehow, ad infinitum. Where do we find that baseline element which can be measured, but not preprogrammed?</p> <p>Some advanced machines can record static noise or radiation and use those for the purposes of generating random numbers. Another method is the timing of user input. Yet another approach (something that I have actually seen used in a computer program before) is where a text box appears and the user is instructed to bang on the keyboard for a few seconds. If that's not a successful RNG, then I don't know what is. (Kidding, of course.)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520302</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520302</link>
				<description></description>
				<pubDate>Sat, 27 Jun 2009 17:06:37 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>would it be a better idea to mess around with large but not prime numbers for randomness or mod by large prime numbers? both of them seem to work well for my program</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520291</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520291</link>
				<description></description>
				<pubDate>Sat, 27 Jun 2009 16:35:36 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>arrrgggg. the site wants me to subscribe to them. im not that crazy.</p> <p>so any ideas on how to write the actual equation for a good rng?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520019</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520019</link>
				<description></description>
				<pubDate>Sat, 27 Jun 2009 04:15:21 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>thanks i think</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-520003</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-520003</link>
				<description></description>
				<pubDate>Sat, 27 Jun 2009 03:51:23 +0000</pubDate>
				<wikidot:authorName>thornahawk</wikidot:authorName>				<wikidot:authorUserId>14508</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>"create a rng that generates different numbers for the same seed"</p> <p>To reiterate… an RNG with the characteristics you say are not practical; the point of having a seed is to be able to generate the same sequence associated with that particular seed across different platforms.</p> <p>"LCGs should not be used for applications where high-quality randomness is critical."</p> <p>In any event, that LCG's are not "random enough" (more precisely, their periods are too short, among other weaknesses) are the reason why you have things like the "Mersenne twister" or "Blum-Blum-Shub"; go search for these topics on Google Scholar.</p> <p>There's also a discussion of RNGs in Numerical Recipes (<a href="http://www.nrbook.com/">http://www.nrbook.com/</a> ), check it out.</p> <p>thornahawk</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519851</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519851</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 22:38:08 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>thanks, but i had hoped to be able to change it to computer code too, so maybe one day hash2x might be written in different languages and still produce the same checksums. since "rand" doesnt always use the same algorithm in every language, i was hoping to have a constant formula that only relies on constant stuff, not the speed of a user/the choice of how the function of a language works</p> <p>wiki:</p> <blockquote> <p>LCGs should not be used for applications where high-quality randomness is critical.</p> </blockquote> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519814</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519814</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 21:39:13 +0000</pubDate>
				<wikidot:authorName>Weregoose</wikidot:authorName>				<wikidot:authorUserId>7090</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><a href="http://en.wikipedia.org/wiki/Linear_congruential_generator#LCGs_in_common_use">LCGs in common use</a></p> <p>On a TI-84+, you can use the clock like so: <span style="font-size: 9pt;"><tt><span style="color: #11119c;">startTmr→rand</span></tt></span></p> <p>Otherwise, a dirty trick on the 83+ is to seed <span style="font-size: 9pt;"><tt><span style="color: #11119c;">rand</span></tt></span> or a function of your choosing with the user's reaction time:</p> <div style="font-size: 9pt;"> <p><tt><span style="color: #11119c;">getKey<br /> 0<br /> ClrHome<br /> Output(2,3,"Title Screen<br /> Output(7,2,"Press any key!<br /> Repeat getKey<br /> Ans+1<br /> End<br /> Ans→rand<br /> ClrHome<br /> rand</span></tt></p> </div> <p>The first line is the dummy <span style="font-size: 9pt;"><tt><span style="color: #11119c;">getKey</span></tt></span> covered <a href="http://tibasicdev.wikidot.com/getkey#toc0">here</a> (just above Error Conditions).</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519786</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519786</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 20:46:37 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>so any idea about how to generate random numbers with an actual equation?</p> <p>i know there are equations like<br /> <img src="http://upload.wikimedia.org/math/1/4/4/144550627858cb6d44ceb02ba9434317.png" alt="144550627858cb6d44ceb02ba9434317.png" class="image" /></p> <p>but what are good numbers for the constants for equations like this?</p> <p>also, my main problem is that only one random number is needed everytime the progam is run</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519777</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519777</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 20:32:14 +0000</pubDate>
				<wikidot:authorName>Weregoose</wikidot:authorName>				<wikidot:authorUserId>7090</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>What you are asking for is a function that will generate arbitrary results for a fixed input.</p> <p>So, if there exists a function that produces a sequence with one input…</p> <p>ƒ(<em>x</em>) = <em>a<sub>n</sub></em></p> <p>…yet goes on to produce another sequence from the <em>same</em> input…</p> <p>ƒ(<em>x</em>) = <em>b<sub>n</sub></em></p> <p>…but you require that the two sequences be <em>different</em>…</p> <p><em>a<sub>n</sub></em> ≠ <em>b<sub>n</sub></em></p> <p>…then you can make the substitutions as follows…</p> <p><em>a<sub>n</sub></em> ≠ <em>b<sub>n</sub></em></p> <p>ƒ(<em>x</em>) ≠ <em>b<sub>n</sub></em></p> <p>ƒ(<em>x</em>) ≠ ƒ(<em>x</em>)</p> <p>…showing that the function itself can't be in agreement with itself at any given instant.</p> <p>What you are asking for is an arbitrary function. Or, something that will compute &lt;insert sequence&gt; given &lt;insert function&gt;. Unless you can get it any more well-defined than that, you're going to have a hard time programming it in.</p> <p>Simpler answer: You pick one seed, you write it into your expression on paper, and then you solve it by hand. If you carry out the same procedure every time, then you should get the same answer repeatedly. Only when you try a new approach, whether it's changing the function or that <em>pesky input</em>, would the end result turn up as something else. This modification from the earlier test… it's called a "variable." If one number were chosen to replace it, and then all answers followed suit, then the initial input might be dubbed a "seed."</p> <p>Alternate ending: You discover that by looking at your function weirdly enough, you are able to inexplicably force it to take on a new behavior from all of its previous trials. Alas, the logic is inescapable; the manner in which you looked at your function is also a variable – a veritable seed in the budding, and a "seed" in the dubbing.</p> <p>Nutshell answer: Any expression with a constant form isn't going to trade results with the void. An effect requires a cause, and in the case of a RNG, that "push" is going to be the seed – that's what it's there for.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519751</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519751</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 19:31:02 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>thanks, but wiki doesnt tell you much. they only say that they exist</p> <p>im trying to increase the randomness of my hash2x program but i cant think of any way to use any of the variables without compromising the entire algorithm</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519726</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519726</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 18:58:35 +0000</pubDate>
				<wikidot:authorName>builderboy</wikidot:authorName>				<wikidot:authorUserId>141501</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>The whole point of a seed is so that you can generate the same random numbers. As for the formula, I have no idea, but it probably has something to do with bit shifting and such, most likely very complex.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519724</guid>
				<title>Re: random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519724</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 18:57:33 +0000</pubDate>
				<wikidot:authorName>graphmastur</wikidot:authorName>				<wikidot:authorUserId>142001</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><a href="http://en.wikipedia.org/wiki/List_of_random_number_generators">List of random number generators.</a><br /> or<br /> <a href="http://tinyurl.com/nqfsrf">lmgtfy</a> which is the second one down, on the search page.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-165419#post-519696</guid>
				<title>random number generator</title>
				<link>http://tibasicdev.wikidot.com/forum/t-165419/random-number-generator#post-519696</link>
				<description></description>
				<pubDate>Fri, 26 Jun 2009 18:23:16 +0000</pubDate>
				<wikidot:authorName>bxsciencer</wikidot:authorName>				<wikidot:authorUserId>169000</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>is there any conceivable way to create a rng that generates different numbers for the same seed</p> <p>or can someone give me the actual formula for a random number generator (not just randInt())</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>