Javascript Card Trick - Computerphile

preview_player
Показать описание
How does the "mystical" mind-reading computer program work? Spoiler, it can't read minds. Dr Tim Muller shows us a trick you can play on people.


This video was filmed and edited by Sean Riley.


Рекомендации по теме
Комментарии
Автор

Calling it mind-reading is the funny business.

johnqpublic
Автор

Rather than trying to read the order of the three cards as a three digit number, in practice it's a lot easier to say let the position of the highest value of the three cards determine the "approximate" position 1/2, 3/4, or 5/6 higher than the reference card. Then if the remaining two cards are in order, choose the first number in the the range, otherwise choose the second number.

For example if the five cards are: K♥, 3♠, 4♥, A♣, A♦.
4♥ will be the target card because it's 4 more than the K♥, so K♥ is the reference (first provided) card.
Next we want to express a difference of 4, so we put the highest of the three remaining cards (A♦ in CHaSeD order) in the middle position (meaning difference of 3/4).
Finally we need to narrow this down to the second option so we put the remaining two cards (3♠, A♣) in reverse order:
K♥, A♣, A♦, 3♠

binaryagenda
Автор

The actual trick was making JavaScript seem relevant by including its name in the title.

SystemBD
Автор

Another system for ranking the suits in the deck is the "Sting" System
"I know that the SPADES are the swords of a soldier
I know that the CLUBS are weapons of war
I know the DIAMONDS mean money for this art
but that's not the shape of my HEART"

SantiagoGonzalez-sllj
Автор

Just to make it a bit less noticable when done multiple times, you can switch the location of the base card, instead of it being always the 1st.
A very easy method can be to divide the "MSB" card (2 of clubs) by 3, and use the remaindr as the index in the next 3 cards. In this example, 2%3=2, so the order would be two of clubs, king of hearts, three of hearts, and then three of spades.
The base card can never be the 1st card, but will be placed "randomly" between the next three.
In this method, when given the 4 cards, first you divide the 1st card by 3, and use the remainder to find the base card. Then, you use the other 3 cards to calculate how much to add as presented in the video.

uri.kalish
Автор

You need to call parseInt() on the card values r1 r2 r3 & r4, or their values will be ordered by string dictionary order, which means ten is less than nine. That's probably not what you intended.

kaicheung
Автор

FYI, at 4:00 he used the word "combination" but the right term was "permutation" (since the order matters). Maybe you could make a pinned comment pointing out the slight error?
In any case, this was a great trick. I like it.

DrakiniteOfficial
Автор

"Cause in computer science we give fancy names for a simple principle" haha fr tho xD

sathwikkothapalli
Автор

The mnemonic he gives is actually wrong for the ordering of orderings used in the Javascript. (It swaps 3>2>4 and 2>4>3.)

sillymel
Автор

Seriously, those cards are just the worst!

ben
Автор

This is really great but I was expecting this to be something unique to JavaScript. This program can be made in any programing language.

patton
Автор

I like how he doesn't think for a moment that there's actually anything magical about it. He just goes straight to, "What's the trick?" I laughed out loud. What a cynical world we live in.

kevnar
Автор

I might be tired but I didn't understand any part of this XD I'm still impressed!

cybersteel
Автор

1:39 All business with sean, no time to enjoy the magic 😛

hirtandtieler
Автор

To quote Mos Def
- "It's all mathematics"

HarryBallsOnYa
Автор

Thank you for the code, it was fun to read, cheers from Uruguay!

nicoberrogorry
Автор

At its simplest, Computers still do only what we tell it to do.

jlivewell
Автор

Nice trick and code, very readable. I could figure it out from the source.

kyrond
Автор

Hi, Im very curious about this algorithm and Im trying it on my own.. I ran into scenario where I have this 5 cards: 10 Diamonds, 10 hearths, 5 clubs, 5 space, 9 of clubs..
9 of clubs is the one Im going to hide because its the only one that I have twice of the symbol.
First of those cards should be 5 clubs to set the final card into same colour.
Second should be 5 of space because it is the lowest of 3 remaining cards.
Third should be 10 of diamonds because of the biggest value. (diamonds > hearts)
Fourth should be 10 of hearts because it is the middle one of the 3 remaining cards.
9 clubs (folded), 5 clubs, 5 space, 10 diamond, 10 hearts.
-> result: 11 of clubs
wrong result so I did try to switch 10s
9 clubs (folded), 5 clubs, 5 space, 10 hearts, 10 diamonds.
-> result: 10 of clubs

justrobin
Автор

Logic and no logic all in the same video. My favourite!

joshuaprice