HP Forums

Full Version: (17B) Random Numbers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The HP 17B series does not have a random number function. We can use the solver to generate random numbers. Random numbers between 0 to 1 are generator.

The format to use will depend on the version of HP 17B you are working with.

The code used will use psuedo-random generator:

r_i+1 = frac( ( π + r_i)^5 )

Classic HP 17B and HP 17BII:

We can use Let and Get to generate random numbers, they are used to generate in recurring sequences.

Code:
R#=FP((PI+G(R#))^5)

Instructions:

Enter a starting seed, press (R#).
For future random numbers, keep on pressing (R#).

Brown and Silver HP 17BII+:

We'll use the two variables. Despite the fact that Let and Get are available on the silver HP 17BII+, they cannot be used in recurring sequences.

Code:
R2#=FP((PI+R1#)^5)

Instructions:
Enter a starting seed, press (R1#).
For the first random number, press (R2#).
For future random numbers, press [ STO ] (R1#), then (R2#).

Blog entry: https://edspi31415.blogspot.com/2019/03/...andom.html
Reference URL's