HP Prime: RANDOM



#6

Good Morning,

From Home, Toolbox- Math- Probability - Random - Number sets up the RANDOM function which inputs two numbers and outputs a random number in between those two. Produces a display like

RANDOM(1,100) 99.2856397571

In CAS, the same sequence of key presses produces the display

RANDOM(1+100*i) 20.2759023826

I wonder what is the role of the "i" in RANDOM. That is, I did not input "i" to RANDOM, I typed RANDOM(1,100) but it displayed the line above.

Thanks!


#7

RANDOM does not follow the same grammatical rule as "normal" functions for the CAS parser. You must write it without parenthesis RANDOM 1,100 or with parenthesis *outside* (RANDOM 1,100)


#8

I see, thank you. But then, I wonder why the parenthesis come in when choosing RANDOM. that it's, the sequence of key presses above sets up RANDOM().

#9

Quote:
Good Morning,

From Home, Toolbox- Math- Probability - Random - Number sets up the RANDOM function which inputs two numbers and outputs a random number in between those two. Produces a display like

RANDOM(1,100) 99.2856397571

In CAS, the same sequence of key presses produces the display

RANDOM(1+100*i) 20.2759023826

I wonder what is the role of the "i" in RANDOM. That is, I did not input "i" to RANDOM, I typed RANDOM(1,100) but it displayed the line above.

Thanks!


(a,b) is interpreted by the CAS parser to mean complex numbers. Ideally, though, RANDOM should have actually parsed RANDOM(1,100) "properly" and only assume a complex input when typing RANDOM((1,100)) -- we can only hope that they can find a way to do this for the next firmware.


#10

I hope HP hears you. One unfortunate issue that this mismatch of notation causes is that "importing" is useless. It still works from Home to CAS, but it creates a messy instruction from CAS to Home.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Some random wish list items for the 43s Marcel Samek 18 1,167 07-11-2013, 05:35 PM
Last Post: Paul Dale
  OT: Help with Testing Random Number Generators Namir 5 427 08-01-2011, 11:20 PM
Last Post: Paul Dale
  Question about random number generators Namir 20 1,037 07-08-2011, 11:05 AM
Last Post: David Hayden
  Random Number Generation Challenge (sort of) Namir 9 601 02-15-2010, 08:05 AM
Last Post: Bart (UK)
  HP17b & it's offsprings - Random Number Generator - How? Peter A. Gebhardt 29 1,367 12-09-2009, 02:18 AM
Last Post: Marcus von Cube, Germany
  O.T. Pseodo-random noise designnut 0 147 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 351 12-15-2007, 10:46 AM
Last Post: bt_schmidt
  Random simulation (and stimulation?) Kiyoshi Akima 7 548 07-28-2006, 07:08 PM
Last Post: Rodger Rosenbaum
  HP35 HP45 battery charger. Random display values. Charles Esson 3 257 10-26-2005, 10:13 AM
Last Post: Thomas Radtke
  Random number generated on a 32sii Charles 4 256 09-15-2003, 04:44 AM
Last Post: Tizedes Csaba

Forum Jump: