<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: A Java Programmer&#8217;s Guide to Random Numbers, Part 3: Seeding</title>
	<atom:link href="http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/</link>
	<description>Rants and opinion interspersed with awe-inspiring tales of heoric software engineering endeavours.</description>
	<pubDate>Thu, 21 Aug 2008 14:39:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Dan</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1711</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 16 Jun 2008 22:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1711</guid>
		<description>Dominic, from your description, it's not clear how the numbers are generated.  If there are actual physical balls that are picked out of a machine (as in the UK National Lottery), then which balls get picked is a result of physical factors and timing.  I don't think it would be very easy to predict but, if you are interested, see the book Fortune's Formula by William Poundstone.  There is a section describing how Claude Shannon and Ed Thorp built a device to predict roulette wheels.

If the numbers are the result of a PRNG then, to reverse engineer it, you would need to find out what algorithm it uses.  As I mentioned in the article, it would probably be an algorithm that is difficult (almost impossible) to reverse engineer.  Also you are assuming that the device is not re-seeded from week-to-week.  That's probably not the case.

Are you suggesting that the lottery is rigged?  Detecting bias in the results can be done with statistics but it would probably require a very large sample of outputs to be worthwhile.

The best plan is not to play.  Even when they are fair lotteries are designed to make the players lose money.  That's because their primary function is to raise money for some other purpose.  This means that only a fraction of the money paid in goes into the prize pool.  In the UK National Lottery, for example, only about 50% of the money is paid out in prizes.  Compare this 50% expected return to the 99.4% you'd get playing Blackjack in a casino, and it's clear that if you like to gamble, you should chose something other than the lottery.</description>
		<content:encoded><![CDATA[<p>Dominic, from your description, it&#8217;s not clear how the numbers are generated.  If there are actual physical balls that are picked out of a machine (as in the UK National Lottery), then which balls get picked is a result of physical factors and timing.  I don&#8217;t think it would be very easy to predict but, if you are interested, see the book Fortune&#8217;s Formula by William Poundstone.  There is a section describing how Claude Shannon and Ed Thorp built a device to predict roulette wheels.</p>
<p>If the numbers are the result of a PRNG then, to reverse engineer it, you would need to find out what algorithm it uses.  As I mentioned in the article, it would probably be an algorithm that is difficult (almost impossible) to reverse engineer.  Also you are assuming that the device is not re-seeded from week-to-week.  That&#8217;s probably not the case.</p>
<p>Are you suggesting that the lottery is rigged?  Detecting bias in the results can be done with statistics but it would probably require a very large sample of outputs to be worthwhile.</p>
<p>The best plan is not to play.  Even when they are fair lotteries are designed to make the players lose money.  That&#8217;s because their primary function is to raise money for some other purpose.  This means that only a fraction of the money paid in goes into the prize pool.  In the UK National Lottery, for example, only about 50% of the money is paid out in prizes.  Compare this 50% expected return to the 99.4% you&#8217;d get playing Blackjack in a casino, and it&#8217;s clear that if you like to gamble, you should chose something other than the lottery.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duru Dominic</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1708</link>
		<dc:creator>Duru Dominic</dc:creator>
		<pubDate>Mon, 16 Jun 2008 17:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1708</guid>
		<description>My name is Dominic from west Africa. I read your article few days ago after a long period of staying in darkness. In fact, we have been deceived by private individual and our Government into believing that the so called lotto machines have "keys" and "plans" which they play and we end up loosing our money on a daily basis.
 
These machines, some computerized and balls are owned by these people. Your article has been helpful.This is how it works; The machines have 90 numbers to select from in a random manner.I.e 1,2,3,4,5,...,.,.,.90
The first five numbers that come out each time the machine is operated are the winning numbers and the last five,I.e,the 86th,87th 88th 89, 90th numbers are called the machine numbers.And all the results are compiled starting from the first time and this is where we llok at to guess the first five numbers to play the next time it is operated,still we loose money. So, is it possible to get accurately the first five.It is played once a week. Can it be solved by Xn+1 = (aXn + b) mod c.If possible, how do we get the constants a,b,and c .How do we get the "seed" PLease I need your help.Below is a sequence of previous results :                             
              1th 2nd 3rd 4th 5th    86th 87th 88th 89th 90th
 
week1    44  35  27  61  39      71  12 33 89 9          
week2    34  77  2   65  62      80  47 74 79 60
week3    5   34  9   40  41      27  3 58  63 76
week4    55  49  87  20  3       48  67 61 65 54
week5    61  45  87  50 38       14 13 71 21 15
 
I hope you can look at these and tell give a useful information. Thank you very much for you anticipated response.
Duru Dominic
0092348035405004
Email: perfectaffairs@yahoo.com</description>
		<content:encoded><![CDATA[<p>My name is Dominic from west Africa. I read your article few days ago after a long period of staying in darkness. In fact, we have been deceived by private individual and our Government into believing that the so called lotto machines have &#8220;keys&#8221; and &#8220;plans&#8221; which they play and we end up loosing our money on a daily basis.</p>
<p>These machines, some computerized and balls are owned by these people. Your article has been helpful.This is how it works; The machines have 90 numbers to select from in a random manner.I.e 1,2,3,4,5,&#8230;,.,.,.90<br />
The first five numbers that come out each time the machine is operated are the winning numbers and the last five,I.e,the 86th,87th 88th 89, 90th numbers are called the machine numbers.And all the results are compiled starting from the first time and this is where we llok at to guess the first five numbers to play the next time it is operated,still we loose money. So, is it possible to get accurately the first five.It is played once a week. Can it be solved by Xn+1 = (aXn + b) mod c.If possible, how do we get the constants a,b,and c .How do we get the &#8220;seed&#8221; PLease I need your help.Below is a sequence of previous results :<br />
              1th 2nd 3rd 4th 5th    86th 87th 88th 89th 90th</p>
<p>week1    44  35  27  61  39      71  12 33 89 9<br />
week2    34  77  2   65  62      80  47 74 79 60<br />
week3    5   34  9   40  41      27  3 58  63 76<br />
week4    55  49  87  20  3       48  67 61 65 54<br />
week5    61  45  87  50 38       14 13 71 21 15</p>
<p>I hope you can look at these and tell give a useful information. Thank you very much for you anticipated response.<br />
Duru Dominic<br />
0092348035405004<br />
Email: <a href="mailto:perfectaffairs@yahoo.com">perfectaffairs@yahoo.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1282</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Fri, 18 Apr 2008 13:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1282</guid>
		<description>hum... aren't there some hardware random number generator we can use to seed the random gen?</description>
		<content:encoded><![CDATA[<p>hum&#8230; aren&#8217;t there some hardware random number generator we can use to seed the random gen?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1276</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:56:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1276</guid>
		<description>Jeff, you are absolutely right.  Thanks for the correction - I have changed the text to be more accurate.  I was repeating information from memory from an article I read quite a while ago.  I can't find the original page, but after your comment I double-checked the implementation of SecureRandom and I was indeed mistaken in my original posting.</description>
		<content:encoded><![CDATA[<p>Jeff, you are absolutely right.  Thanks for the correction - I have changed the text to be more accurate.  I was repeating information from memory from an article I read quite a while ago.  I can&#8217;t find the original page, but after your comment I double-checked the implementation of SecureRandom and I was indeed mistaken in my original posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1274</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 17 Apr 2008 02:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1274</guid>
		<description>"Both the MersenneTwisterRNG and Java’s SecureRandom use a 64-bit seed. "

Are you sure SecureRandom uses a 64-bit seed?  The SUN SHA1PRNG provider appears to use 160 bits (still less than the number of possible decks).</description>
		<content:encoded><![CDATA[<p>&#8220;Both the MersenneTwisterRNG and Java’s SecureRandom use a 64-bit seed. &#8221;</p>
<p>Are you sure SecureRandom uses a 64-bit seed?  The SUN SHA1PRNG provider appears to use 160 bits (still less than the number of possible decks).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://blog.uncommons.org/2008/04/10/a-java-programmers-guide-to-random-numbers-part-3-seeding/#comment-1255</link>
		<dc:creator>James</dc:creator>
		<pubDate>Fri, 11 Apr 2008 10:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=68#comment-1255</guid>
		<description>Hi Dan 
Great article. This is a very interesting series, which would be great to get onto JavaLobby. 
Let me know if this would be ok with you and we can discuss. 

Regards 
James</description>
		<content:encoded><![CDATA[<p>Hi Dan<br />
Great article. This is a very interesting series, which would be great to get onto JavaLobby.<br />
Let me know if this would be ok with you and we can discuss. </p>
<p>Regards<br />
James</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.171 seconds -->
