Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Random Algebra

Name: Anonymous 2016-08-05 16:07

Given functions
f(a,b) = random(a) < random(b)
and
g(a,b) = a < random(a+b)

which if of them is more likely to result into 1, if random(n) returns arbitrary number in range of [0;n)?

Justify your answer.

Name: Anonymous 2016-08-06 17:12

>>3
This is incorrect for two reasons.
One, you defined g incorrectly. It got random(a+b), not random(b).
Two, it's only probability check for three different randoms. You should have generated random(a) and random(b) first, then feed them to simplified f and g functions*, knowing random(a+b) is equal to random(a)+random(b). Only then you would get realistic results.

*
'a = random(a)
'b = random(b)
'f('a,'b) = 'a < 'b
'g(a,'a+'b) = a < 'a+'b

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List