• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

Statistics Question

Status
Not open for further replies.

crispy1978

Member
Joined
4 Feb 2013
Messages
1,037
Location
Scarborough
Absolutely nothing to do with trains, actually a study one of my friends needs help with.

Basically, imagine two sets of cards - each numbered 1 to 9, so 18 cards in total laid in a 3x6 grid - assumed at complete random

It's a 'match the pairs' game. So you pick a card at random, then pick another - aiming for a pair. If they match, they come out of the game. If they don't, they go back - but you are allowed to record them.

The exercise is to calculate the probability of how many incorrect turns from zero up to whatever the maximum is (guessing nine). Having roadtested it on paper, I've had 4, 5 and 6 incorrect guesses, but mostly 5.

Anyone with a good stats background able to point me in the right direction? Been nearly 20 years since I've done this, so I'm a bit rusty on it!

Thanks in advance.
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

DynamicSpirit

Established Member
Joined
12 Apr 2012
Messages
8,998
Location
SE London
Absolutely nothing to do with trains, actually a study one of my friends needs help with.

Basically, imagine two sets of cards - each numbered 1 to 9, so 18 cards in total laid in a 3x6 grid - assumed at complete random

It's a 'match the pairs' game. So you pick a card at random, then pick another - aiming for a pair. If they match, they come out of the game. If they don't, they go back - but you are allowed to record them.

The exercise is to calculate the probability of how many incorrect turns from zero up to whatever the maximum is (guessing nine). Having roadtested it on paper, I've had 4, 5 and 6 incorrect guesses, but mostly 5.

Anyone with a good stats background able to point me in the right direction? Been nearly 20 years since I've done this, so I'm a bit rusty on it!

Thanks in advance.

Not sure I fully understand the scenario or what you're asking. Are you saying that you stop playing as soon as you have a match, or that you play a certain number of turns, irrespective of how many matches you get.

If this is of any help: When you pick up a card, there are 17 cards left, only one of which will be a match to the one you picked up. So I think that on any one turn, probability of match = 1/17, probability of no match = 16/17.

Therefore:
Probability of match on first attempt = 1/17
Probability of one fail before you get a match = (16/17) * (1/17)
Probability of two fails before you get a match = (16/17)^2 * (1/17)
Probability of three fails before you get a match = (16/17)^3 * (1/17)
And so on.

(That's assuming you don't remember what the cards that didn't match were, so the fact that you saw them doesn't influence which cards you pick up on the next time - it's still random. In that scenario, there's no limit to how many times you might fail. If you do remember what the cards were and start deliberately choosing ones you think will give a match - then the problem becomes very hard, and offhand I can't think how you would solve it)

As soon as you have a match and remove cards, then the probabilities for further attempts will change.
 
Last edited:

me123

Established Member
Joined
9 Jul 2007
Messages
8,510
It's not a simple problem. As Dynamic Spirit has pointed out, once you turn the card you know what it is. So if you turn over its partner you will get it right 100% of the time (assuming perfect memory).

I may give this a go when I get home. But can I clarify are all the cards in one pool, or are there two separate groups of 1-9?

PS - this is probability not stats ;)
 
Last edited:

crispy1978

Member
Joined
4 Feb 2013
Messages
1,037
Location
Scarborough
You need to complete each grid, and basically record the number of incorrect guesses - and it is the probabilty of 0-9 incorrect guesses we're interested in.

For example, say your grid was:

112233
445566
778899



Say you draw from top left and move from left to right, you would go:

Pick 1: 11 (match)
Pick 2: 22 (match)
Pick 3: 33 (match)
Pick 4: 44 (match)
Pick 5: 55 (match)
Pick 6: 66 (match)
Pick 7: 77 (match)
Pick 8: 88 (match)
Pick 9: 99 (match)

So that would be 0 incorrect matches.

Say your next grid was:

693524
788614
912573


Pick 1: 69 (incorrect)
Pick 2: 35 (incorrect)
Pick 3: 24 (incorrect)
Pick 4: 78 (incorrect)
Pick 5: 88 (correct)
Pick 6: 66 (correct)
Pick 7: 14 (incorrect)
Pick 8: 44 (correct)
Pick 9: 99 (correct)
Pick 10: 11 (correct)
Pick 11: 22 (correct)
Pick 12: 55 (correct)
Pick 13: 77 (correct)
Pick 14: 33 (correct)

So that would be 5 incorrect guesses.

I'm basically looking for the probability of number of incorrect guesses from 0 through 9. I've roadtested this on paper, and had 4 (11%), 5 (63%) and 6 (26%) come up.

I hope that clarifies things.
--- old post above --- --- new post below ---
It's not a simple problem. As Dynamic Spirit has pointed out, once you turn the card you know what it is. So if you turn over its partner you will get it right 100% of the time (assuming perfect memory).

I may give this a go when I get home. But can I clarify are all the cards in one pool, or are there two separate groups of 1-9?

PS - this is probability not stats ;)

As my friend was explaining it, I knew it wouldn't be straight forward.

And yes, it is probability - I just put it under the stats umbrella as I have done some stats analysis on it.

The cards are in one separate pool - so there isn't a red 7 and a green 7 - just two 7s.

From what I can work out, this is supposed to be A Level standard in South Africa.
 

DynamicSpirit

Established Member
Joined
12 Apr 2012
Messages
8,998
Location
SE London
So let's make sure I understand what you're doing:

Say your next grid was:

693524
788614
912573


Pick 1: 69 (incorrect)
Pick 2: 35 (incorrect)
Pick 3: 24 (incorrect)
Pick 4: 78 (incorrect)
Pick 5: 88 (correct)
Pick 6: 66 (correct)
Pick 7: 14 (incorrect)
Pick 8: 44 (correct)
Pick 9: 99 (correct)
Pick 10: 11 (correct)
Pick 11: 22 (correct)
Pick 12: 55 (correct)
Pick 13: 77 (correct)
Pick 14: 33 (correct)

So that would be 5 incorrect guesses.

So the first 4 guesses, you're simply picking the next card across each row?
Then when you get to guess 5, you pick the next card you didn't look at, which is an 8. You already know where there's another 8 - you picked that up at guess 4. So you deliberately choose that card again, and that gives you the match. Same goes when you pick up the 6. Is that what you're doing?
 
Last edited:

crispy1978

Member
Joined
4 Feb 2013
Messages
1,037
Location
Scarborough
So let's make sure I understand what you're doing:



So the first 4 guesses, you're simply picking the next card across each row?
Then when you get to guess 5, you pick the next card you didn't look at, which is an 8. You already know where there's another 8 - you picked that up at guess 4. So you deliberately choose that card again, and that gives you the match. Same goes when you pick up the 6. Is that what you're doing?

Basically, yes.

Once you get to Pick 5 you know you are guaranteed a match as you know where both 8s are. They then come out of the grid. Ditto Pick 6. At Pick 7, you don't have a match guaranteed, hence why there's an incorrect match. Obviously there's a chance at random it could be correct - but that's all part of the probability calculation.
 

DynamicSpirit

Established Member
Joined
12 Apr 2012
Messages
8,998
Location
SE London
Basically, yes.

Once you get to Pick 5 you know you are guaranteed a match as you know where both 8s are. They then come out of the grid. Ditto Pick 6. At Pick 7, you don't have a match guaranteed, hence why there's an incorrect match. Obviously there's a chance at random it could be correct - but that's all part of the probability calculation.

OK. In that case, the problem is solvable but complicated. I think the solution should be this:

Prob of no fails:

This is easy. 1/17 – the probability that the 2nd card you pick up matches the first.

Prob of 1 fail:

The answer must be the Prob(failing the first time) * Prob (succeeding the 2nd time).

First it’s a 16/17 probability to get to having a 2nd round (i.e. the first round failed).

You have 2 recorded cards. I’m assuming you’re being sensible, so you’ll definitely choose an unrecorded card to pick up. There are 16 such cards, 2 of which will match a recorded one.

So 2/16 prob that your first card is a match (success!). Call this case U.
If it isn’t (prob=14/16) then you'll have to guess a 2nd card from the 15 left. In this event:
  • Prob = 1/15 that the 2nd card will match the first one (success!). Call this case V.
  • Prob = 2/15 that it matches one of the recorded ones (fail, but you know which cards to pick next time, so your next attempt is a guaranteed success). Call this case X
  • Prob = 12/15 that it doesn’t match anything (fail, and you now have 4 different recorded cards). Call this case Y
So overall, prob of 1 fail = P(U) + P(V) = (16/17)((2/16) + (14/16)(1/15))

Prob of 2 fails:

You have a prob of (16/17) (14/16)(2/15) of getting here with success guaranteed (case X).

And a prob of (16/17)(14/16)(12/15) of getting here and you still have to guess (case Y). In this event, you have 14 unrecorded cards to choose from, and you know 4 of those will match one of the recorded ones.

So the prob of 2 fails is (16/17)(14/16) [ (2/15) + (12/15)P] where P is a number that you should now be able to see how to work out – by basically doing the same analysis as for the prob of 1 fail.

And so on.
 

Abpj17

Member
Joined
5 Jul 2014
Messages
1,009
Fun :)

I agree that doing it the 'brute force' way will get you there. (Sometimes I find it easier to do at least some of it long-hand to work out if there is a short-cut) By long-hand I mean DS's way though - I don't think you need to go through the rigmarole you suggest in post 4 though. That would only be necessary if you weren't picking cards at random but following some kind of pattern.
 

me123

Established Member
Joined
9 Jul 2007
Messages
8,510
It's been a while, but I've had a go at this. I have assumed a perfect memory. It's a huge problem, it's difficult, and takes time and patience.

Assuming the cards are completely at random, the probability of no fails is easy to calculate. There are 18 cards, so when you turn the first card over the probability of the next card matching is 1/17. If that happens, the probability of the next card being a match is 1/15 and so on. The probability is therefore 1/17x1/15x1/13x1/11x1/9x1/7x1/5x1/3x1/1, which is 1/34,349,425.

The probability of the number of fails becomes quite tough to work out.

You could get it right on the first instance (1/17), but there's also a good chance you won't. Assume you then move onto the third card. , We now know what two of the cards are. If it's not one of the two cards, the probability is going to be 1/15 (fifteen cards left that may match) but there's also a 2/9 chance that it will match the previous cards (which are not the same as each other). So the probability of success on the second card is 1/15+2/9=13/45. Already your odds look much better. Assuming you continue to fail, you will now know four cards. The next move is where we come into trouble. There's a number of possibilities. The probability that we have made a match is now 1/17+13/45 (266/765) chance that we've made a match in the first two instances.

There's now a 499/765 chance that we haven't made a match on our first two turns. If we haven't done so, we know what four of the cards are. There's a chance that the fourth card may match the first or the second card (2/9), which would be our third move. Otherwise, we'll move onto the fifth card which has a 4/9 chance of matching an existing card, and there's now a 1/13 chance of it matching the next card along if that is the case.

The maths is getting too much for me already. I don't really have more time to give to this.
 
Status
Not open for further replies.

Top