• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Simple challenge: Monty Hall

 
Master Rancher
Posts: 4661
63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that's equivalent to

(Correcting an off-by-one error.)

[Edited to change "(long)" to "(int)"  - Mike]
 
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:I think that's equivalent to

(Correcting an off-by-one error.)


Very nice!

I was playing around with BitSet earlier today for a different problem and I guess it was stuck in my head. Even when you think you've got it pretty simple, somebody comes along and shows you an even simpler way. Thanks!  
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So here's the simplest/clearest solution we've come up with:

De-factoring by manually doing the inlining that an optimizing compiler would most likely do for you:

Comparing the two, I'd probably choose to go with the clearer version rather than the shorter.
 
Marshal
Posts: 8831
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:solution we've come up with


I must say a solution is very very different from what I envisioned before we started coding
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm always imagining a conversation in my head when I'm programming solo, maybe to simulate the experience I'd have if I were programming in a pair or ensemble. My imagination is obviously limited though so I'll pop out to the internet and find other alternative solutions. Then I'll take those solutions and imagine a conversation around them.

I guess I just miss the experience of collaborative programming. My next gig that's about to start should be a good one though because I'm being brought on to coach teams in adopting XP.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what I had before I started refactoring:

These are my notes on how I got lines 40 and 41:

0* 1  2
0  1* 2
0  1  2*

The starred number is the picked door, figure out the other doors

pick(pick + 1) % 3(pick + 2) % 3
012
120
201

 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Speaking of imagined discussions, I was just wondering what the discussion might be around the picksTheCar() method:

Is that a head-scratcher / eyebrow-scruncher? Would a comment like this help?

I believe in the general rule that comments are an indication of code that isn't as clear as it could be but I think the comment could be helpful. What do you think? A good exception to the rule?
 
Saloon Keeper
Posts: 15276
350
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then why not just write the following?

I really don't think there are ever any valid reason to write comments that explain what you are doing, only ever why you are doing things.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Stephan.

When I first started reading the Refactoring book, I noticed there were a few seemingly contradictory refactorings. For example,
Introduce Explaining Variable vs. Inline Temporary Variable

This was a little confusing to me as a newbie to refactoring because I didn't have a good grasp of the contexts in which each was appropriately applied. In this case, pick and car would be explaining variables, which is what I had originally.

But then, each of those variables are only used one time. Also, the method name already says the intent is to see if they picked the car. So applying Inline Variable refactoring:

But then maybe this is too cryptic for someone new to the code or maybe to myself if I come back to it in the future.

So now, rather than revert to the explaining variables, I add a comment to see if I feel better about that.

For some reason, I feel better with the comment than I do with the explaining variable, which is pretty conflicting given that, like you, I also think comments that explain what you're doing should be avoided.
 
Stephan van Hulst
Saloon Keeper
Posts: 15276
350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that over time, comments have the habit of going out of sync with the code. Using explaining variables will not.
 
Liutauras Vilda
Marshal
Posts: 8831
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:So here's the simplest/clearest solution we've come up with
https://coderanch.com/t/40/754647/Simple-challenge-Monty-Hall#3502756


To be brutally honest, to me it isn't a most simplest or clearest solution. You have to be quite intelligent to find it simplest or clearest.
 
Marshal
Posts: 78698
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would need comments to explain it
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:

Junilu Lacar wrote:So here's the simplest/clearest solution we've come up with
https://coderanch.com/t/40/754647/Simple-challenge-Monty-Hall#3502756


To be brutally honest, to me it isn't a most simplest or clearest solution. You have to be quite intelligent to find it simplest or clearest.



Campbell Ritchie wrote:It would need comments to explain it



Fair enough. I was reading it again (for the 30th time probably) thinking what someone new to the code might experience as they read through the code and I can certainly see how they'd need some kind of explanation of what the thought process is behind the logic. This is probably where the kind of comment Stephan mentioned, explaining why something was done in a certain way, is warranted.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:The problem is that over time, comments have the habit of going out of sync with the code. Using explaining variables will not.


