
Random Numbers
#1
Posted 19 April 2004 - 05:54 AM
Has anyone ever got 0 or 1 from the Ran# function? Theoretically, which of these are possible?
Do you think some numbers never appear using the function?
Does anyone know how they are generated? Is it a list, a random number table or something else?
Do the numbers continue after each time you reset the calculator? Are they different on brand new calculators and how is this possible?
Before I go, is i positive or negative? For those who think it's neither, remember i=-i is not true.
#2
Posted 19 April 2004 - 06:45 AM
#3
Posted 19 April 2004 - 07:21 AM


i never had 0 without a 'Int'.
for the AFX, you have 2 modes generating random numbers, if you do Ran# X where X is an integer from 1 to 9, you get a random number from the random list #X (retry to have the next number), so if you do Ran# 1, Ran# 2, Ran# 1, Ran# 1, the first and the third will be same.
for the normal mode i don't know exactly
you'll never know about the new calcs as i suppose that the calcs are tested before selling, so they aren't really new ^^
- i is not positive and not negative, the complexes are neither positive neither negative, and there are no usual order relation like <=, >=
#4
Posted 19 April 2004 - 10:38 AM

I would have to agree that a random number x is as you said: 0<=x<1, just for the sake of the Int function (BTW, random numbers don't go further than the 10 digits on the screen).
#5
Posted 19 April 2004 - 04:17 PM
1->M Ran#->S S>,5=>5->M
This code should give me an about 50-50 chance that the "enemy" would use either trick #1, or trick #5 (defined by the variable M).
The simple question is: why does the "enemy" use trick #1 about 90 % of the time, and the remaining percents on trick #5. I've runned it through a loop, and got an average of: M=1 => 85%, M=5 => 15%
And no, i didn't just run it 30 times, i made the calc do it for about 500 times before giving me the result.
(chapter two)
i changed the code from S>,5=>5->M to S<,5=>5-M
Now, the "enemy" does each of these tricks about 50 % of the time, as it "should".
Anyone familiar with this problem?
#6
Posted 19 April 2004 - 06:58 PM
1) a fairly even spread of nmbers from 1 to 10
2) a random assortment, that is speard randomly, in other words NOT evenly!
as you can see just to define random is not easy
#7
Posted 19 April 2004 - 07:24 PM

You're random (i think thats an expression)

#8
Posted 19 April 2004 - 08:53 PM

#9
Posted 19 April 2004 - 09:20 PM
A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+r+o Abs(int(Ans)) (int(Ans))-(((int(Ans/10))*10) int(((Ans/2)*2)+.5) (int(Ans*Rand# Ans)/10)+(int(Ans*Rand# Ans)/100)+(int(Ans*Rand# Ans)/1000)+(int(Ans*Rand# Ans)/10000))
just run that and it will return a digit between 0 and 1 (note that it cannot return 1)
-------EDIT-------
slight math correction

english translation:
add all the variables in the calc
make them positive and cut off the decimal
get the first digit after the .
devide that number by 2, cut off the decimal, times it by 2, add .5, cut off the decimal
take random numbers from random lists use them to fill each place of the final number above, up to 5 below the decimal.
#10
Posted 19 April 2004 - 09:32 PM
Well, i'm getting various numbers from about with values within [100,3000] ---

What about adding:
(Ans)^(-1) for the cfx?

#11
Posted 19 April 2004 - 10:49 PM
A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+r+o Abs(int(Ans)) (int(Ans))-(((int(Ans/10))*10) int(((Ans/2)*2)+.5) (int(Ans*Rand#)/10)+(int(Ans*Rand#)/100)+(int(Ans*Rand#)/1000)+(int(Ans*Rand#)/10000))
beware though, im doing this in my head so it might not produce the 0~1 results i think it does

oh, and btw: on the AFX all variables are allways inialized, on the CFX this could cause an error. you should initialize them all to random numbers at the start of the program (should you use this in an actuall program)
#12
Posted 20 April 2004 - 04:52 AM
is defined 0<x<1 so neither 0 NOR 1 will ever appear unlesyou use a rounding
function. (what would be useless since
you'd only get number 0 and 1 from it.
#13
Posted 20 April 2004 - 04:41 PM
that's the most common way of defining a float rand anyway
as explained previosly, the chance of getting a particular number (like 0.0) is very low, and pseudo random number generators never cover their entire span before they repeat themselves
one of the programmatic reasons rand doesn't include 1 is, it's easier to generate a random bit pattern for a float if you know the exponent is static (this doesn't really yield true in the same way on the calculator since it uses BCD numbers).
obviously there are mathematical reasons you don't want the set to include 1, for instance that would make it very hard to generate numbers that span a certain range (if both 0 and 1 was included)
#14
Posted 22 April 2004 - 01:40 PM
I got once 0 from RAN# on my old good fx770GB , but this model computed Ran# for 3 digits only, so I got 0.000 . Once I got also 0.999 :-)Has anyone ever got 0 or 1 from the Ran# function? Theoretically, which of these are possible?
I have found in the manual, that Ran# returns numbers in 0..1; 0 included, 1 excluded
#15
Guest_Antonio_*
Posted 05 December 2010 - 05:36 PM
I hope this help

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users