PARADOXES OF PROBABILITY | USING THE C OR C++ rand() FUNCTION | |||
index | ||||
Back to Deley's Homepage |
(y) | = (int)(x) |
= (int)(r*M) | |
= integer in range [0,M) | |
= {y: 0 < = y < M} |
1. | If M is an integer then the highest integer returned is M-1 | |
then y = integer in the range [0,M-1] | ||
i.e. (y) = {y: 0 <= y <= M-1} | ||
2. | If M is not an integer then the highest integer returned is (int)M | |
then y = integer in the range [0,(int)M] | ||
and (y) = {y: 0<= y <= (int)M} |
(z) | = y+1 |
= (int)(x) + 1 | |
= (int)(r*M) + 1 | |
= integer in the range [1,M+1) | |
= {z: 1 <= z < M} |
1. | If M is an integer then the highest integer returned is M | ||
then z = integer in the range [1,M] = {z: 1 <= z <= M} | |||
2. | If M is not an integer then the highest integer returned is (int)(M+1) | ||
then z = integer in the range [1,(int)(M+1)] | |||
i.e. (z) = {z: 1<= z <= (int)(M+1)} |
PARADOXES OF PROBABILITY | USING THE C OR C++ rand() FUNCTION | |||
index | ||||
Back to Deley's Homepage |