I general, I would agree with you. However, this is one line of code with one comment. The likelihood that the comment and the code will diverge, at least in my mind, is very low.
 
Stephan van Hulst
Saloon Keeper
Posts: 15276
350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The alternative is no chance of divergence.
 
Campbell Ritchie
Marshal
Posts: 78698
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:. . . the kind of comment Stephan mentioned . . . is warranted.

Agree. You can have a few other comments warranted by the circumstances, too.You can change the first example to use only one comment. The second example works a lot better if you actually have three things already counted And of course nobody should forget their /** Documentation Comments */
[edit]Just in case anybody can't read the green text, it says, “/** Documentation Comments */”.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:The alternative is no chance of divergence.


True that.

I just did a Community of Practice mobbing session with some other coaches and brought up the same question. The explaining variables ended up being the preference in that discussion as well.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:And of course nobody should forget their /** Documentation Comments */


Agree.

(Don't use color though, people might have a hard time seeing color ) <just kidding>  
 
Mike Simmons
Master Rancher
Posts: 4661
63
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I'm still of the opinion that in order to convince skeptics of the validity of the results, the simulation needs to actually simulate all the parts of the problem, not just simplify the unimportant parts out of existence.  Otherwise we can reduce it to a random number simulator for already-known probabilities:


Output:


But that's unlikely to convince anyone who isn't already on board.  In contrast, here's my improved version for a simulation detailing each part of the process, with additional info on how likely each chain of events is:


Output:
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:
Well, I'm still of the opinion that in order to convince skeptics of the validity of the results, the simulation needs to actually simulate all the parts of the problem, not just simplify the unimportant parts out of existence.  Otherwise we can reduce it to a random number simulator for already-known probabilities:


But isn't that line saying something very different from this one?

(Re the forum rendering bug: a ">" in a code block will throw its parsing logic for a loop. You can turn off HTML to skirt around the bug)

In your incantation, there's only one random pick and it's always compared to either 1 or 2, which already predetermines the outcome.

By contrast, pickedTheCar() compares two random choices: the door the contestant chooses and the door the car is behind. So whether you win or lose by staying still depends on whether or not the door you picked is the same door as where the car was randomly placed.

In a session I had with some colleagues this morning, they first predicted that they'd win more often if they stayed with their original pick. We did it manually, with me pre-selecting a number for where the car would be then them picking a number. I'd then tell them which of the other numbers didn't represent the car and they got to choose whether they stayed or switched. What was funny was that the first few times, they were lucky enough to win either way they tried. But they still weren't sure about the probabilities and I didn't tell them what they were. I suggested we write a program to simulate what we just did manually and see empirically what the probabilities were. We wrote basically the same program together, every step having a conversation about what each statement meant.

By the end, after they saw the results, they agreed that it was more favorable to switch. I think being involved in coming up with the logic for the simulation helped convince them that the results were legitimate.

Next time, I'll try the same exercise with a different group of colleagues and maybe do 10 or more manual runs with them. Once they understand the mechanics, I'll try to get them to write the simulation program and work through the logic. I'll let you guys know how that goes. Should be in a couple of weeks or so.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I remember correctly (this morning was such a loooong time ago   ) we started out by just summing up the times they stayed and picked the same door as where the car was.

Then we discussed how to represent the idea of winning by switching to the other door instead. We ended up with the same code:

I'll admit that the discussion might have been biased with my input so next time I'll try to stay quiet while others work through the logic.
 
Mike Simmons
Master Rancher
Posts: 4661
63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:(Re the forum rendering bug: a ">" in a code block will throw its parsing logic for a loop. You can turn off HTML to skirt around the bug)


Ah, thanks - I've taken advantage of that now.
 
Mike Simmons
Master Rancher
Posts: 4661
63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:But isn't that line saying something very different from this one?


Well, I'd make that

But more to your point...

Junilu Lacar wrote:In your incantation, there's only one random pick and it's always compared to either 1 or 2, which already predetermines the outcome.


Sure.  Because the rules have already predetermined that the chance of winning is either 2/3 or 1/3, depending on whether you switch or not.  I've just jumped a little farther ahead to the answer.  But then again, yours has also simplified the process, eliminating the parts that didn't actually matter that much.  To be honest, if you're working with someone who has agreed that your pickedTheCar() implementation will completely correlate with winning (if you don't switch) or losing (if you do switch)... then I don't know why they need the simulation at all.  Obviously pickedTheCar() will be true 1/3 of the time.

To be clear, I completely agree with your logic.  I just don't know how obstinate the doubters will be.  People can get really stuck on their 50/50 interpretation, and convinced that you are then changing the problem when you try to simplify it.  So I like providing a solution that fully enumerates all the 12 permutations of events that can occur if you don't switch, and the 12 different permutations that occur if you do switch, and shows how they add up to a 1/3 chance of winning by not switching, and a 2/3 chance of winning by switching.  Whether or not that is more convincing, may depend on the persons who need to be convinced.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:
Well, I'd make that


Yeah, I tried exactly that but count() returns a long which then has to be downcast to an int.  Otherwise, the receiving variable needs to be declared as a long. Also, I saw that the documentation said that count() is a special case of the reduction mapToLong(e -> 1L).sum() so I took the path of least resistance (for me) and went with map().sum(). I do like the semantics of filter().count() though.

Kotlin makes it so much nicer though:
 
Bartender
Posts: 5466
212
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without loss of generality, you may assume that the contestant always chooses the first door. Simplifies things. Coming up with beautifully refactored code for such a trivial problem is easy enough. But what if the contestant has no clue whether to switch or not, and decides to flip a coin? Would that not be a muchmore interesting simulation? And those of us saying it is fifty-fifty wouldn't be far off...
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mike Simmons wrote:if you're working with someone who has agreed that your pickedTheCar() implementation will completely correlate with winning (if you don't switch) or losing (if you do switch)... then I don't know why they need the simulation at all.

To be clear, I completely agree with your logic.


How you phrased it isn't the logic expressed in the code though, if I understand what you're saying correctly.

The conditional statement "if by chance you happened to pick the car" is still random.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Piet Souris wrote:Without loss of generality, you may assume that the contestant always chooses the first door. Simplifies things. Coming up with beautifully refactored code for such a trivial problem is easy enough. But what if the contestant has no clue whether to switch or not, and decides to flip a coin? Would that not be a muchmore interesting simulation? And those of us saying it is fifty-fifty wouldn't be far off...


You're right, the empirical evidence does hover around 50% even when the contestant's pick is still random. This is how I interpreted your scenario.

Monty Hall problem (1,000,000 runs)
wins: 499,506
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Piet Souris wrote:Would that not be a muchmore interesting simulation? And those of us saying it is fifty-fifty wouldn't be far off...


I don't know if it's a more interesting simulation but it certainly gives different results, as I've shown empirically. The two scenarios are different though, statistically speaking. The former has 2/3 probability of winning if you follow the strategy of always switching your choice to the other door. When the contestant flips a coin to decide whether or not to switch, the coin flip itself changes the equation to a 50-50 chance of winning the car.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But wait a minute...

I ran another set of experiments with this code:

And the results were consistently around these numbers:

   Monty Hall problem playing with ALWAYS_STAY strategy
   wins : 333,379
   times: 1,000,000
   prob : 33.34

   Monty Hall problem playing with ALWAYS_SWITCH strategy
   wins : 666,990
   times: 1,000,000
   prob : 66.70

   Monty Hall problem playing with RANDOMLY_SWITCH strategy
   wins : 334,309
   times: 1,000,000
   prob : 33.43

   Monty Hall problem playing with RANDOMLY_STAY strategy
   wins : 167,196
   times: 1,000,000
   prob : 16.72

I need to look at my implementation that gives a 50-50 chance of winning if you randomly decide to switch or stay and why that was producing different results.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:
You're right, the empirical evidence does hover around 50% even when the contestant's pick is still random. This is how I interpreted your scenario.


Probably not a correct interpretation, given new data.
 
