Revision3.com Shows Schedule Inside Revision3 Store


Go Back   Revision3 Forums > Shows > Scam School

Reply
 
Thread Tools Search this Thread Display Modes

  #111  
Old 12-04-2009, 03:38 AM
shwooddotcom's Avatar
shwooddotcom
Scammaster General
 
Join Date: Jan 2008
Posts: 893
Status: Offline
Default

Quote:
Originally Posted by thinjon100 View Post
I'm probably reviving a dead thread, but I just came across this show. I rather enjoyed this episode, and the discussion so far. For a bit of amusement, I ran my own brute-force simulations, with 13-rank decks, and other combinations, to see the probabilities.

Here are my results (3,000,000 simulations each):
13-rank deck: 48.6%
12-rank (Kings removed): 51.6%
11-rank (K/Q removed): 55.1%
10-rank (K/Q/J removed): 58.9%
below this point is almost becomes unfeasible for a scam, but for the curious:
9-rank: 63.1%
8-rank: 68.2%
7-rank: 73.5%
6-rank: 79.3%
5-rank: 86.1%
4-rank: 92.7%
3-rank: 97.7%
and, of course, at 2-rank it's 100%.
In case I didn't make this clear before: I. Love. This. Forum.

Well done!
__________________
Catch me in your home town: My tour schedule's posted at shwood.com
Reply With Quote
  #112  
Old 12-08-2009, 01:01 AM
trey99
Newbie
 
Join Date: Dec 2009
Posts: 1
Status: Offline
Default 2 cards side by side

i learned this trick when i was 14 and im 17 now, but i did this over the internet in chat rooms. just get the other person to pull out a deck of cards, shuffle, name two card numbers between ace and king (involves 1-10). then tell them that the two cards will be side by side when they look through the deck. the results are amazing because they cannot figure out how it happened when u never touched the deck or even seen what they were doing
Reply With Quote
  #113  
Old 05-16-2010, 11:41 AM
paraponi
Newbie
 
Join Date: May 2010
Posts: 1
Status: Offline
Default Way to make it pay

Since the original idea seems to pay only about 48 %, some variation might be in order. One mentioned above was removing four cards of one kind and sticking them in one by one, eliminating the chance that they follow on subsequent spots.

Another simple idea would be to add following cards of the same kind to the success column. For example, if you choose "Aces and Kings following each other", include "Ace, Ace" as well as "King, King" in the winning bet. That should definitely move the probability over 50 %.
Reply With Quote
  #114  
Old 04-05-2012, 02:55 PM
klokan83
Newbie
 
Join Date: Apr 2012
Posts: 2
Status: Offline
Default

Quote:
Originally Posted by nixuz View Post
Some much faster C code, confirming sghuisman's result, with a sample size of 10 billion trials.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

unsigned int deck[52] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 
				  4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 
				  8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 
				  11, 11, 12, 12, 12, 12};

inline void shuffle(unsigned int array[], unsigned int n){
	unsigned int i, k, temp;
	while (n > 1){
		k = rand() % n;
		n--;
		temp = array[n];
		array[n] = array[k];
		array[k] = temp; 
	}	
}

inline int has_transition(unsigned int x, unsigned int y, unsigned int array[], unsigned int size){
	size--;
	while (size){
		size--;
		if (((array[size + 1] == x) && (array[size] == y)) || ((array[size + 1] == y) && (array[size] == x))) return 1;
	}
	return 0;
}

int main(int argc, char *argv[]){
	unsigned long long int i, count = 0, total;
	if (argc != 2){
		puts("transprob [iterations]");
	}
	else{
		sscanf(argv[1], "%llu", &total);
		srand(time(NULL));
		for (i = 0; i < total; i++){
			shuffle(deck, 52);
			if (has_transition(1, 5, deck, 52)) count++;
		}
		printf("%llu / %llu\n", count, total);
	}
	return 0;
}
Sample IO
Code:
$ ./transprob 10000000000
4862765097 / 10000000000
Since this is "the best code" presented in this forum, I have reviewed it and found that the code is flawed in two ways:

1. The shuffle function used to shuffle cards on positions 0-51 never leaves cards from positions 1-51 on their original position, but sometimes it leaves card from position 0 where it was. It clearly does not generate a random permutation of cards, since all cards should have a chance to stay where they were.

