Pappocom's Program

Everything about Sudoku that doesn't fit in one of the other sections

Pappocom's Program

Postby lunababy_moonchild » Mon Oct 02, 2006 9:36 pm

I just wondered : given that the program generates a unique puzzle every time the new puzzle button is pressed, and thus the user never gets the same puzzle twice, does that mean that the puzzles my (copy of the) program generates are totally different to everybody else's ?

That is, are the puzzles generated by each copy of the software completely unique to that particular copy of the software or would my copy of the software eventually produce the same puzzle as someone else's copy of the software?

Luna
lunababy_moonchild
 
Posts: 659
Joined: 23 March 2005

Postby ravel » Mon Oct 02, 2006 10:13 pm

In my programs this is decided by the question, if the random seed (start value for the random function) is fixed or e.g. bound to the date/time. To check it, reinstall it twice and compare the first puzzles.
ravel
 
Posts: 998
Joined: 21 February 2006

Postby ab » Mon Oct 02, 2006 10:33 pm

Most likely the puzzles you get are different from ones someone else gets. Of course it's all random, so there's a very small chance you get a puzzle that someone else does, but you're probably more likely to win the lottery two weeks running.
ab
 
Posts: 451
Joined: 06 September 2005

Postby tarek » Tue Oct 03, 2006 8:04 am

I'm with ravel,

Open you program for the first time, generate an easy puzzle & register the result.

Close the program.

Open the program again, genrate an easy puzzle.....if the results match then the puzzles are not "THAT" random.

tarek
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby Son of Pappocom » Tue Oct 03, 2006 11:04 am

Hi luna,

Ravel mentioned the seed. Computers can't really generate true random numbers, so a seed number is used (something like milliseconds elapsed since 12:00am, January 1, 1970, or somesuch) to generate a pseudo-random number. This increases the likelihood that a "random" process will be repeated, but it's still a very long shot!

Regards
Scott
Son of Pappocom
 
Posts: 217
Joined: 10 October 2005

Postby lunababy_moonchild » Tue Oct 03, 2006 7:45 pm

Thanks everybody for your answers, I was just wondering if everybody got different puzzles and pondering the magnitude of that!

Luna
lunababy_moonchild
 
Posts: 659
Joined: 23 March 2005

Postby wapati » Tue Oct 03, 2006 8:54 pm

lunababy_moonchild wrote:Thanks everybody for your answers, I was just wondering if everybody got different puzzles and pondering the magnitude of that!

Luna


Think of lottery tickets. Thay don't store all the numbers and give you one based on the last one sold. Every machine generates a number (numbers) and then reports what was sold.

Making new ones is easier than running a database, if large numbers are involved.
wapati
2010 Supporter
 
Posts: 527
Joined: 13 September 2006
Location: Brampton, Ontario, Canada

Postby lunababy_moonchild » Tue Oct 03, 2006 9:25 pm

wapati wrote:Think of lottery tickets. Thay don't store all the numbers and give you one based on the last one sold. Every machine generates a number (numbers) and then reports what was sold.

Making new ones is easier than running a database, if large numbers are involved.

Yes, I know but the lottery is one machine and it does it once a week (originally, and in Gt. Britain). My question was about each copy of Pappocom's Software of which there were numerous copies sold and I wondered if each copy created entirely unique puzzles, which were unique to that copy of the program or if your copy (say) created the same puzzles mine did.

Luna
lunababy_moonchild
 
Posts: 659
Joined: 23 March 2005

Postby wapati » Tue Oct 03, 2006 9:42 pm

I was meaning the VENDING machines.
:D
wapati
2010 Supporter
 
Posts: 527
Joined: 13 September 2006
Location: Brampton, Ontario, Canada

Postby daj95376 » Tue Oct 03, 2006 10:38 pm

Most prime number generators use two prime (or relatively-prime) numbers and a process (that I believe is) called multiplicative congruence to create a cyclic chain of pseudo-random numbers. A seed value is used to select an initial value from this chain. A common practice is to use the milliseconds elapsed value (mentioned earlier) for the starting seed when the program starts ... or when a new puzzle is generated.

The important thing on differentiating your puzzles from someone else's puzzles is where each of you enter the chain. In the old days of Microsoft FreeCell, the chain was only 32K in length and that limited the number of unique games -- which were identified by their starting seed number. Today, most random number generators use a full 32-bits for the seed ... and this leads to over 4,000,000,000 entries in the chain. Your chances of having the same puzzle as someone else is very slim!
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Postby lunababy_moonchild » Wed Oct 04, 2006 8:45 am

wapati wrote:I was meaning the VENDING machines.
:D

My mistake, I was thinking of the lottery draw on TV:D

daj95376 wrote:Most prime number generators use two prime (or relatively-prime) numbers and a process (that I believe is) called multiplicative congruence to create a cyclic chain of pseudo-random numbers. A seed value is used to select an initial value from this chain. A common practice is to use the milliseconds elapsed value (mentioned earlier) for the starting seed when the program starts ... or when a new puzzle is generated.

The important thing on differentiating your puzzles from someone else's puzzles is where each of you enter the chain. In the old days of Microsoft FreeCell, the chain was only 32K in length and that limited the number of unique games -- which were identified by their starting seed number. Today, most random number generators use a full 32-bits for the seed ... and this leads to over 4,000,000,000 entries in the chain. Your chances of having the same puzzle as someone else is very slim!

Ah hah, with you now. It's miraculous isn't it? Absolutely brilliant, I wish I'd thought of that!

Luna

*edit : spelling mistake*
Last edited by lunababy_moonchild on Fri Oct 06, 2006 11:11 am, edited 1 time in total.
lunababy_moonchild
 
Posts: 659
Joined: 23 March 2005

Postby Smythe Dakota » Fri Oct 06, 2006 11:20 am

daj95376 wrote:.... Your chances of having the same puzzle as someone else is very slim!

And (to address Lunababy's initial confusion) this slim chance of having the same puzzle twice would neither increase nor decrease if you used two copies of the program, rather than using the same copy twice.

Bill Smythe
Smythe Dakota
 
Posts: 564
Joined: 11 February 2006


Return to General