Mike Simmons
Master Rancher
Posts: 4661
63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:How you phrased it isn't the logic expressed in the code though, if I understand what you're saying correctly.


Well, I think it is, but I think we're in dead horse territory.  We can keep rephrasing a lot of different ways.  We agree on the probabilistic outcome, with a chance of either 1/3 or 2/3.

Junilu Lacar wrote:The conditional statement "if by chance you happened to pick the car" is still random.


Yes.  And you can generate that random outcome with one call to nextInt() (my simplest code), or two calls (your code), or several more calls (my fuller simulation code).  All have the same results, statistically.  Which of those you use may depend on who you're trying to convince, and where they may be stuck.
 
Liutauras Vilda
Marshal
Posts: 8831
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:I need to look at my implementation that gives a 50-50 chance of winning if you randomly decide to switch or stay and why that was producing different results.


Not sure I interpret you correctly, but there (where 50-50) you summed up wins, of stayed + switched. While in most recent simulation you treat those wins individually, which makes sense ~33 and ~16, because in those cases where let's say you chose GOAT initially, then randomly decide to switch or stay, so it halves the initial chance of 2/3.
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I added this strategy:

and ran the simulation. Same results as before:

Monty Hall problem playing with HEADS_SWITCH_TAILS_STAY strategy
   wins : 499,960
   times: 1,000,000
   prob : 50.00

I think the code is right. Anybody see why it would be wrong?
 
Piet Souris
Bartender
Posts: 5466
212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a slight statistical digression, if you folks allow me:

let the random variable X denote the chance of winning a car, and r.v. P denote the chance of switching. Then a well-known theorem says:

Now, given some value of P, p, we get:

and so,

Therefore, if we always switch, we have that E[P] = 1, and if we never switch, E[P] = 0. And if P denotes the flipping of a coin, then E[P] = .5.

Earlier, I suggested that P has a cumulative density function of sqrt(x). Simulating from such a stochast means that you let

To determine E[P], you can either simulate, or use E[P] = integral from 0 to 1 (1 - sqrt(x)) dx. Outcome: 1/3.

Note: I remember Carey Brown once asking how he could get random values that were more close towards 0 than the usual uniform distribution would give. This is an example of such a distribution.
 
Piet Souris
Bartender
Posts: 5466
212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:
I think the code is right. Anybody see why it would be wrong?


The outcome is correct!
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just playing around now. I wrote this full simulation with (almost?) all the machinations of the game:

Not that I doubt the bare bones strategy code because if you analyze this version, it can be reduced to the simplified one that ignores the non-essential elements. This still gives a 50% probability of winning just as the simplified one does.
 
Liutauras Vilda
Marshal
Posts: 8831
631
Mac OS X VI Editor BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Piet, that's very complicated what you said, so I don't understand a lot, but, is my reasoning correct (in simple words speaking)?

We know that:
By staying with an original pick the chance of winning is 33.3% roughly.
By switching from an original pick the chance of winning is 66.6% roughly.

Now, given we know the proportions of wins by staying and switching, each of those proportions get halved by flipping a coin, because in half of the meant to win cases by staying we'd force to switch, hence loose, and the same with switch proportion, in half of those we'd force to stay instead.

Now the sum of wins from stay and switch is what adds up to a sum which is proportionally a 50% of wins.

Where ~16.6% wins derived from staying and ~33.3% from switching.
 
Piet Souris
Bartender
Posts: 5466
212
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct!
 
Junilu Lacar
Sheriff
Posts: 17633
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what's interesting is that simply knowing and following a strategy can change the probability of winning. For all intents and purposes, however, since contestants only play one game  and they're done, there seems to be no practical difference between 50% chances and 66.67% chance of winning. It's only if the contestants were to play the game multiple times that it would really matter. It matters more to the people who supply the prize because it would be to their advantage for contestants to consistently choose to stay.
 
Piet Souris
Bartender
Posts: 5466
212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations, Junilu!

Your topic got a mentioning in the October 2022 Journal, and so you earn a cow.
 
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic