Lol, thats confusing.

This is a discussion on *Something about probablility* within the **A Brief History of Cprogramming.com** forums, part of the Community Boards category; Lol, thats confusing....

- 03-09-2008 #91

- 03-09-2008 #92Actually - It could...

Now I take a card from the stack and open it - suppose - it is a King

In this case, the first choice does not matter, which is what Mario F. meant, and which I misinterpreted and thus misstated.

EDIT:

Because we are talking here about 2 different probability spaces - one is unconditional space P(.), second is conditional space p(.|C) where C is the known event that the door opened by host does not contain price... so probabilities in these two spaces can be different...Last edited by laserlight; 03-09-2008 at 09:21 AM.

Originally Posted by**Bjarne Stroustrup (2000-10-14)**

- 03-09-2008 #93
Still 1/13th. You drew the second card from the reduced pool of 63 cards with possibly only 3 kings. The math is ugly, but I think it would still come out right.

All the buzzt!

CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."

- Flon's Law

- 03-09-2008 #94Still 1/13th. You drew the second card from the reduced pool of 63 cards with possibly only 3 kings. The math is ugly, but I think it would still come out right.

It may be easier to simplify the problem to 4 cards: 2 red, 2 black. I pick one of the cards, vart picks another at random, and it turns out to be a red card. Then we compute the probability of my card being red.Originally Posted by**Bjarne Stroustrup (2000-10-14)**

- 03-09-2008 #95
No.

I do not ask what is the probability for me to draw a King. I said - I**have DRAWEN**a King.

Now A - is event that You have drawen a King

B - is event I have drawn a King

I ask about P(A|B)

P(A) = 4/52

p(B) = 4/52

P(B|A) = 3/51

P(AB) = P(A)P(B|A) = P(B)P(A|B) (= 4/52 * 3/51)

So P(A|B) == P(B|A) == 3/51To be or not to be == true

- 03-09-2008 #96

- Join Date
- Mar 2008
- Location
- vancouver bc
- Posts
- 28

so the general rule is, if the game host opens a bad door, we switch; otherwise we stay?

i heard the best way to tackle the original problem is to imagine there are 1000 doors. The host opens 998 doors for the players, and ask the player whether to change door. the player will instantly grab the new door because the odds of the player being right in the first place is far less than the odds after he switch. kind of circular, but i can see why now.

kind of curious what the smart dude would think of this?

--TING

- 03-09-2008 #97

- Join Date
- Jan 2005
- Posts
- 7,348

>> so the general rule is, if the game host opens a bad door, we switch; otherwise we stay?

In the original scenario, the host always opens a bad door (and you always switch). In other scenarios, I was thinking it depends on the ratios, but maybe not. This all assumes the host purposefully opens a particular door.

>> i heard the best way to tackle the original problem is to imagine there are 1000 doors.

I almost posted that thought (or maybe I did). It is a common way to think about the problem in another way.

- 03-09-2008 #98
Vart, you don't ask really about P(A|B). You ask simply for P(A):

Now, what is the probability, that the card that you have choosen before, but haven't open yet is a King?

P(A|B), the probability that I draw a king under the assumption that you have drawn a king, is only relevant if I draw*after*you did.

It's a case of the maths being too abstract for the real-world case you describe.

Although I have to admit I'm not quite comfortable with my line of thinking. I might be proven wrong yet.

Still trying to extend the scenario ... for example, you follow my draw by drawing four cards, and they're all kings. Now obviously the probability that I have a king is zero. Which disproves my line of thought and proves yours. But that's under the assumption that I haven't drawn a king in the first place, because if I have, you*cannot*draw four kings. So it might be said that claiming to have drawn four kings would be invalid.Last edited by CornedBee; 03-09-2008 at 01:40 PM.

All the buzzt!

CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."

- Flon's Law

- 03-09-2008 #99

- 03-09-2008 #100What in the conditional probability makes you believe that the order of event is important?

The formula I have shown you has no indication of order of events... And it works both ways equallyAll the buzzt!

CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."

- Flon's Law

- 03-09-2008 #101

- Join Date
- Jan 2005
- Posts
- 7,348

The question is, after you know that the other person has drawn a king, what are the odds that your card is a king also. At that point, there are 51 unknown cards, 3 of which are kings, so the answer is 3/51.

- 03-09-2008 #102So it might be said that claiming to have drawn four kings would be invalid.

Obviously - if I had shown you 4 kings - you HAVEN't drawn one...To be or not to be == true

- 03-10-2008 #103
Think of it this way. Draw a first card, don't look at it. Then draw a second card and look at it. If it turns out to be the ace of spades, I'm sure you agree that the probability of the first card being the ace of spades is 0.

EDIT:I guess the same reasoning was posted before me...*Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason:**Time travelling*

- 03-10-2008 #104
Here's another (harder) switching problem:

Suppose instead there are two doors both having a sum of money behind them. One of the doors contain twice the amount as the other one. Suppose you choose one door, open it and the sum of the money behind it is X. Now you're given an option to switch to the other door. Should you do it?

If the door you switch to is higher, you gain X. If you switch to a lower door, you lose 0.5X. Therefore you gain 0.5X on average by always switching.

Where's the problem?*Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason:**Time travelling*

- 03-10-2008 #105

- Join Date
- Aug 2001
- Location
- near a computer
- Posts
- 3,871

@Sang-drax: A variation of Pascal's Wager, except of course he had a big flaw in his calcs.

Bit late but.........

Tell his guy he should bet WITH the run, not against it.

This is because the run (of the same colour) can continue (theoretically) forever. The run can end only once (and he has to pick that one spin).

'Back your luck' is the saying.

I used to deal AR at a casino.

The spin is varied by;

training the dealer putting different amount of force when flicking the ball,

spinning the wheel opposite directions,

and spinning with different hands.

The AR wheel is divided into three sections, Voisins du Zero, Tiers and Orphelins.

Many punters are looking to see if the spins (or the alternating spins) hit the same section, and then have a pattern bet on that section (ie a call bet on the 'Orphans' one spin, then the Neighbours' the next).

Dealers who hit the same area of the wheel (each or alternating spins) are called 'section spinners' and are quickly removed by the casino.

Card counting on BJ is your best method of pushing the odds into your favour, but auto shufflers have stopped that here (dealer's card here is visable)."Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."

Friedrich Nietzsche

"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."

George Best

"If you are going through hell....keep going."

Winston Churchill

- Exactly how to get started with C++ (or C) today
- C Tutorial
- C++ Tutorial
- 5 ways you can learn to program faster
- The 5 Most Common Problems New Programmers Face
- How to set up a compiler
- 8 Common programming Mistakes
- What is C++11?
- Creating a game, from start to finish

- How to create a shared library on Linux with GCC - December 30, 2011
- Enum classes and nullptr in C++11 - November 27, 2011
- Learn about The Hash Table - November 20, 2011
- Rvalue References and Move Semantics in C++11 - November 13, 2011
- C and C++ for Java Programmers - November 5, 2011
- A Gentle Introduction to C++ IO Streams - October 10, 2011