[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: JQOxlPh.png (470 KB, 701x576)
470 KB
470 KB PNG
Imagine in an interview you're asked to solve this problem, optionally with the aid of any programming language of your choice.
(NOTE: Anyone worth hiring above 90 IQ can do this)
>>
use case?
>>
>>106784288
>sub 50 iq
>define 3 containers, box1 = [1, 1], box2 = [1, 0], box3 = [0, 0]
>run a 1 million loop function which picks a random box, then a random box element
>increase gold counter if it is gold
>return an array of counter
>divide gold counter by 1 million
>get probability
>done
>>
>>106784373
>[strike]array of[/strike] counter
>>
>>106784373
Failed, because your 1,000,000 tests include cases where no gold ball is picked at all, which is outside the scope of the question's conditions and leads to an incorrect answer. Better luck next time kiddo
>>
>pick a random box
>it's never the double silver box
do I have superpowers or something?
>>
>>106784393
The superpower is that the question presumes you already drew a gold ball from one of the boxes
>>
>>106784288
>next ball
>same box
you don't need a programming language to figure this out anon
it's 50%
>>
>>106784288
3rd box is voided since the first pick has to be gold
a gold pick from the first box is a certain gold pick for the second
a gold pick from the second box is an impossible gold pick for the second
so 1/2
>>
float solution(void)
{
return .5f;
}
>>
>>106784403
it also says the selection is random, which it evidently isn't
it's not even a red herring, it's flat out false
>>
>>106784410
The answer is actually 66%. Even with the silver box voided, there are a total of 3 gold balls. So the cases are
>box 1, left gold ball, swap to right gold ball
>box 1, right gold ball, swap to left gold ball
>box 2, gold ball, swap to silver ball
>>106784411
>3rd box is voided
Probability doesn't work like that
>>
>>106784419
It's called a hypothetical scenario. It's like asking "if you draw an ace, a queen, and a king from the deck, what is the probability that the next two cards are a jack and a 10?"
If you hear this and ask "but how do you know I drew an ace, queen, and king from the deck? Couldn't I have drawn any cards?" you're autistic
>>
>>106784389
yes, cause it's a troll answer for hr
you ascii stupid questions, you get stupid ansii
>>
File: heh.jpg (94 KB, 1328x1080)
94 KB
94 KB JPG
Output: 66%

local boxes = { {1,1}, {1,0}, {0,0} }

local wins = 0
local tests = 0

while tests < 1000000 do
for _, box in pairs(boxes) do
box = {unpack(box)}
local ball = table.remove(box, math.random(2))
if ball == 1 then --ball is gold
tests = tests + 1
wins = wins + box[1]
end
end
end

print(("%d%%"):format(wins/tests * 100))
>>
File: 1743139475159223.jpg (50 KB, 404x404)
50 KB
50 KB JPG
i know about this stupid puzzle but years later and i still can't figure out why its 2 thirds and not a half
explain how the premise of drawing a gold ball does not translate to effectively ignoring the third box entirely
1. only the first and second boxes have at least one golden ball
2. pull a golden ball
2 therefore implies the box you picked is either first or second (1)

i want a math nerd to prove me wrong right now, its either this or probability fags are insane
>>
>>106784501
The proof is literally right here >>106784493
You can run it yourself and get 66%
>>
>>106784288
But anon, I don't understand.
I don't have any boxes with gold and silver balls.
Why would I want to know the probability of such an absurd situation?
>>
>>106784501
Once you pick a gold you are twice as likely to be in the left box than the middle.
>>
>>106784501
Basically there are 3 circumstances under which you'd pick a gold ball (as there are 3 gold balls) and 2 of them swap with each other, making them successful, whereas the third is the one that's sitting together with the silver ball. The third box is eliminated and a red herring, but the act of selecting boxes is a red herring too, since you have an equal likelihood of picking any of the 3 gold balls (as seen here >>106784493)
>>
Another perspective to understand on why it's 2/3.

Think the question like this: This gold ball I just drew, how likely is that I took it from the box with two golds vs the one with 1 gold 1 silver? You see its not equally likely
>>
>>106784537
>not equally likely
I have an equal chance of picking either box, it doesn't matter which one I draw since they're both gold
It's 50%, which only people with greater than 120 IQ can understand. The question is trying to be some kind of smart paradox but it fails the basic common sense test
>>
>>106784556
You're not picking boxes (of which you have two) but balls (of which three remain right after the moment of the first choice (the first, implicit gold ball)
Therefore if you have three options (three balls) but one of them is silver and two of'm r' gold, the probability becomes Two out of Three (two golds out of three total).
>>
>>106784592
Nice try nigga. Read the question again
>"You pick a box at random"
>>
>>106784592
you aren't picking balls, you are picking boxes
there is no scenario where you pick up the silver ball first
>>
>>106784501
It's the same as asking what's the probability that the golden ball you picked also happens to come from the leftmost box, which is 2/3 because there are 2 golden balls in that box and there are 3 golden balls in total
>>
File: 1000002797.jpg (44 KB, 828x828)
44 KB
44 KB JPG
>>106784433
Wrong. SAME BOX. 33% is the answer

same box changes the entire story

Two of the three outcomes are zero probability (the box with only one gold ball since you took it out already and there's no more in there and the one with zero gold balls to begin with)

and the other outcome is 100% (the box with two gold balls at the start)
>>
>>106784525
Ah shit
>>
>>106784628
>>106784646
I just re-read and you're right, you can't change boxes after the first choice, so yeah, the probability is 50%. Poor comprehension skills, sorry.
>>
>>106784670
kek
>>
>>106784556
ok what if the boxes had 100 balls each, everything else remained the same. Would it still be a 50% chance?
>>
File: 1749812122703788.png (397 KB, 636x616)
397 KB
397 KB PNG
>>106784508
this problem doesn't need a loop, you can just use the binomial notation C(0, 1) + C(1, 1) + C(2, 1)

>>106784525
makes sense but it doesn't really say anything, but you're on the right track

>>106784530
>box selection is a red herring
THIS is the issue, it's essentially about whether order matters or not. mathematically it doesn't since it's 66% but practically anyone would think its a half since they only have two boxes left themmy could pick from, thus a half
so technically > practically? is that really it? what a stupid fucking paradox, i still believe its 1/2 and if anything this highlights a major issue with probabilities
someone should code a solution that nests the probability of picking the gb within picking a box essentially adding an order, i would but its late and too tired for this
>>
>>106784677
You were actually right the first time. Before the question, the following is presumed to have happened:
>you picked 1 of the 3 boxes at random
>you reached your hand into the selected box and picked one of the balls at random
>the ball you pulled out was gold
It's slightly more likely that this occurred in the left box than in the middle box.
>>
>>106784680
I should explain better,
box A - 100 gold balls
box b - 99 gold balls, one silver ball
box c - 100 silver balls

then apply the same logic, this should make it more clear
>>
>>106784683
>someone should code a solution that nests the probability of picking the gb within picking a box
It would still be 66% because of >>106784698
>>
>>106784698
>You were actually right the first time.
Wasn't me, I just chimed in in the middle of the fucking.
>t. nosy anon
>>
>>106784677
>Poor comprehension skills
it's a deliberately obtuse question, so don't worry about it
the question is identical to asking the probability of the second ball being the same color

just the way it's phrased you are ignoring 50% of the possible "random" scenarios outright
>>
>>106784493
>for _,v box in pairs(boxes)
Retard
>>
>>106784493
my eyes, what is that programming language...
you don't know how to use python or what? lmao
>>
File: 1741296699559889.jpg (325 KB, 960x720)
325 KB
325 KB JPG
>>106784710
probably yeah, but then again why is it so counter-intuitive? is it the math that's wrong or us?
>>
>>106784739
Anon literally just read this >>106784700 and think about it for a few seconds, you're just defaulting to retarded logic because the quantities are small enough that they're seemingly easily conceived without the need for any abstraction. When you increase the quantity beyond an easily managed mental model and force yourself to think logically it's pretty clear why the probability for the initial problem works out to 2/3
>>
This is the same annoying probability "gotcha" as the monty hall problem.
Yes, technically it's 66% based on its incredibly specific and somewhat weird phrasing.

You've picked a gold ball out, so you know you've either selected the GG box or the GS box. The next ball you take out will either be a gold ball or a silver ball, intuitively this means 1/2 scenarios you get a gold ball.
The issue is that's not technically what the question is asking, because as >>106784698
said, it's slightly more likely to have picked a gold ball out of the GG box instead of the GS box.
>>
>>106784698
>You were actually right the first time.
Oooohhhh It just hit me after reading this >>106784763
>>
File: 1758607615444974.jpg (76 KB, 736x551)
76 KB
76 KB JPG
you fuckers are the reason the data on this site can't be used to train AI
>>
File: 1736584121223355.jpg (15 KB, 306x306)
15 KB
15 KB JPG
>>106784752
so you think math is right?
prove it then, and no im not talking about running it a million times and going "HEYY I SOLVED IT SEE!!"
im talking about a formal proof, the one used in academic papers
surely you can do it if it's so glaringly obvious right??
>>
>>106784783
>you fuckers are the reason the data on this site can't be used to train AI
0 = 1
>>
>>106784556
>I have an equal chance of picking either box
But you dont have an equal likelihood of picking a gold ball from each box
>>
File: file.png (28 KB, 1187x148)
28 KB
28 KB PNG
>>106784785
picrel
>>
>>106784803
You do, actually, because the question has already decided that your first ball will be gold. Whether you pick the GG or GS box, your first ball is gold. That's why this question is stupid and trips people up, it's intentionally misleading about which parts of the probability of this scenario you should or should not take into account.
(the answer is still 66%, but only if you follow the exact wording of the question, and don't think about this as a human being would)
>>
File: rC4gS4Y.png (173 KB, 1294x711)
173 KB
173 KB PNG
I shared the thread json with Claude 4.1 Opus and it decided on its own to generate a whole autistic webpage kek
>>
File: 1737397053160072.png (2.49 MB, 4000x4000)
2.49 MB
2.49 MB PNG
>>106784807
>had to pull saargpt
and it's still not a proof! there's no proof here, you're just using a formula that you can't prove either!
meanwhile halfchads proof is already here
>1. only the first and second boxes have at least one golden ball
>2. pull a golden ball
>2 therefore implies the box you picked is either first or second (1)
>>
>>106784836
NTA but here's your proof: https://en.wikipedia.org/wiki/Bayes'_theorem#Proof . This is freshman stats, come on now.
>>
>>106784836
>give me a mathmatical proof
>no not that one, also im right heres why, with no mathematical proof

You can pick 6 balls at that the start of this problem. (Gold1, Gold2) (Gold3, Silver1) (Silver2, Silver3)
The problem decided that, after choosing a box at random, the first ball you grab at random is gold. You have picked either Gold1, Gold2, or Gold3. This is where the probably begins -> You're going to pick a second ball, what is the probability of the second ball being gold?

Here are the possible scenarios you could find yourself in after the problem setup:
>First pick was Gold1, next is Gold2
>First pick was Gold2, next is Gold1
>First pick was Gold3, next is Silver1

There is a 2/3rds chance of your next ball being gold.
>>
>>106784785
Let A = "drew gold first", B = "in box with 2 golds"
P(B|A) = P(A|B) × P(B) / P(A)
P(A|B) = 1 (certain to draw gold from GG box)
P(B) = 1/3 (picked GG box)
P(A) = 1/2 (3 gold balls out of 6 total)
P(B|A) = 1 × (1/3) / (1/2) = 2/3

QED, faggot
>>
>>106784821
>You do, actually, because the question has already decided that your first ball will be gold
No, you're using future tense and acting like it was preordained. It's clearly happenstance in the question
>>
>>106784876
absolutely bayes'd
>>
>>106784836
nigga ur retarded
>>
>>106784288
Is it a Tuesday?
>>
instead of 2 balls imagine each box has 1 billion balls
box 1 is all gold
box 2 is 1 gold 999,999,999 silver
box 3 is all silver

if the logic behind the solution doesn't become obvious to you at that point then you are retarded
>>
File: frogpost.jpg (58 KB, 976x850)
58 KB
58 KB JPG
>>106784908
It's 50%, either I'm in the box with all gold or the box with 999,999,999 silver
>>
>>106784439
that example doesn't have any contradictions, however if you were to say
>you choose a random card which is a queen
then that would be a contradiction, it cannot be both random and predetermined
If you still don't understand then you probably never will
>>
>>106784525
fuck, I thought it was so obviously 50%. I would have been filtered by that part but it feels like a shitty trick question doing slight of hand with the direction it pushes you to think.
>>
>>106784933
Randomness is implied from the act of drawing cards from a deck
>>
>you pick a gold ball
I've got a better idea, what if I didn't pick a gold ball? I should solve for that scenario too. Good programmers would.
>>
File: 1750773304087005.jpg (192 KB, 1056x821)
192 KB
192 KB JPG
>>106784876
>P(A) = 1/2 (3 gold balls out of 6 total)
huuuh?? now its a half? that's interesting
then you add a bunch of symbols and now it's suddenly 2/3 again, i wonder why's that

>>106784873
>You have picked either Gold1, Gold2, or Gold3
see that's the thing, it isn't about orders, its about whether you know the contents of the boxes or not
even though they are made clear in the image, our brains for some reason assume they're not and act on the instinct of guessing (option 1) instead of calculating the probability with the given data
paradox solved, QED bitch
>>
Why does this exact thread get made every other when when it has literally nothing to do with technology?
>>
>>106784980
>hallucinating chatgpt screenshot
kek
>>
>>106784986
Math is technology.
>>
>>106784986
It's a fizzbuzz for the mind
>>
>>106784986
solving pointless trick questions is peak /twg/
>>
>>106784980
>huuuh?? now its a half?
There are 3 gold balls and 3 silver balls, that's 1/2
>inb4 irrelevant
It matters because of the wording of the hypothetical random selection that was done prior to the beginning of the question.
>>
>>106785020
It's a fun probability question, but that's math. Math is a different board.
>>
>>106784785
It's called Bertrand's Box Paradox, I don't need to write a formal proof it's old as fuck and has been done to death, look it up yourself
>>
The wording is designed to trip you up. What the paradox is, is:
If you had picked a random box and you pulled out a gold ball, it's more likely that you picked the box with two gold balls. Because every time you pick that box, you pull a gold. But half the time you pick the GS box, you pulled a silver and had to start over.
So it's like this
Pick GS box, pull ball, its silver. Start over.
Pick GS box, pull ball, its gold. Pull again, silver.
Pick GG box, its gold, pull again, gold.
Pick GG box, its the other gold, pull again, good.
Half the time you picked GS, you gotta win another 50 50. And the question is asking about pulling double good
>>
>>106784410
wrong, it's 2/3. you can't collapse the probabilities of the two possible choices from box 1.
>>
>>106785180
>you can't collapse the probabilities
well you did when the the possibility of drawing silver first was discarded
so,
>>
sum([int(random.randrange(0,3)//2==0) for _ in range(10**6)])/10**6
>>
>>106784360
God damnit, you're hired.
>>
>>106784411
G/G
G/G
G/S
2 G's and an S.

It might help to imagine if there are a thousand gold balls, and 500 silver balls. You pull out a gold ball, and there's a chance that the next one you pull out will be silver. The original odds are greater that you pulled a gold because you didn't get a silver. And uh... That would be cool wouldn't it? Wouldn't it be cool to get some gold for free? And who cares if your pull a silver next, silver is still fucking cool.
I rest my case.
>>
>>106784836
I'm going to do it with real boxes, aluminum foil balls, blindfolds, and a lazy Susan.
I will.
>>
>>106784501
Think of it this way, anon:

>box 1 has 100000 gold balls
>box 2 has 99999 silver balls and 1 gold ball
>box 3 has 100000 silver balls
You pick a ball from a box, and it's gold. Which box did it most likely come from?

It's basically the same problem but at a different scale
>>
>>106785741
NTA, but it's just deliberately written in a manner susceptible of misinterpretation, which is 'the joke'
it's possible to rewrite the prompt to remove any ambiguity, but doing so makes answering it trivial
end of story, this stupid shit has been done to death
>>
it's either silver or gold

therefore it's 50/50
>>
>>106784683
You're getting at something. The problem is formulated in a way
>you pick a box at random
>it's a gold ball
as if the probability of choosing the box is to be ignored. You are standing either before box 1 or 2, that makes it 50/50.
>>
>>106784493
>>106784508
The code cannot be a proof LMAO you retards
>>
File: 1752169532776998.png (359 KB, 880x744)
359 KB
359 KB PNG
>>106784288
>>106784785
Fine, time to stop holding back HHHHAAAAAAAAAAAAAAAAGH
>only two boxes are relevant: with G1G2 and G3S1
>you pick a golden ball
>three outcomes: it can be G1, G2 or G3
>you pick a second ball
>it can only be G2, G1 or S1, respectively
>3 outcomes, 2 are GG
It is 2/3
>>106784876
Based. Luv me Bayes.
>>
>>106784288
50/50 if you do it exactly as it's worded, the original problem is a scam
RUNS = 10_000
total, result = 0, 0
boxes = ((1, 1), (1, 0), (0, 0))
for _ in range(RUNS):
box = random.choice(boxes)
if box[0] == 1:
total += 1
result += box[1]
print(result / total)
>>
File: 1759568873290.png (168 KB, 383x361)
168 KB
168 KB PNG
>>106786858
>>
>>106784288
so easy. whats the odds here, basic division that you got the box with 2 gold balls in it.
33.333 repeating. or 1/3 for american standard
>>
>>106786947
ok wait. after reading the answers. 2 answers. your dumb or you're a troll/idiot. meaning you are still dumb.

the question reads you get a gold ball out of the 1 of 3 boxes you picked. reaching back into the SAME box, what chance have you got of getting a gold ball?

Since you can take the first .. wait i fucked up. lol

since you can take the first choice out of the equation, since its you got a gold ball, now whats the chances the balls going to be gold when you pick, it is not going to be including the all silver colored ball box. just the 2 with 1 gold ball in it. that makes it 50% . let me go read the damn question again.

Yea,
>next ball from teh same box (which already pulled a gold one, is going to be gold

so only 2 have any gold balls in them. so after your first choice, only 50% of the boxes with those in it will be left. 1 has 2 gold, 1 only has one.
>>
File: 1750319009395311.jpg (3.75 MB, 4032x3024)
3.75 MB
3.75 MB JPG
Have you retards never heard of tree diagrams?
>>
>>106784433
After you already picked a ball:
>If you picked from the left box, the next ball you pick is guaranteed to be gold
>If you picked from the middle box, next is guaranteed to be silver
So the odds are 50/50
To give another example, when you flip a coin, the most likely scenario is that one flip is going to be heads and the other tails. However, if you flipped the coin already once and you get lets say heads, the next coin flip is not more likely to be tails than it is to be heads

>>106787158
Here, since you already know the result of the first pick, you are not starting from the beginning of the tree, since the third branch is guaranteed not to happen
>>
>>106787236
>you are not starting from the beginning of the tree
Which is why I divided by 1/2. Learn how conditional probability works.
>>
>>106784433
>>106784493
>>106784501
it's 50%
the situation you're in can be restated as:
>you have a box before you
>you just drew a golden ball from it
>what are the chances that the box contains another golden ball?
from the fact that you drew gold, you know that you can disregard the possibility that the box initially contained two silvers
the only two possibilities left are that the box either has another golden ball, or a silver ball
therefore, the chance is 50%

the fact that you could have arrived at this situation in three ways (counting the double golden box twice) doesn't matter
you're already in the universe where you picked gold, the likelihood of reaching that point doesn't matter
the scripts (lol, by the way) miss that part by "starting" at the beginning instead of at the moment the problem asks you to consider
>>
ITT
>50% :|
>66% :O (cuz muh ai said so)

there is no hope for the future, zoomers don't use logic at all
>>
>>106787331
Actually, it can be restated as:
>You have a bag with four balls
>Three are gold and one is silver
>You just drew a gold ball
>What is the probability that the next one you draw is also a gold ball?
>>
>>106787353
you idiots don't think like normal human beings anymore. Like nigga if you already took one ball out of one box why the fuck would you draw another from the same box? (thus making it 66% for no reason)
>>
>>106787353
please be joking
that's not equivalent at all
>>
>>106787366
Yes it is
>The first ball you drew was gold
>Meaning the box was either the one containing two gold balls (now one) or one gold and one silver (now one silver)
Because you don't know which box it was, you may as well combine both boxes into one and consider all the balls together
>>106787363
There is a 66% chance you are black
>>
>>106784501
The question is really asking what is the probability that you initially selected a box with 2 of the same color, which is obviously a 2/3s chance.
>>
i think its actually 1/3 you did all the math but did not realize that the question still basically is what is the probability of picking the gold gold box , the statement says, you pick the ball and its gold, so its already gold right , so then it says what is the probablity of the next ball being gold which effectively traslates to what is the probability of picking the gold-gold box
>>
>>106784919
Are you more likely to have pulled a gold ball from a box with all gold or the box with 1 gold?
>>
>>106787397
actually is 1/2 since at that point the silver silver is already discarded
>>
>>106787397
it assumes you are a retard and would pick from the same box twice. Since it's not stated what is more desirable it essentially could be either and they can tell you to fuck off if they don't like your face instead
>>
>>106784393
Question is worded in retarded way. Bit midwits that dont think but just apply patterns will remeber bayesian probability they did in college and just apply it without thinking.

Just saying
>if its a gold ball
instead of
>Its a gold ball.
Would make it clear.
>>
>>106784933
You chose random. But someome made sure its not random is only way that statment makes any sense.

So efectively your choice doesnt gp in to calculation.
>>
How is this discussion still going? I just proved here >>106787158 that it's 2/3, without using AI or some botched script using pseudo-random number generation. The people saying it's 1/2 are forgetting that the question clearly states that you're taking the second ball from THE SAME BOX. The only way it could be 1/2 is if you were to draw a gold ball from a box, somehow telepathically determine which box contains two silver balls and discard it, and then forget everything you did in the last five minutes and choose a random box out of the two remaining ones. Here's an interesting puzzle:
>You draw a ball from one of the boxes at random
>It's golden (this is a given)
>You discard one of the other two boxes at random
>What is the probability that the box you didn't discard contains any number of golden balls?
>>
>>106787586
you just explained how it's still 50%
>>
Take a look at it this way:
1. You start with three gold balls and three silver balls. Here you can ignore the boxes because you don't know which is which, so they may as well be together in one box for now. Therefore, the probability of picking either coloured ball is 1/2.
2. You pick a gold ball. This means that the box you just picked from was either the box containing two gold balls or one gold and one silver ball, but definitely not the box containing two silver balls, effectively reducing the "pool" of balls from three silver and three gold to one silver and three gold.
3. You just picked a gold ball, which means there are now one silver and two gold balls left in this pool. Again, you don't know which box is which, so you may as well consider both boxes together.
4. Now that there are two gold balls and one silver ball, the probability that the next ball you pick is 2/3.
>>
>>106784288
Both balls will be taken from the same box
Because we drew gold, we know that it can't be box #3, only #1 or #2
If it's box #1, the ball drawn will always be gold, if it's #2 the ball drawn will always be silver (note that there is no mention of the ball being placed back in the box after being drawn)
So we can reduce the problem to "are we drawing from box #1 or box #2" - the odds are 50%
>>
>>106784783
So.. they're part of the solution - you mean?
>>
>>106787661
That would work if you could do the respective picks from different boxes. However the problem implies that both picks will be from the same box. So at step 3 we're not working with a pool of three balls, but only one, its color depending on the box we picked beforehand
>>
>>106787586
>the question clearly states that you're taking the second ball from THE SAME BOX. The only way it could be 1/2 is if you were to draw a gold ball from a box, somehow telepathically determine which box contains two silver balls and discard it
The box is effectively pre-discarded for us. The problem description states that we've already drawn a gold ball, therefore the box with two silver balls was never really at play. It serves no role in the problem except to confuse you
>>
>>106784493
>box = {unpack(box)}
>local ball = table.remove(box, math.random(2))
..what the fuck is this shit mang jesus
whats the runtime on this thing a couple of days or what
>>
>>106785741
this is the only explanation that makes sense
everyone else is just trolling or retarded
whenever you come across a problem and you don't know what the answer is, just blow up the proportions to huge numbers and the solution will become unambiguous
>>
>>106784733
>>106787989
it's lua, you retarde
>>
>>106787353
you don't have a bag with four balls because you're picking out of the SAME box you only have a bag with TWO balls (or ONE now that you've taken a gold ball out!)
>>
>>106788217
>!
Ok you're trolling. I should've guessed when you kept choosing to ignore my explanations but now I know for certain.
>>
>>106784288
50%
Since I have a gold ball, it's definitely not the two silver box.
I have 2 boxes, one contains one gold, one contains one silver ball.
>>
>>106784410
>>106784556
>>106784677
>>106784919
>>106785816
>>106787331
>>106787351
>>106787651
>>106787890
>>106788312
>50%

Consider a similar problem. You have two dice, one is a trick die that only rolls 6s, the other is a regular fair die that rolls a 6 one in 6 times.
You pick a die at random and roll it. It's 6. What are the odds that you will roll another 6 with the same die?
Now let's say you roll it 9 more times, all 6s. What are the odds that you will roll a 6 again on the next attempt, knowing that you just rolled 6s 10 times in a row with it?
>>
>>106788399
Unbeknownst to you, before you were brought to this puzzle, I rolled the fair dice six times in a row and got a 6 each time. You roll the die and it's a six. Are your odds still the same as if I hadn't rolled it before you?
>>
>>106788540
>Unbeknownst to you
So I'm going to ignore everything that follows, since I'm not supposed to know it.

>You roll the die and it's a six. Are your odds still the same as if I hadn't rolled it before you?
Yeah.
>>
>>106788589
So your odds of getting a six are always the same, regardless of how many times it has been thrown. So long as you're throwing a six every time it is therefore impossible to tell if the die is rigged, if you've just got a really consistent throwing arm or if you've just got lucky.
The proper way to check if a die is rigged would be multiple physically very different rolls. Throw it once with right and once with your left, if it's a six both times then it's the rigged one.
>>
>>106784444
based 4 4s
>>
>>106786730
Poof as in evidence, not formal mathematical proof. Basic English skill kek
>>
Baby's first conditional probability. They literally teach you this on first year of CS.
>>
>>106786858
>if box[0] == 1:
You have to choose from the box randomly nigga, not choose the first element. By simply changing box[0] to random.choice(box) (which is how the question is worded) and then checking if the other box is also gold, the output becomes 66%

RUNS = 10000
total, result = 0, 0
boxes = ((1, 1), (1, 0), (0, 0))
for _ in range(RUNS):
box = random.choice(boxes)
if random.choice(box) == 1:
total += 1
if not 0 in box:
result += 1
print(result / total)
>>
>>106788838
If you do it through random.choice, it's as though you put the ball back in before reaching in a second time (because in a gold/silver box, you could feasibly pull gold twice in a row)
As the problem does not explicitly mention this being the case, it's not. The removed ball stays removed
>>
>>106787989
>nooooo you have to optimize the throwaway meme test instead of writing it in a comprehensible way >:(
>>
>>106788886
You're stupid, read the code again, random.choice is only called once for the first draw. The second draw is abstracted by checking if both balls in the box are gold (as that's the only case where the second draw will also be gold)
>>
>>106788886
Picking a box:
>box = random.choice(boxes)
If first draw is gold:
>if random.choice(box) == 1
Tally success only if both balls in that box are gold:
> if not 0 in box:
> result += 1
>>
>>106788886
Also free free to rewrite the code your own way as long as the first draw is random (rather than box[0] which is what you originally wrote) and it will always say 66%
>>
>>106788918
>>106788936
Fair enough, I didn't properly read the code
>>106788951
NTA
>>
File: 1759591061079930.jpg (56 KB, 784x784)
56 KB
56 KB JPG
>>106784288
The golden ball is the boy's mother.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.