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:
Anonymous2016-08-05 17:10
f = g, because a < random(a+b) = a-random(a) < random(b)
Name:
Anonymous2016-08-05 17:38
(defun f (a b) (if (< (random a) (random b)) 1 0))
(defun g (a b) (if (< a (random b)) 1 0))
(defun count-fn-one (fn up-to) "Counts how many times FN is 1" (loop for i from 1 to up-to summing (loop for j from 1 to up-to summing (funcall fn i j))))
g(a,b) = a < random(a+b) a < [0;a+b) a < [0;a) + [0;b) a - [0;a) < [0;b) [0;a) < [0;b)
f(a,b) = g(a,b) ``
Name:
Anonymous2016-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
/prog/ is now officially proven to be full of inborn retards incapable of solving even elementary school problems, with exception of maybe one or two visitors. No wonder you vote Trump.
>>29 Mexicans illegals don't have higher education. They work in fields or in construction. Programmers without educations usually do freelance web coding stuff and live in some cheap country, like Mexico itself (pro-tip: USA is not the cheapest country to live in).
Name:
Anonymous2016-08-06 21:56
>>32 Only Ukraine would be cheaper than Mexico and have passable IT infrastructure at the same time. Yet most people in Ukraine don't speak english, as they are being forced to learn russian instead. So huge economic opportunity lost.
Name:
Anonymous2016-08-06 22:00
what's the deal with insulting people who can't easily solve the problem?
is somebody insecure about their problem solving ability?
>>35 The problem with that claim is that most "fat shaming" doesn't promote a desire for self-improvement, it just promotes low self-worth. Pointing out that losing weight will make you healthier and make you feel better about yourself is one thing, but that's not the form that "fat shaming" usually takes.
random(a + b) = random(a) + random(b) <-- Unproven a < random(a) + random(b) = a - random(a) < random(b) = random(a) < random(b)
(defun random-a+b (n) "By how much larger is random(a+b) than random(a)+random(b)?" (float (/ (loop for a from 1 to n sum (loop for b from 1 to n summing (- (random (+ a b)) (+ (random a) (random b))))) (* n n))))
* (random-a+b 10000) 0.8115202
Name:
Anonymous2016-08-07 9:43
>>38 and..... lispers keep being reddit laughing-stock!
Yes, I think it's definitely equal. random(a+b) is always some very small number (<1) above random(a)+random(b) but that's probably an artifact of the pseudorandom number generator.
<anime> f(a,b) = random(a) < random(b) and g(a,b) = a < random(a+b) <anime> how to prove they're equal? <dalcde> anime: No one can help you until you make yourself comprehensible. <anime> ok * gfixler has quit (Ping timeout: 265 seconds) * GoldenKey has quit (Read error: Connection reset by peer) <FilipinosRich> dalcde what was the link again to your group theory notes <FilipinosRich> If you don't mind me asking <dalcde> dec41.user.srcf.net <---------- ### LEL hes a cambridge math toilet scrubber <FilipinosRich> Thanks <anime> dalcde, maybe if you had more than 2 IQ points to rub together you could figure it out ;) <dalcde> This is ##math, not ##psychology. <dalcde> We are not psychics. <FilipinosRich> Lool <xrlk> lol i hope you didnt spend 2 minutes brainstorming that comeback <xrlk> hey Z-module got any SICK maths to teach me today???? <Svitkona> anime, what do you mean by "equal" <Svitkona> what is random(a) <anime> = <xrlk> XD <anime> it's a random number from 0 to a <Svitkona> ok, what does f(a, b) = random(a) < random(b) mean <anime> this is basic stuff dude <xrlk> XD <FilipinosRich> lmfao <Svitkona> can you explain, then? <anime> why act like this is confusing or hard <xrlk> ebin trolle <someone13> a chick once stabbed me
turns out /prog/ is smarter than cambridge math teachers, who knew?
Name:
Anonymous2016-08-08 15:13
<HisShadow_> anime: use voretion of cobenations <anime> thanks HisShadow_, I'll try <ayush1> did anyone find a simpler method for my problem? <dalcde> HisShadow_: I think anime needs to compute the third derived cohomology group of the stochastic bundle instead. <zehdeh> I have a set of points that resemble a sphere. I want a single value for every point telling me how much like a perfect sphere it actually is. Is curvature the right thing for this? <anime> wow u must be so smart dalcde that sounded complicxed xD <anime> i love pretending to be smart on the internet by talking about cohomology <zehdeh> *in the area between the point and its neighbors * cheeseboy has quit (Ping timeout: 240 seconds) <dalcde> anime: Nah you need to find something harder. <anime> dalcde, omg you're like sheldon out of big bang theory :D <dalcde> Cohomology is easy. It is just computing the connected components of the hom sets with the nth delooping of the representing object in an infinity-1 topos. <dalcde> (That is actually true) dalcde!*@* added to ignore list. <Svitkona> anime, can you please explain? <FilipinosRich> Was about to say that the easy part is relative <anime> stop pinging me <Svitkona> anime, do you want me to stop pinging you? <Svitkona> anime, was that towards me? <xrlk> anime, <FilipinosRich> anime why <xrlk> were u talking about me?? <ayush1> rain1
turns out /prog/ is smarter than cambridge math teachers, who knew?
Nope. The problem is just too simple for them, so they make jokes out of you being stoopid. I.e. recommending you to "compute the third derived cohomology group of the stochastic bundle instead."
Name:
Anonymous2016-08-08 18:30
>>50 And that Svitkona simply uses ELIZA algorithm to troll you. So he is apparently very good at programming too, but just love to troll noobs and idiots.