Random number generated on a 32sii « Next Oldest | Next Newest »

 ▼ Charles Member Posts: 69 Threads: 26 Joined: Feb 2008 09-14-2003, 08:47 PM Have any of you written a random number generating program for a 32sii? Specifically generating an integer between say 1 to 5? I don't have the manual and wonder if it could be already in existance? Best regards, Charles ▼ Robert Junior Member Posts: 30 Threads: 9 Joined: Feb 2006 09-14-2003, 10:22 PM It has a random number generator from 0 to 1(Prob -> R). Couldn't you just use a linear transform of that, i.e., Your Random Number = 1 + (4*R) ▼ Patrick Senior Member Posts: 266 Threads: 32 Joined: Jan 1970 09-14-2003, 11:06 PM I think you would need to compute 1+int(5*R) to get a random integer in the range 1..5. Most random number generators produce fractions from zero to one, including zero but not including one. Tizedes Csaba Member Posts: 93 Threads: 15 Joined: Jan 1970 09-15-2003, 03:46 AM . Tizedes Csaba Member Posts: 93 Threads: 15 Joined: Jan 1970 09-15-2003, 04:44 AM Hi! Try it: ```LBL R #random INPUT N #how many Nums? INPUT I #mInimum? INPUT A #mAximum? LBL J #jump here RCL A RCL sub I 1 add RANDOM mul IP RCL add I PSE #put another PSE, if it too fast DSE N GTO J RTN 'add', 'sub', 'mul', 'div' mean 'add', 'substract', 'multiple' and 'divide' in this order. ``` Csaba

 Possibly Related Threads... Thread Author Replies Views Last Post HP Prime: RANDOM Alberto Candel 4 1,403 10-18-2013, 09:18 PM Last Post: Alberto Candel Some random wish list items for the 43s Marcel Samek 18 3,994 07-11-2013, 05:35 PM Last Post: Paul Dale OT: Help with Testing Random Number Generators Namir 5 1,537 08-01-2011, 11:20 PM Last Post: Paul Dale Question about random number generators Namir 20 3,664 07-08-2011, 11:05 AM Last Post: David Hayden Random Number Generation Challenge (sort of) Namir 9 2,104 02-15-2010, 08:05 AM Last Post: Bart (UK) HP17b & it's offsprings - Random Number Generator - How? Peter A. Gebhardt 29 4,775 12-09-2009, 02:18 AM Last Post: Marcus von Cube, Germany O.T. Pseodo-random noise designnut 0 585 11-25-2008, 05:31 PM Last Post: designnut Man calculates the 13th root of a random 200 digit number in his head in 70 secs! BruceH 5 1,425 12-15-2007, 10:46 AM Last Post: bt_schmidt Random simulation (and stimulation?) Kiyoshi Akima 7 1,891 07-28-2006, 07:08 PM Last Post: Rodger Rosenbaum HP35 HP45 battery charger. Random display values. Charles Esson 3 1,019 10-26-2005, 10:13 AM Last Post: Thomas Radtke

Forum Jump: