What are good PRNG for calculators?
|
09-01-2014, 07:00 PM
(This post was last modified: 09-01-2014 07:26 PM by John R. Graham.)
Post: #21
|
|||
|
|||
RE: What are good PRNG for calculators?
(08-22-2014 02:16 PM)Namir Wrote:Attached. Sorry for the delay. Short operating instructions:(08-22-2014 01:45 PM)John R. Graham Wrote: ...On the "less than short" side, just for fun I implemented the Mersenne Twister on my HP 50g.
- John |
|||
09-04-2014, 04:41 AM
Post: #22
|
|||
|
|||
RE: What are good PRNG for calculators?
The appropriate PRNG for a calculator depends on the problem being solved. Computing an integral is quite different from playing a game or trying to encrypt something.
|
|||
09-06-2014, 05:55 PM
Post: #23
|
|||
|
|||
RE: What are good PRNG for calculators?
When do you think it's inappropriate to use a really good PRNG? The only contraindication I can think of that is potentially valid is if the resource requirements and/or execution time is onerous on the platform.
- John |
|||
09-06-2014, 06:03 PM
Post: #24
|
|||
|
|||
RE: What are good PRNG for calculators?
(09-06-2014 05:55 PM)John R. Graham Wrote: When do you think it's inappropriate to use a really good PRNG? The only contraindication I can think of that is potentially valid is if the resource requirements and/or execution time is onerous on the platform. A quasi-random generator is never worse when evaluating a (Riemann) integral. This is in terms of error-bounds rather than error estimates. Of course, QRNGs are useless (in general) for cryptography or in other cases where non-predictability is needed (in a gaming machine, for example.) It's a bit more work to use QRNGs but the payoff can be big. The analysis is more like that of using traditional integration formulas. |
|||
09-06-2014, 07:05 PM
Post: #25
|
|||
|
|||
RE: What are good PRNG for calculators?
Interesting. What form does the payoff come in?
- John |
|||
11-05-2014, 11:02 AM
Post: #26
|
|||
|
|||
RE: What are good PRNG for calculators?
(08-21-2014 07:05 PM)Thomas Klemm Wrote:(08-21-2014 03:25 PM)Namir Wrote: So saying that the Rand# in the HP-15C is very good does not count, because it is already hardwired in the firmware. Hi Thomas, I'm so glad to find these 2 figures for the first time on the web ! 1017980433 and 1574352261. I have a HP11C (now, I use an emulator on my iPhone) and I searched in the late 80's how the RAN function was generated. I finished to find an algorithm (not this you are using, but doing partial additions) and revealing these 2 figures. I have programmed it in Turbo Pascal and used this as a Benchmark programm for the PCs (I was interested by numeric simulations). Today, when I need a rand function, I always use this agorithm :-) And you, where and how did you find it ? Regards. Joseph. |
|||
11-05-2014, 05:05 PM
Post: #27
|
|||
|
|||
RE: What are good PRNG for calculators?
(11-05-2014 11:02 AM)jdimijian Wrote: Hi Thomas, Not affiliated with HP but I used the trace produced by the Nonpareil emulator of the HP-15C. IIRC you have to build the project with the correct settings. Then you can enable it via Debug -> ❐ Trace. The output is huge but there's the assembler instruction lc to load a constant. Here's the part where 1574352261 is loaded: Code: 06120: 0120 lc 1 But I was not the first one to find these numbers: Le Compte est bon - The Total Is Right - Numbers Code: *&---------------------------------------------------------------------* How did you find these numbers? Cheers Thomas |
|||
11-05-2014, 08:23 PM
Post: #28
|
|||
|
|||
RE: What are good PRNG for calculators?
(11-05-2014 05:05 PM)Thomas Klemm Wrote:(11-05-2014 11:02 AM)jdimijian Wrote: Hi Thomas, According to the literature the modulo number should be 2^P or 2^P-1 for some P value. My guess is that using 10^Q would produce poor values. Namir |
|||
11-05-2014, 09:37 PM
Post: #29
|
|||
|
|||
RE: What are good PRNG for calculators?
Here is a small program to "display" random numbers on the screen of the HP PRIME...
Code:
This program can't assure you that your PRNG program is a good one, but it can show you that it is bad ;D for example FP(123*R) Don't forget to initialise R with a 0.xxxxxxx number , then : PRNG_DSP(10000) or TIME(PRNG_DSP(10000)) to evaluate the complexity of the algorithm |
|||
11-05-2014, 09:51 PM
Post: #30
|
|||
|
|||
RE: What are good PRNG for calculators?
(08-25-2014 05:15 PM)Marcus von Cube Wrote: The TI SR-51(A) has a RAN# function that returns a two digit random number. I couldn't find more info about it but I have the feeling that it's not a pseudo random number generator but a real random number function. Can someone confirm this? To support my assumption, there is no seed function. I expect it's a PRNG. There's no RNG hardware in the 51, so the only source of "random" numbers would be timing of key presses, and they can't get enough bits of entropy from a single key press for a two digit number. During a running program, using RAN# repeately would have no entropy input, so even if they time keypresses it would only be useful as a seed. If the RAN# doesn't give the same results after each power-up, that could be due to not initializing the storage for the PRNG, which would act as a semi-random seed, though the entropy content would be very low. |
|||
11-06-2014, 12:06 AM
Post: #31
|
|||
|
|||
RE: What are good PRNG for calculators?
(11-05-2014 08:23 PM)Namir Wrote: According to the literature the modulo number should be 2^P or 2^P-1 for some P value.[citation needed] Quote:My guess is that using 10^Q would produce poor values. These numbers fulfill the three requirements of the Hull-Dobell Theorem:
Thus we can conclude to have maximal period. Cheers Thomas |
|||
11-06-2014, 09:36 AM
Post: #32
|
|||
|
|||
RE: What are good PRNG for calculators?
(11-05-2014 05:05 PM)Thomas Klemm Wrote:(11-05-2014 11:02 AM)jdimijian Wrote: Hi Thomas, LOL ! The program extract that you have found is mine, it's written in ABAP (SAP development language)and as I told you, I use it every time I need random function. It took me several years to find the algorithm, I was knowing nothing about these aglorithms and there was no Internet at this time ;-) I was able to progress and find because I could fix the seed, I realized very soon that between 2 runs, the last digit (that is hidden but can appear with f-prefix) was incremented by 3. I explored this fact and progressively found all the stuff (without guessing that there is a simple multiplication !). But today, knowing the existing algorthms, and having 2 or 3 successive random numbers, we can easyly retreive the different numbers. Thanks for your attention Thomas. Best regards. Joseph. |
|||
11-06-2014, 08:03 PM
Post: #33
|
|||
|
|||
RE: What are good PRNG for calculators? | |||
11-12-2014, 02:03 PM
Post: #34
|
|||
|
|||
RE: What are good PRNG for calculators?
I seem to recall early personal computers that created a random number in a game/program by using a very fast counter and the most random thing in the room.. a human. When the human presses the key it grabs whatever the number that the counter was set to, at the time of the keypress.
Shawn |
|||
11-13-2014, 10:52 AM
(This post was last modified: 11-13-2014 10:54 AM by Gerald H.)
Post: #35
|
|||
|
|||
RE: What are good PRNG for calculators?
(09-06-2014 05:55 PM)John R. Graham Wrote: When do you think it's inappropriate to use a really good PRNG? The only contraindication I can think of that is potentially valid is if the resource requirements and/or execution time is onerous on the platform. Should you wish to eg find the area under a curve you would also want to avoid clumping, which clumping is a characteristic of a good PRNG. For such applications a Quasi Monte Carlo sequence of D-dimensional Halton sequence vectors is preferable, providing good spread within the set lower & upper limits & avoiding clumping. For eg crypto purposes, QMCS is not so good. In short, there are some uses where real randomness approxination is not the chief criterion of efficacy. |
|||
11-14-2014, 01:41 PM
(This post was last modified: 11-14-2014 01:41 PM by Namir.)
Post: #36
|
|||
|
|||
RE: What are good PRNG for calculators?
(11-13-2014 10:52 AM)Gerald H Wrote:(09-06-2014 05:55 PM)John R. Graham Wrote: When do you think it's inappropriate to use a really good PRNG? The only contraindication I can think of that is potentially valid is if the resource requirements and/or execution time is onerous on the platform. Gerald, You are the first person who discusses the negative aspects of very good PRNGs! It is very easy to have poor PRNGs and hard to develop good ones. BTW .. I love your city and plan to visit my beloved Vienna in the fall of 2015. My wife and I usually stay at the Astoria hotel near the Opera house. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: