Balls

i was having fun in that thread but it died before I finished my program
so here's the stupid ball puzzle, plus the source code of the proof, plus the output of the program. enjoy, and don't criticize my lazy perl coding.

Attached: balls-solved.png (1800x909, 575.93K)

it's also interesting that it shows getting a red half the time on the first pick, and we account for that and skip those rounds.

how did anyone get anything other than 50 percent?

and your code is dogshit

I spent an entire thread sperging about this, you're going about it the wrong way user, the question is what is the chance that the other ball in the box you picked is also green after the first ball is green, the only variable here is if the second ball is green or red, anything e;se is irrelevant to this question because it already states that you picked a green ball fist and must pick the second ball from the same box which is also already picked for you.

maybe a bit sloppy, but it's accurate

wrong how? the question is indeed what is the chance that the other ball in the box you picked is also green after the first ball is green, as you say, and that's precisely what the program emulates. it picks the first ball, and if it's red, it starts over. if it's green, it picks the other ball in the same box, and it keeps track of how many are green vs red over 10000 repetitions.

2/3rds of the time, it's green. i thought it should be 50/50 as well but of course I also believe Bertram because I'm not retarded

Think about it this way, there are three possible states for the boxes; negative 2, zero, and positive 2.
For the question it's asking given a random pull of -1, what are the chances of getting -2... if there are three boxes in the system, then logically you can exclude the state of positive two, since it's impossible to get positive 2 by adding -1 and 1.
Since we now know that at least one of balls is -1, the state is a 50/50 chance of getting -2, or 0.

It's 66%, midwit

think about it however you want. the code is not a mathematical proof as much as it is a step by step simulation of the actual game and counting the results over 10000 repetitions.

then explain how you are getting that answer...
I explained my logic in Happy to correct myself if you can explain otherwise.

that is precisely the value of gotgreen in the output, so yes, you're correct, as is Bertrand.

the code simulates the steps 10000 times and literally outputs that answer with full source code visible. it's all there in the image, if you just read it and work through the code yourself.

Because, the way the question is worded. the conditions of a word problem are important and your code doesn't follow those conditions. Reword the question and you would be correct

isnt it obvious it would be a higher chance you are in the two greens box if you picked a green ball?

like I stated before, your code is not following EXACTLY what the image is stating.
read

explain where the code fails to follow the conditions of the puzzle?

it picks randomly and if it's red, it throws everything out and starts over.

if it picks green, it grabs the other ball from the same box and counts how many of those are green vs. red over 10000 repetitions. it is not flawed.

if you pick green first then you are ruling out the all red box. In the two boxes remaining you have 2 green balls and 1 red ball left, so probability is 2/3 green.

That is what is wrong, the simulation starts from when you pick the second ball, the first ball is always green no matter what, which is why the Berttan paradox has nothing to do with this since the paradox comes from the chance of the first gold coin not being gold if the second box was picked, not only is it redundant to simulate it but it clouds the result with numbers that do not matter in this question.
The question is what is the chance of the second ball being green and what is the chance of it being red in a scenario where no other variables exist.

you can't pick the same ball out of the box, the image specifically states that there are only 2 balls in the box. IT FUCKING SAYS THE OTHER BALL MOTHERFUCKER

rand not really random.

Lmfao. This is fucking awesome. I want to see when the tards start trying to write code to force the 50/50. Lol

I'll help
If box contains green, remove green.

The wrong answer is based on an omniscient force pulling green for you instead of discarding the red pulls from the r/g box.

There are 3 scenarios.
1. You've picked the green ball, and the other is red. Fail.
2. You pick ball 1 from the first box. Ball 2 is green. Pass.
3. You pick ball 2 from the first box. Ball 1 is green. Pass.

2/3 scenarios, the next ball is green.

it's not a higher chance, it's a certainty that you are in the first two boxes, since those are the only ones that contain green, since the rules state that if your first pick is red, it doesn't count.

Because the question dictates that you have picked a green ball. Therefore picking a red ball first isn't even a part of you're equation.

It's like saying Tom buys 7 apples and 6 bananas how many bananas did Tom buy? The apples are just extra info


Reword the question and you will be correct

what the fuck are you even talking about "pass and fail"?
the op's image states it in plain fucking English, learn to read.

i meant the box were there are two green balls

Because if you got a green ball then it's more probable that you choose the box with two greens instead than the box with red/green.

Try reading the explanation again
After taking one green ball, only 3 balls are left in play: 2 green and 1 red

those results arent even counted so its irrelevant

starting the count from when the 2nd ball is picked does not violate the rules.
the first ball is always green no matter what according to the stated rules, in the form of the question, "if you pick green first, what are the odds the 2nd in same box is also green?"

so you have to throw out any initial red ball picks and start over.

when you get green, you grab the 2nd ball from the same box and track the color.

that's exactly what the code does, and it outputs 2/3.

The secret Yas Forums discord link is discord gg CpqQw7b
Get in here before we close the invites
We have a interview set up with the infamous Ben Shapiro tomorrow.
bjj

Attached: sample-213d2de1a6fdf5589b4e68d1f2b6de07-1.jpg (1400x904, 165.13K)

it's random enough for our purposes due to 10000 iterations.

There is no difference between ball 1 and ball 2 in the green box.

1. Start with green ball, box 3 is eliminated

2. Of the two boxes remaining, one has a green ball one has a red ball.

3. 50/50 chance of drawing green

it's 1/3 anyone who says otherwise is retarded

correct, picking a red ball first isn't part of the equation, which is why "next" is called in those situations, causing the loop to restart and no results are tracked - like it never happened.

Not sure this is quite the same as the Monty Hall problem.

Lmao you really are a midwit, aren't you

That's what I was saying, the first part of the word problem is just extraneous info

it's not at all the same as Monty Hall, but I wrote a program to simulate that too, years ago, just for fun. to actually SEE the phenomenon rather than pontificating about it endlessly

no
of the two boxes remaining
either one has a green ball and the other a green and a red
or one has a red ball and the other two greens

I can see where you are coming from here at least.

still read and also read op's image text for the original problem

read

>There is no difference between ball 1 and ball 2 in the green box.

Please do a basic statistics class before posting such nonsense here thanks.

its not wrong it just doesnt matter
the question itself containing the red box would be extraneous info

>Yas Forums is too busy arguing about handling balls
typical gay niggers

Attached: a_disappointment_so_great.jpg (210x230, 6.78K)

OP here
i've tried to respond to everyone worth responding to. I think it's clear that the simulation outputs 2/3 and proves that conclusion.

what i do find very peculiar about the whole thing is, if it's assumed your first ball is green, eliminating first pick reds, then that means box 3 cannot be the box you reached into.

and given that you're reaching back into box 1 or 2, and you have a green in your hand, the other one must be green if you picked box 1, and red if you picked box 2, which denotes a strong 50/50 conclusion.

yet, somehow, that is not the correct answer.

It is wrong because the code would get green 3/4 of the time when such a possibility is contrary to the question and irrelevant.
It clouds the asnwer because from these 3 there is indeed a 2/3 chance that the other ball is also green.
But none of that matters, the question is literally what is the chance of this ball being green and what is the chance of it being red, there are no other variables in any way here.

Based contrarian

it's worth noting that the reason you're getting the 66% is that the code is biasing towards the box with double green balls.

In your code, you're drawing a ball at random. if red, discarded, if green, you move to the next step.
Because one of the boxes contains more green balls, when your code draws a green ball, you're more likely to have drawn it from that box. So the overall trials end up representing the result as if you're drawing from that box more often.

Which is of course what happens if you're doing the test in real life too. The 66% is because you're more likely to have drawn a green ball from the 2green box than from the 1green box. So it's not 50% but instead slightly higher because of that additional weighting.

uhh, the code does not, and cannot, get green 3/4 of the time as written.
it doesn't really cloud the answer since it outputs a 2/3 answer so I don't really know what you're on about.
the chance of it being green is derived by doing it 10000 times and looking at how many green and how many red pop out.
on the 2nd grab only.
after the first grab IS green, first grab reds don't count.
the code covers all of this.

Attached: wow.png (630x80, 65.95K)

>Which is of course what happens if you're doing the test in real life too

isn't that all that really matters?
I built the boxes, as written, including the RR box.
I randomly pull a ball.
If it's red, I ignore everything and start over.
If it's green, I pull the other ball from the same box, and do that 10,000 times and count how many are green vs. red, and it's 2/3.
so what's the problem?

kek i love how mad everyone gets at these kind of threads

the code pulls the other ball from the same box after getting the initial green. it doesn't randomly choose a different box.
$otherpick = $boxes[$box][$otherside];
$box is unchanged, same as initial pick.
$otherside is the other side of the box containing the unpicked ball.

Let's make this more intuitive for everyone.

If Box A has only green balls, and Box B has an even split of green and red balls, if you draw a green ball what box would you bet on having drawn from?

This isnt a math problem, it's a logic problem

It doesn't say "if you pick green first" if it did ot would be 2/3rd, but it says you have picked green. So is 1/2

The wording of a word problem matters

There's no problem at all. Im just trying to explain why you get the 66% result rather than the more intuitive 50%.

what's your point? he's still right. the probability is 2/3rds

you shouldn't be counting reds at all, it's a red herring

The problem is that the first pick should not exist and is used as base for the second pick.
There is a 2/3 chance that you picked from box 1 with the first pick factored into the code when that part is completely unecessary which is what changes the result.
When you remove all of the extraneous info the question becomes: this ball is either green or red, what is the chance of it being green and what is the chance of it being, which is a 50/50 split.

"if you picked green first" is the same as "you have picked green"
you can't ignore the RR box just because you feel like it.
the puzzle asks a simple question
assuming you pick green first, which you have already just done, which means you didn't pick red first (so if you build a code simulation throw out the red picks), what is the probability the other ball in the same box is green?

this is precisely what the code does, step by step.

point out specific flaws by specific line of code or shut up.

66% is the answer

people are dumb, if you pick a green ball one of the boxes is completely ignored and not relevant at all

i dont see how it would be a strong 5050 conclusion at all
you have a green ball
youve either picked a green from box 1
picked a green from box 1
or picked a green from box 2
so if you have a green in your hand chances are you are in box 1

Once you have picked green, you have either ended up with a green ball from a box with a 100% chance of giving you a green ball, or you ended up with a green ball from a box that only has a 50% chance of giving you a green ball.
Do you see why if you grab a green ball it's more likely it came from a box where only green balls were possible instead of from a box where you could have just as easily grabbed a red ball?

i prefer to leave all the supposed "extraneous" info in, and just account for it in the extremely primitive simulation that this code represents.

it says you picked green. obviously you pick a box at random and you pick a ball at random from that box, from the initial THREE boxes. so we include them all. for every iteration that we pick green first, we look at the other ball.

this is all that the code is doing. if it's wrong, point to a specific line.

Not only can you ignore the RR, you should lol.
The wording of a word problem matters.

>When you remove all of the extraneous info
in other words when you completely ignore the reality of the situation, then it is 50%

This. Box 2 only has a 50% chance of giving you a green ball, so if you get one its more likely it came from Box 1

I think this is what common core did to people.

Lol, reread that mr big brain.

i think because of this:
once you pick green:
the non RR boxes contain either:
GG and _R
or
G_ and GR
so the 50/50 comes from the face that you must either be in the _R box or the G_ box.
so when you grab the other ball, all that remains is either R or G so it must be 50/50.
i understand the instinct.
it's some kind of weird human failing.
the program doesn't lie.

take a closer look at the wording of the question. it's 1/2.

i do see this, and I believe you're tapping against the true answer here. it's all about the probability that you picked box A or B given that you didn't pick box C, which is weighed more heavily toward box A by exactly 2/3.

come on now... think about this really fucking hard

Attached: probablity.png (699x170, 166.05K)