l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social Gathering
Next Installfest:
Sat. Sept. 27, 10am-6pm [Tentative]
Latest News:
Aug. 19: Siafoo slides and photos online
Page last updated:
2002 Apr 03 14:44
Events
 Meetings
 Installfests
 Demos
 Photos
Services
 Library
 LERT
 Jobs
 Documents
Interact
 Mailing Lists
 - Search
 - Archives
 Chat
About Us
 Members
 Projects
 Testimonials
 Call for Speakers
 Why Not MS?
 Finances
 Sponsors

^Home
?Search
?News & RSS
?Calendar
@Contact Us
$Buy Stuff
=Printable


The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Re: random number in C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Re: random number in C



> Date: Tue, 2 Apr 2002 14:47:20 -0800
> [CODE SNIPPED]

So this is when the program is seeded to /dev/random:
>    p@satan% ./ising2-jfunc 4.0
>    T: 4.0e+00  beta: 2.500e-01  trials: 1000  N: 10  M: 10  seed: 3497451914
>    Average Energy: -1.273893
>    Average magnetization: 0.425220
>    Average |magnetization|: 0.531100
>    Average magnetic susceptibility: 34.746600

And this is when the code is seeded to 1:
>    T: 4.0e+00  beta: 2.500e-01  trials: 1000  N: 10  M: 10  seed: 3497451914
>    Average Energy: -1.326747
>    Average magnetization: 0.495320
>    Average |magnetization|: 0.495320
>    Average magnetic susceptibility: 28.645040

And you've established that if you run it repeatedly you keep getting the same thing:
>    T: 4.0e+00  beta: 2.500e-01  trials: 1000  N: 10  M: 10  seed: 3497451914
>    Average Energy: -1.326747
>    Average magnetization: 0.495320
>    Average |magnetization|: 0.495320
>    Average magnetic susceptibility: 28.645040

BUT four hours earlier:

> Date: Tue, 2 Apr 2002 10:05:34 -0800

This is when you seed it to /dev/random:
> 	T: 4.0e+00  beta: 2.500e-01  trials: 1000000
>	N: 10  M: 10  seed: 208006379
>	Average Energy: -1.057143
>	Average magnetization: 0.002008
>	Average |magnetization|: 0.251765
>	Average magnetic susceptibility: 8.948655

And this is when you seed it to 1:
>	T: 4.0e+00  beta: 2.500e-01  trials: 1000000
>	N: 10  M: 10  seed: 208006379
>	Average Energy: -1.050182
>	Average magnetization: 0.030723
>	Average |magnetization|: 0.246092
>	Average magnetic susceptibility: 8.692724

Why did 4 hours of time change the results when you seed it to 1 ???
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

CD Burns Wanted!

LUGOD: Linux Users' Group of Davis
1105 Kennedy Place, Suite 1, Davis, CA 95616
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!