2. Function shuffle uses rand()%n to generate pseudo-random numbers in range [0,(n-1)]. rand() generates a pseudo-random number from range [0,32767] or [0,2147483647], depending on the system. Even if we were lucky to run the system with range [0,2147483647], the probability that rand()%52 is 0 is (1+2E-8) of the probability that it is 51, i.e., the generated numbers are not uniformly distributed over interval [0,51]. The error 2E-8 might look small, but I assume it is worthless to do 1E10 simulations with error 2E-8 introduced in pseudo-random generator.

Last edited by klokan83 : 04-05-2012 at 03:53 PM.
Reply With Quote
  #115  
Old 04-05-2012, 03:10 PM
klokan83
Newbie
 
Join Date: Apr 2012
Posts: 2
Status: Offline
Default

Quote:
Originally Posted by sghuisman View Post

The theory says "284622747 out of 585307450", which is about 48.627904%. All the simulations come close (very close) to that number.
sghuisman is correct with his result. It is exactly 284622747/585307450.
Many people here get result close to 61.5% since they mistake the problem question:
"What is the probability that there is at least one such pair of successive cards?"
with different question:
"What is the expected number of such pairs of successive cards?"

The trick is that in some situations winning pair appears more than once in the deck, but that does not mean i won twice in the original game. One could change the rules: If there is none such pair I buy beer to the other person, otherwise I get the number of beers equal to the count of the pairs. I will still be giving an average of 0.514 beer per game, but I will be receiving the average of 0.615 beers per game (because you might win up to 7 beers) so now it is worth a try.

Another modification that comes into my mind is that you can play the same game with 2 decks of cards (so there are 8 Aces... = 104 cards in total). Then the winning probability rises to 73%.
Reply With Quote
  #116  
Old 02-22-2013, 12:42 PM
estebanrey
Newbie
 
Join Date: Feb 2013
Posts: 3
Status: Offline
Default

Hi all, I make the chance of winning 49.3%.

Now I agree in principle with Dr Grime, the chance of 'winning' isn't over 50% as claimed in the Scam School video, but I disagree with his 48.3% figure, I make it 1 percentage point higher at 49.3% So who is correct (or rather where am I going wrong)?

Well, here is my explanation. Firstly, the only way (in my mind) of calculating this is to work out the chance of losing, what I'm am going to do is choose the 'Jack' and the 'King' for my example. If we concentrate on the Jacks, and mentally go through the deck arriving at each one and working out the chances of losing at each stage. There are 8 stages as each of the 4 Jacks could have a King immediately before it or immediately after it to win.

Here is my complete working.....



And now my stage-by-stage explanation for it...

King immediately precedes the 1st Jack
At the first Jack, the chance of a King NOT being before it is 44 in 48, since we can eliminate the four Jacks as possibilities because you've stopped on the first one, leaving 48 possible cards left. Then there are four Kings in which you'd win leaving 44 losing cards. Hence a 44/48 chance of a loss at this stage. At every stage the number of losing cards is the number of possible cards minus 4.

King immediately follows the 1st Jack
The chance a King won't appear right after the first Jack is 47 in 51, since we can eliminate the Jack you are looking at from the total possibilities but the next three Jacks are included as they could follow it if you have two Jacks in a row, leaving 47 losing cards out of the 51 possible cards.

King immediately precedes the 2nd Jack
On the 2nd Jack you come to, the chance a King isn't before it is 45 in 49, it's the same reasoning as the first Jack only this time the 'before' losing possibility changes as you need to add back in the possibility you have two Jacks in a row which obviously isn't possible on the first Jack. From this point forward the odds of a King immediately preceding a Jack will stay at 45 in 49 (as you can discount the Jacks you haven't got to yet and the ones you've gone past except the last).

King immediately follows the 2nd Jack
The chance a King won't immediately follow the 2nd Jack is 46 in 50, since the first 2 Jacks have to be eliminated from the possibilities leaving 50 cards, then we again discount the winning 4 Kings to get the number of losing cards.

King immediately precedes the 3rd Jack
As stated this is always 45 in 49 now, this time we discount the 1st, 3rd and 4th Jacks from the possibilities (the 2nd Jack could precede the 3rd though) leaving again 49 cards, with 45 of them losing.

King immediately follows the 3rd Jack
The chance a King won't immediately follow the 3rd Jack is also 45 in 49 (since the first 3 Jacks aren't available leaving 49 possible cards, and we minus the four winning 4 Kings to get the 45 losers.

King immediately precedes the 4th Jack
Again this is 45 in 49 now, this time we discount the 1st, 2nd and 4th Jacks from the possibilities (the 3rd Jack could precede the 4th though) leaving again 49 cards, with 45 of them losing.

King immediately follows the 4th Jack
Finally the chance of the 4th Jack NOT having a King right after it is 44 in 48, since it can't any of the 4 Jacks as there are none left to follow it leaving 48 possible cards, with 44 of them losers.

So.. the final equation to work out the odds of losing all 8 stages is this...

(44/48) * (47/51) * (45/49) * (46/50) * (45/49) * (45/49) * (45/49) * (44/48) = 50.68%.

Thus by definition the chance of winning the game is 49.32%

Do you agree with me, or the professor? Maybe neither of us are right?
Reply With Quote
  #117  
Old 02-25-2013, 12:48 AM
estebanrey
Newbie
 
Join Date: Feb 2013
Posts: 3
Status: Offline
Default

Oops I went wrong, when looking for the first Jack my calculations always assume there is at least one card before it, and the last Jack one card after. This isn't true, 1 in 13 the first card in the deck would be a Jack and also 1 in 13 time it would be the last.

So I updated my formula to take that into account. Basically I now add 100% to 12 times the probably of losing when you can then divide by 13 to get a mean losing probability for that 'stage'

((1+((44/48)*12))/13) * (47/51) * (45/49) * (46/50) * (45/49) * (45/49) * (45/49) * ((1+((44/48)*12))/13) = 0.513874458

That means a 48.6125542% chance of winning.

Last edited by estebanrey : 02-25-2013 at 12:58 AM.
Reply With Quote
  #118  
Old 05-23-2013, 02:34 AM
hellhound
Senior Member
 
Join Date: Mar 2006
Posts: 851
Status: Offline
Default

Looks like "mathemagics".... If someone says they can read my mind... but then says I need to pick a number or a card and go thru an addition, subtraction, multiplication routine... I ask them to read my mind now... "go fuck yourself"

Last edited by hellhound : 05-23-2013 at 02:35 AM.
Reply With Quote
  #119  
Old 08-20-2013, 08:45 PM
hosehead
Newbie
 
Join Date: Aug 2013
Posts: 1
Status: Offline
Default

I looked at some ideas to tip the scales in your favor more. Here's what I came up with on a million sims.

You can gain about 0.5-1% by including checking the first and last cards (like a loop).

A better idea would be to have the person choose two cards and try to get away with looking for one card following the other (like normal) or either card repeating. If they don't take the bait, tell them, the first match is free. This can get you up to ~62%

Another option is to look for one card following the other and have the person select one of the two cards that you will check for a repeat on. i.e. mark chooses 4 and 7, check for 4,7; 7,4 and 4,4 for instance. This gets you to about 61-62%.

I don't see any glaring errors in my code and the results look reasonable. See below. Sorry for the wordiness, I was having trouble describing concisely.

Two cards adjacent not including first and last card 0.485822
Two cards adjacent including wrapping first and last card 0.493039
Two cards adjacent including wrapping first and last card and first and last cards matching 0.498458
Either card appears twice in a row 0.386892
Either card appears twice in a row including wrapping first and last card 0.393181
Two cards adjacent or either card appears twice in a row not including wrapping first and last card 0.713647
Two cards adjacent or either card appears twice in a row or first and last card match the two cards 0.718348
Two cards adjacent or either card appears twice in a row or first and last card match the two cards or appear twice in a row 0.721832
Just a single card appears twice in a row (other card is not checked), no wrap of first and last 0.217502
Just a single card appears twice in a row (other card is not checked), including wrapping of first and last card 0.221512
Two cards are adjacent or just a single card appears twice in a row (other card is not checked), no wrap of first and last 0.61606
Two cards are adjacent or just a single card appears twice in a row (other card is not checked), including both cards appearing first and last card 0.621852
Two cards are adjacent or just a single card appears twice in a row (other card is not checked), including both cards appearing as first and last card or first and last card are the same 0.624144
Either card appears twice in a row more than 1 time 0.22765
Either card appears twice in a row more than 1 time including wrapping first and last card 0.228742
Two cards adjacent or either card appears twice in a row more than 1 time not including wrapping first and last card 0.623022
Two cards adjacent or either card appears twice in a row more than 1 time or first and last card match the two cards 0.623725
Two cards adjacent or either card appears twice in a row more than 1 time or first and last card match the two cards or appear twice in a row 0.716034
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 05:07 PM.

Rev3 Forum RSS


© 2005-2010 Revision3 Corporation