1 00:00:06,400 --> 00:00:08,760 SRINI DEVADAS: All right, good morning, everyone. 2 00:00:08,760 --> 00:00:11,170 Oh, do we have a treat for you today. 3 00:00:11,170 --> 00:00:16,210 I'm going to publicize, for the first time, my hidden 4 00:00:16,210 --> 00:00:18,430 talent of mind reading. 5 00:00:18,430 --> 00:00:21,220 And since this is a magic trick, you know, 6 00:00:21,220 --> 00:00:23,710 every magician needs an assistant. 7 00:00:23,710 --> 00:00:27,100 And I want to introduce Billy Moses to you. 8 00:00:27,100 --> 00:00:28,810 Billy is a PhD student. 9 00:00:28,810 --> 00:00:30,520 He already has three degrees from MIT, 10 00:00:30,520 --> 00:00:32,840 but he wants a fourth, I guess. 11 00:00:32,840 --> 00:00:35,800 And so I'm going to turn it over to Billy, here. 12 00:00:35,800 --> 00:00:39,580 And Billy is going to sort of set things up. 13 00:00:39,580 --> 00:00:44,130 I'm just going to do my thing, which is read your minds, OK? 14 00:00:44,130 --> 00:00:44,990 So go ahead, Billy. 15 00:00:44,990 --> 00:00:47,365 BILLY MOSES: So what's going to happen is, I'm going to-- 16 00:00:47,365 --> 00:00:48,460 I have this card deck right here, 17 00:00:48,460 --> 00:00:50,290 normal card deck, perfectly normal cards. 18 00:00:50,290 --> 00:00:51,680 They're not in any weird order. 19 00:00:51,680 --> 00:00:53,830 You can see them. 20 00:00:53,830 --> 00:00:57,044 I'm going to give five people the opportunity to pull a card 21 00:00:57,044 --> 00:00:58,210 and then give it back to me. 22 00:00:58,210 --> 00:00:59,332 They can look at the card. 23 00:00:59,332 --> 00:01:00,790 Then what's going to happen is, I'm 24 00:01:00,790 --> 00:01:05,470 going to turn over four of these cards, show you the final card. 25 00:01:05,470 --> 00:01:08,425 And then Srini is trying-- going to try to guess the fifth card. 26 00:01:08,425 --> 00:01:10,360 SRINI DEVADAS: Well, but what I need you to do 27 00:01:10,360 --> 00:01:13,720 is, when I'm going to guess, I need all of you 28 00:01:13,720 --> 00:01:16,950 to really focus on that hidden card, I mean, in your heads, 29 00:01:16,950 --> 00:01:17,560 right? 30 00:01:17,560 --> 00:01:19,600 So I can't do individual mind reading, just 31 00:01:19,600 --> 00:01:21,070 in case you guys were worried. 32 00:01:21,070 --> 00:01:23,380 So if you think I'm wearing a terrible-colored shirt, 33 00:01:23,380 --> 00:01:25,510 I'm not going to know, OK? 34 00:01:25,510 --> 00:01:28,746 But if you all think of this hidden card, 35 00:01:28,746 --> 00:01:30,120 I'm going to be able to guess it. 36 00:01:30,120 --> 00:01:32,470 But so I need some help, all right? 37 00:01:32,470 --> 00:01:36,190 BILLY MOSES: OK, anyone wants to try pulling some of the cards? 38 00:01:36,190 --> 00:01:36,970 OK. 39 00:01:36,970 --> 00:01:37,490 SRINI DEVADAS: And I guess-- 40 00:01:37,490 --> 00:01:37,950 BILLY MOSES: Take your favorite card. 41 00:01:37,950 --> 00:01:38,192 SRINI DEVADAS: --I can step out-- 42 00:01:38,192 --> 00:01:38,483 BILLY MOSES: --it can be anywhere. 43 00:01:38,483 --> 00:01:39,420 SRINI DEVADAS: --here, right? 44 00:01:39,420 --> 00:01:39,910 BILLY MOSES: Yeah. 45 00:01:39,910 --> 00:01:40,730 SRINI DEVADAS: All right. 46 00:01:40,730 --> 00:01:42,010 BILLY MOSES: And look at it. 47 00:01:42,010 --> 00:01:44,230 Give it back to me once you've-- 48 00:01:44,230 --> 00:01:45,210 cool. 49 00:01:45,210 --> 00:01:46,600 Anyone else want to pick a card? 50 00:01:46,600 --> 00:01:47,433 Want to pick a card? 51 00:01:47,433 --> 00:01:47,967 Here you go. 52 00:01:47,967 --> 00:01:50,550 You can look at the full deck, look at whatever card you want, 53 00:01:50,550 --> 00:01:52,880 pick it, cool. 54 00:01:52,880 --> 00:01:54,630 SRINI DEVADAS: We're doing a little trick. 55 00:01:54,630 --> 00:01:55,352 BILLY MOSES: Anyone else want to pick a card? 56 00:01:55,352 --> 00:01:56,352 You want to pick a card? 57 00:02:02,223 --> 00:02:05,760 OK, anyone else want to pick a card? 58 00:02:05,760 --> 00:02:06,975 Want to pick a card? 59 00:02:11,340 --> 00:02:13,030 Cool, want to pick a card? 60 00:02:17,270 --> 00:02:25,030 Cool, OK, I've got my cards all nice together. 61 00:02:38,240 --> 00:02:40,782 OK, so five cards, I'm going to show you first. 62 00:02:40,782 --> 00:02:43,240 And then we're going to present them in a fun way for Srini 63 00:02:43,240 --> 00:02:43,740 to see. 64 00:02:43,740 --> 00:02:45,450 So the five cards are as follows. 65 00:02:45,450 --> 00:02:48,350 We have this wonderful Seven of Clubs. 66 00:02:48,350 --> 00:02:52,640 We have a Jack of Hearts. 67 00:02:52,640 --> 00:02:56,860 We have Seven of Hearts. 68 00:02:56,860 --> 00:02:59,570 We have Queen of Spades. 69 00:02:59,570 --> 00:03:01,674 And we have Ten of Clubs. 70 00:03:01,674 --> 00:03:03,340 Now, for the people who pulled the card, 71 00:03:03,340 --> 00:03:06,340 these are indeed the cards that you gave me, right? 72 00:03:06,340 --> 00:03:08,840 No one missed their card in the deck? 73 00:03:08,840 --> 00:03:10,390 OK, I'll go get Srini. 74 00:03:13,916 --> 00:03:15,540 SRINI DEVADAS: All right, ready for me? 75 00:03:15,540 --> 00:03:16,248 BILLY MOSES: Yup. 76 00:03:18,630 --> 00:03:25,350 OK, the first card is the Seven of Clubs. 77 00:03:25,350 --> 00:03:31,500 The second card is the Jack of Hearts. 78 00:03:31,500 --> 00:03:37,890 The third card is the Seven of Hearts. 79 00:03:37,890 --> 00:03:40,590 The fourth card is-- and this is the final card that Srini will 80 00:03:40,590 --> 00:03:42,960 be able to see-- 81 00:03:42,960 --> 00:03:45,330 the Queen of Spades. 82 00:03:45,330 --> 00:03:46,770 Now, everyone think to yourself. 83 00:03:46,770 --> 00:03:48,784 You've got to see the card, the fifth card, 84 00:03:48,784 --> 00:03:49,950 that Srini is going to have. 85 00:03:49,950 --> 00:03:52,560 Think it very closely in your mind, think. 86 00:03:52,560 --> 00:03:55,090 SRINI DEVADAS: All right, definitely a clubs, definitely 87 00:03:55,090 --> 00:03:56,400 a clubs-- 88 00:03:56,400 --> 00:03:59,325 OK, see-- and I'm getting-- 89 00:04:03,360 --> 00:04:05,580 I'm getting at Ten of Clubs. 90 00:04:05,580 --> 00:04:08,310 BILLY MOSES: And it is a Ten of Clubs. 91 00:04:08,310 --> 00:04:10,370 SRINI DEVADAS: All right, thank you. 92 00:04:14,350 --> 00:04:20,690 All right, so I guess I'll have to confess. 93 00:04:20,690 --> 00:04:24,650 I'm not a mind reader, but I also did not cheat, OK? 94 00:04:24,650 --> 00:04:27,230 So there's an algorithm here. 95 00:04:27,230 --> 00:04:29,600 And do you guys want to know what the algorithm is 96 00:04:29,600 --> 00:04:32,200 so you can go and try this out, I guess, 97 00:04:32,200 --> 00:04:36,530 when you go back home next, or whatever, at your dorms, 98 00:04:36,530 --> 00:04:39,680 or with your classmates? 99 00:04:39,680 --> 00:04:45,380 So it's not as easy as it might seem, simply 100 00:04:45,380 --> 00:04:49,580 because the combinations aren't really in our favor, right? 101 00:04:49,580 --> 00:04:53,540 So if you think about it, there's 52 cards. 102 00:04:53,540 --> 00:04:55,870 So this is a regular deck of cards. 103 00:04:55,870 --> 00:04:58,660 You know, it's as I said, there's no cheating here. 104 00:04:58,660 --> 00:05:01,765 Billy showed me four cards. 105 00:05:06,680 --> 00:05:18,439 So which means the fifth card could be 1 of 48, right? 106 00:05:18,439 --> 00:05:19,730 I mean, it's completely random. 107 00:05:19,730 --> 00:05:23,070 You guys picked these five cards completely at random, 108 00:05:23,070 --> 00:05:25,880 so there's no way that that fifth card could 109 00:05:25,880 --> 00:05:28,220 be anything specific, OK? 110 00:05:28,220 --> 00:05:33,590 So what Billy had to do was, in the four cards 111 00:05:33,590 --> 00:05:40,010 that he showed me, he really had to communicate one of-- 112 00:05:40,010 --> 00:05:44,470 specifically, one of 48 possibilities, 113 00:05:44,470 --> 00:05:46,000 which is kind of-- you know, if you 114 00:05:46,000 --> 00:05:48,374 look-- if you think about it, then the math doesn't quite 115 00:05:48,374 --> 00:05:50,016 work out, right? 116 00:05:50,016 --> 00:05:52,170 And so if you just say-- 117 00:05:52,170 --> 00:05:54,270 so what are the ways-- 118 00:05:54,270 --> 00:05:57,600 how much information could you imagine 119 00:05:57,600 --> 00:06:00,880 communicating, in terms of bits of information, right? 120 00:06:00,880 --> 00:06:03,210 You know, in terms of possibilities or bits, 121 00:06:03,210 --> 00:06:06,990 how much information do you think that Billy could 122 00:06:06,990 --> 00:06:09,766 communicate in these four cards, which 123 00:06:09,766 --> 00:06:10,890 were also picked at random. 124 00:06:10,890 --> 00:06:12,931 Obviously, they have to be specific cards, right? 125 00:06:12,931 --> 00:06:14,760 He just put them up there, right? 126 00:06:14,760 --> 00:06:17,010 So if I have four cards, what are the ways 127 00:06:17,010 --> 00:06:19,260 that Billy could communicate information. 128 00:06:19,260 --> 00:06:21,900 I mean, you saw what he did. 129 00:06:21,900 --> 00:06:22,540 Any ideas? 130 00:06:26,120 --> 00:06:27,820 Yeah, Ganatra? 131 00:06:27,820 --> 00:06:29,704 AUDIENCE: The order the cards are placed. 132 00:06:29,704 --> 00:06:31,620 SRINI DEVADAS: The order the cards are placed, 133 00:06:31,620 --> 00:06:33,422 so that's a great answer. 134 00:06:33,422 --> 00:06:35,880 But if you look at the order in which the cards are placed, 135 00:06:35,880 --> 00:06:38,780 how many different orderings are there? 136 00:06:38,780 --> 00:06:42,230 Four cards, how many different orderings? 137 00:06:42,230 --> 00:06:46,370 4 factorial, right, and that is? 138 00:06:46,370 --> 00:06:50,750 24, so I'm not quite at 48 yet, right? 139 00:06:50,750 --> 00:06:53,330 So that's a bit of a problem. 140 00:06:53,330 --> 00:06:56,020 So is there something else going on other than the ordering? 141 00:06:58,680 --> 00:06:59,205 Yeah? 142 00:06:59,205 --> 00:07:01,080 AUDIENCE: The time rate at which he put them. 143 00:07:04,294 --> 00:07:05,710 SRINI DEVADAS: So you mean the way 144 00:07:05,710 --> 00:07:09,700 he put them up, you know, slowly versus quickly? 145 00:07:09,700 --> 00:07:12,930 Or did you mean something with which was-- 146 00:07:12,930 --> 00:07:16,502 the time in terms of exposure of the cards, or? 147 00:07:16,502 --> 00:07:17,328 AUDIENCE: Have some variations, for example, whether the red is 148 00:07:17,328 --> 00:07:17,869 before black. 149 00:07:30,085 --> 00:07:32,460 SRINI DEVADAS: Well, but that's all part of the ordering. 150 00:07:32,460 --> 00:07:36,660 I mean, you have to be careful here, in that, I mean, 151 00:07:36,660 --> 00:07:38,550 you can't do both, right? 152 00:07:38,550 --> 00:07:40,650 I mean, you can't constrain the ordering 153 00:07:40,650 --> 00:07:44,040 and then say that there's 24 different orderings. 154 00:07:44,040 --> 00:07:46,350 The moment you constrain orderings, the number 155 00:07:46,350 --> 00:07:48,570 of orderings shrinks, right? 156 00:07:48,570 --> 00:07:53,144 So I will say that, as I said, this is a very legit trick. 157 00:07:53,144 --> 00:07:54,310 It's completely algorithmic. 158 00:07:54,310 --> 00:07:56,268 We're going to write code for it-- or I'm going 159 00:07:56,268 --> 00:07:58,350 to show you code for it. 160 00:07:58,350 --> 00:08:03,120 But there's nothing else other than the ordering, OK? 161 00:08:03,120 --> 00:08:05,680 He is-- there's no sleight of hand. 162 00:08:05,680 --> 00:08:08,046 There's no hidden communication. 163 00:08:08,046 --> 00:08:09,420 You know, he didn't stress words, 164 00:08:09,420 --> 00:08:12,000 you know, Clubs meant something, or you know, 165 00:08:12,000 --> 00:08:13,870 Spades meant something else. 166 00:08:13,870 --> 00:08:16,210 It was just the ordering, OK? 167 00:08:16,210 --> 00:08:21,854 And so there's a gap here in terms of 24 and 48, right? 168 00:08:21,854 --> 00:08:24,270 And so what's cool about this trick is that we're actually 169 00:08:24,270 --> 00:08:29,000 going to be able to do this original trick, 170 00:08:29,000 --> 00:08:31,980 where the fifth card could be one of 48, 171 00:08:31,980 --> 00:08:36,330 because we're going to do one thing that you probably 172 00:08:36,330 --> 00:08:40,630 didn't notice, because we only did the trick once, all right? 173 00:08:40,630 --> 00:08:43,890 And so let me explain how this is going to work, 174 00:08:43,890 --> 00:08:45,660 with just sort of randomly picking-- 175 00:08:45,660 --> 00:08:47,160 I'm just going pick the top 5 cards, 176 00:08:47,160 --> 00:08:48,870 assuming these are shuffled. 177 00:08:48,870 --> 00:08:51,520 And you can assume these things that are at random, right? 178 00:08:51,520 --> 00:08:55,000 So I have five cards that I've picked here. 179 00:08:55,000 --> 00:08:58,600 And can you all see them? 180 00:08:58,600 --> 00:09:02,355 OK, what do you notice about these five cards? 181 00:09:05,130 --> 00:09:07,625 Anything-- yup, Fadi. 182 00:09:07,625 --> 00:09:09,500 AUDIENCE: There are four types and five cards 183 00:09:09,500 --> 00:09:11,208 so there's at least one that is repeated. 184 00:09:16,010 --> 00:09:17,260 SRINI DEVADAS: Right, so the-- 185 00:09:17,260 --> 00:09:20,270 so you're saying the suit, right? 186 00:09:20,270 --> 00:09:21,500 So it is clear. 187 00:09:21,500 --> 00:09:22,250 This is true here. 188 00:09:22,250 --> 00:09:25,790 You have the Seven of Clubs and the Ten of Clubs, right? 189 00:09:25,790 --> 00:09:29,340 Oh are these the cards that you pulled out, or close? 190 00:09:29,340 --> 00:09:33,010 Anyway, so they look pretty similar to the ones we used, 191 00:09:33,010 --> 00:09:36,500 but that's probably just because we didn't shuffle the deck. 192 00:09:36,500 --> 00:09:39,800 But obviously, if you have five cards, 193 00:09:39,800 --> 00:09:43,640 and you only have four suits, I guess 194 00:09:43,640 --> 00:09:47,450 you could call it the pigeonhole principle from 6.042, 195 00:09:47,450 --> 00:09:50,120 but you're definitely going to have 196 00:09:50,120 --> 00:09:54,650 a pair of cards that are going to be of the same suit, right? 197 00:09:54,650 --> 00:09:58,030 I mean, there may be more than two cards of the same suit, 198 00:09:58,030 --> 00:10:00,990 but you're guaranteed, for any five cards-- 199 00:10:00,990 --> 00:10:02,435 let me just pick another five-- 200 00:10:02,435 --> 00:10:05,390 that two of them are going to be of the same suit, right? 201 00:10:05,390 --> 00:10:06,930 That's pretty much guaranteed. 202 00:10:06,930 --> 00:10:09,660 And so we ended up getting clubs again here. 203 00:10:09,660 --> 00:10:14,580 And so you have Two and Four of the same suit. 204 00:10:14,580 --> 00:10:17,420 So the first thing that happens in this trick 205 00:10:17,420 --> 00:10:22,710 is, we use the first card to give away the suit. 206 00:10:22,710 --> 00:10:26,840 Or Billy used the first card to give away the suit. 207 00:10:26,840 --> 00:10:32,090 Doesn't quite finish the story here, 208 00:10:32,090 --> 00:10:34,370 because let's just say that I'm going 209 00:10:34,370 --> 00:10:41,990 to use the first card to signify the suit. 210 00:10:47,090 --> 00:10:54,780 So in this case, let's just say I am going to do Clubs. 211 00:10:54,780 --> 00:10:58,260 Now, I have a choice here. 212 00:10:58,260 --> 00:11:04,850 I could-- Billy could have hidden Two, 213 00:11:04,850 --> 00:11:08,570 and showed me the Four of Clubs as the first card, right, 214 00:11:08,570 --> 00:11:09,804 or vice versa. 215 00:11:09,804 --> 00:11:11,720 And keep that in mind, because that's actually 216 00:11:11,720 --> 00:11:14,270 incredibly important. 217 00:11:14,270 --> 00:11:17,030 But if you just say that the first card is 218 00:11:17,030 --> 00:11:20,450 going to signify the suit, then let's 219 00:11:20,450 --> 00:11:22,520 say the suit is now out of the picture, 220 00:11:22,520 --> 00:11:25,730 so I know the suit of the card. 221 00:11:25,730 --> 00:11:32,100 How many-- so I have three cards left, all right? 222 00:11:32,100 --> 00:11:34,920 And I got a hidden card. 223 00:11:34,920 --> 00:11:41,250 I know the suit of the hidden card, but that card could be-- 224 00:11:41,250 --> 00:11:46,030 the hidden card-- how many possibilities are there 225 00:11:46,030 --> 00:11:47,870 for the hidden card now? 226 00:11:50,560 --> 00:11:51,970 How many possibilities? 227 00:11:51,970 --> 00:11:55,410 I mean, this is all at random. 228 00:11:55,410 --> 00:11:56,708 Well, 13. 229 00:11:56,708 --> 00:11:58,142 AUDIENCE: 12 230 00:11:58,142 --> 00:12:00,660 SRINI DEVADAS: Oh, good point, good, good, good-- 231 00:12:00,660 --> 00:12:03,510 see, this is exactly why I need attentive students. 232 00:12:03,510 --> 00:12:09,790 OK, good, so there's 12 possibilities since one of them 233 00:12:09,790 --> 00:12:10,510 was-- 234 00:12:10,510 --> 00:12:12,590 one of them was shown, right? 235 00:12:12,590 --> 00:12:15,650 So did that help us? 236 00:12:15,650 --> 00:12:18,460 There are three cards left, and so how many different-- 237 00:12:18,460 --> 00:12:20,830 I mean, the first card is the first card, 238 00:12:20,830 --> 00:12:23,950 so it's no longer part of this permutation. 239 00:12:23,950 --> 00:12:25,900 I can't count it in terms of the permutations. 240 00:12:25,900 --> 00:12:27,305 There's only three cards left. 241 00:12:27,305 --> 00:12:28,930 And those-- certainly those three cards 242 00:12:28,930 --> 00:12:32,440 could be ordered in a certain way, 243 00:12:32,440 --> 00:12:34,600 but how many combinations or permutations 244 00:12:34,600 --> 00:12:37,380 are there of three cards? 245 00:12:37,380 --> 00:12:41,850 Only six permutations, so again, I seem to have a problem here. 246 00:12:41,850 --> 00:12:46,020 I don't seem to have solved the original problem of the 24 247 00:12:46,020 --> 00:12:47,200 to 48. 248 00:12:47,200 --> 00:12:50,100 I still have a 6-12 gap, right? 249 00:12:50,100 --> 00:12:53,940 So we're going to have to somehow cover that gap. 250 00:12:53,940 --> 00:12:56,790 And any thoughts? 251 00:12:56,790 --> 00:12:58,170 I gave you a little bit of a hint 252 00:12:58,170 --> 00:13:01,290 as to how this gap is going to be covered when I talked 253 00:13:01,290 --> 00:13:03,630 about the Two and the Four. 254 00:13:03,630 --> 00:13:08,520 How am I going to cover this gap, the 6-12 gap? 255 00:13:15,870 --> 00:13:17,086 Yeah, Kanishka. 256 00:13:17,086 --> 00:13:17,783 AUDIENCE: Possibly by saying odd or even. 257 00:13:17,783 --> 00:13:20,408 So if the next card you can say odd or even you shrink it down. 258 00:13:24,047 --> 00:13:25,630 SRINI DEVADAS: But you mean-- say, you 259 00:13:25,630 --> 00:13:27,171 mean Billy is going to say something? 260 00:13:27,171 --> 00:13:29,280 AUDIENCE: No, he's going to present the next card. 261 00:13:29,280 --> 00:13:29,764 SRINI DEVADAS: Yeah. 262 00:13:29,764 --> 00:13:30,316 AUDIENCE: Whether it is thinking that the final card you have 263 00:13:30,316 --> 00:13:30,657 to guess is odd or even and you can shrink down 264 00:13:30,657 --> 00:13:31,407 the possibilities. 265 00:13:37,467 --> 00:13:39,800 SRINI DEVADAS: So, I mean, he-- the only thing he can do 266 00:13:39,800 --> 00:13:44,570 is give me an ordering of the remaining three cards, right? 267 00:13:44,570 --> 00:13:45,759 Yeah, go ahead. 268 00:13:45,759 --> 00:13:46,300 Kevin, right? 269 00:13:46,300 --> 00:13:47,966 AUDIENCE: Yeah, maybe you used the cards 270 00:13:47,966 --> 00:13:52,700 to make a low-to-high limit on the range. 271 00:13:52,700 --> 00:13:55,820 SRINI DEVADAS: That's good, and low-a-high limit on the range, 272 00:13:55,820 --> 00:13:57,990 exactly right. 273 00:13:57,990 --> 00:14:03,770 So what's happening here is, not only do I have the first card-- 274 00:14:03,770 --> 00:14:07,240 and it's not the first card is just giving me the suit. 275 00:14:07,240 --> 00:14:09,170 I mean, that's the way I said it, right? 276 00:14:09,170 --> 00:14:11,930 But the first card also has a number on it, right? 277 00:14:11,930 --> 00:14:13,770 The first card has a number on it. 278 00:14:13,770 --> 00:14:16,880 So that number could be an anchor 279 00:14:16,880 --> 00:14:21,950 that is going to help me figure out what the hidden card is, 280 00:14:21,950 --> 00:14:22,760 right? 281 00:14:22,760 --> 00:14:24,710 And what's important to understand, 282 00:14:24,710 --> 00:14:28,730 and this is really the last interesting point 283 00:14:28,730 --> 00:14:30,980 with respect to shrinking these possibilities 284 00:14:30,980 --> 00:14:37,190 or these permutations down, is you want to think about your-- 285 00:14:37,190 --> 00:14:42,680 let me draw this out properly in a nice little circle. 286 00:14:42,680 --> 00:14:49,470 You don't want to think about just a ascending sequence 287 00:14:49,470 --> 00:14:52,780 of cards or numbers. 288 00:14:52,780 --> 00:14:57,310 You want to think about this as being circular, as you'll see, 289 00:14:57,310 --> 00:14:58,660 for the following reason. 290 00:15:08,084 --> 00:15:11,382 All right, so let's just say the ace is a 1. 291 00:15:11,382 --> 00:15:12,840 And so we're going to think of that 292 00:15:12,840 --> 00:15:18,540 as being the smallest number, so you go 1 through 13, 293 00:15:18,540 --> 00:15:19,350 in this case. 294 00:15:19,350 --> 00:15:21,040 The king is a 13. 295 00:15:21,040 --> 00:15:22,750 All right, so that's your number. 296 00:15:22,750 --> 00:15:25,474 And so you could imagine you'd go 1 through 13. 297 00:15:25,474 --> 00:15:26,640 So let's just do that first. 298 00:15:26,640 --> 00:15:29,490 And then I'll explain to you why I drew it in a circle. 299 00:15:29,490 --> 00:15:34,830 And the first thing that happens is, 300 00:15:34,830 --> 00:15:38,320 I'm going to take some card here. 301 00:15:38,320 --> 00:15:42,160 And I'm going to make that the first card, 302 00:15:42,160 --> 00:15:44,420 so I don't care about suits anymore. 303 00:15:44,420 --> 00:15:47,490 And if I just picked this-- 304 00:15:47,490 --> 00:15:48,320 another five cards. 305 00:15:48,320 --> 00:15:52,060 Let's just do this again, but with another set of five cards. 306 00:15:52,060 --> 00:15:53,580 And what do I have here? 307 00:15:53,580 --> 00:15:57,170 Oh, I've got mostly hearts, OK. 308 00:15:57,170 --> 00:16:00,300 So let me do something more interesting. 309 00:16:00,300 --> 00:16:02,940 This is too many hearts here. 310 00:16:02,940 --> 00:16:05,040 Right, let's do this. 311 00:16:05,040 --> 00:16:10,200 So now, I got a Two and a Jack. 312 00:16:10,200 --> 00:16:12,360 And I got a Ten an an Eight. 313 00:16:12,360 --> 00:16:15,990 OK, now I'll make this even more interesting by picking-- 314 00:16:15,990 --> 00:16:17,260 I want to pick-- 315 00:16:17,260 --> 00:16:19,020 I want to get a hearts card. 316 00:16:19,020 --> 00:16:20,460 And let's see how this works. 317 00:16:26,196 --> 00:16:32,170 Ah finally, all right, so this is what I have, King of Hearts, 318 00:16:32,170 --> 00:16:34,090 the Eight of Spades, et cetera. 319 00:16:34,090 --> 00:16:39,460 So the two cards with the same suit are the Two and the Jack. 320 00:16:39,460 --> 00:16:43,520 And so here's the important thing. 321 00:16:43,520 --> 00:16:46,810 One of the things that Billy did, kind of, in a subtle way, 322 00:16:46,810 --> 00:16:51,160 I'm assuming, and some of you may have picked up on it. 323 00:16:51,160 --> 00:16:54,580 The very first card that he asked one of you 324 00:16:54,580 --> 00:16:57,700 to pick certainly wasn't the hidden card, right? 325 00:16:57,700 --> 00:16:59,860 I mean, he got all five cards. 326 00:16:59,860 --> 00:17:03,070 And then he decided which of the cards 327 00:17:03,070 --> 00:17:05,270 was going to be the hidden card and then took 328 00:17:05,270 --> 00:17:08,319 the remaining four cards and encoded them. 329 00:17:08,319 --> 00:17:11,710 And if you don't do that, if you just say this, if you-- 330 00:17:11,710 --> 00:17:15,640 this trick won't work if this is the hidden card. 331 00:17:15,640 --> 00:17:19,569 This trick is only going to work as it turns out 332 00:17:19,569 --> 00:17:24,160 if the hidden card is a Two. 333 00:17:24,160 --> 00:17:30,910 It won't even work if the hidden card is a Jack. 334 00:17:30,910 --> 00:17:32,520 And there's a reason for that. 335 00:17:32,520 --> 00:17:36,040 And you-- can you think of the reason for that 336 00:17:36,040 --> 00:17:37,819 if you look at the board? 337 00:17:37,819 --> 00:17:39,360 Can you think of the reason for that? 338 00:17:39,360 --> 00:17:41,122 Someone other than Fadi? 339 00:17:44,426 --> 00:17:47,260 Someone else? 340 00:17:47,260 --> 00:17:48,920 What do you see up here? 341 00:17:48,920 --> 00:17:50,150 So what am I trying to do? 342 00:17:50,150 --> 00:17:52,550 In terms of-- what would happen-- 343 00:17:52,550 --> 00:17:53,720 you guys talked about-- 344 00:17:53,720 --> 00:17:56,040 Kevin mentioned distance and things like that, right? 345 00:17:56,040 --> 00:17:57,630 You know, you call it the offset. 346 00:17:57,630 --> 00:18:05,840 So what would happen if I hid the Jack, and I did this-- 347 00:18:05,840 --> 00:18:08,000 I did something like this, where I-- 348 00:18:08,000 --> 00:18:11,540 the Two of Diamonds was the first card that was put out. 349 00:18:11,540 --> 00:18:15,080 And then I tried to encode and number 350 00:18:15,080 --> 00:18:16,610 using these remaining three cards, 351 00:18:16,610 --> 00:18:19,160 what's the biggest number that I could encode? 352 00:18:19,160 --> 00:18:20,270 I mean, in-- 353 00:18:20,270 --> 00:18:25,240 I need to encode lots of numbers, right? 354 00:18:25,240 --> 00:18:27,970 So what's the biggest number that I could encode here? 355 00:18:27,970 --> 00:18:30,700 If I had six permutations, and I start with one, 356 00:18:30,700 --> 00:18:35,110 the biggest number that I could encode is a 6, right? 357 00:18:35,110 --> 00:18:40,240 Sadly, the Jack is too far away from the two, right? 358 00:18:40,240 --> 00:18:45,130 If I think of the Jack as being an 11, it's 9 away from the 2, 359 00:18:45,130 --> 00:18:46,040 right? 360 00:18:46,040 --> 00:18:50,030 But help me out here, what could I do? 361 00:18:50,030 --> 00:18:53,704 If I flipped it, what happens? 362 00:18:53,704 --> 00:18:55,150 AUDIENCE: Count backwards 363 00:18:55,150 --> 00:18:56,858 SRINI DEVADAS: You could count backwards. 364 00:18:56,858 --> 00:18:59,007 Or what do I have up there on the board? 365 00:18:59,007 --> 00:19:00,590 What do you see up there on the board? 366 00:19:04,684 --> 00:19:06,100 I wrote something that was linear, 367 00:19:06,100 --> 00:19:10,050 but what do I have up there on the left? 368 00:19:10,050 --> 00:19:13,750 Circular, so you think mod, mod arithmetic you know, think 369 00:19:13,750 --> 00:19:16,180 of this as being circular, OK? 370 00:19:16,180 --> 00:19:26,050 So what happens is that, if I picked a 2 and a Jack, if I-- 371 00:19:26,050 --> 00:19:28,390 what I want to do is to go clockwise. 372 00:19:28,390 --> 00:19:36,980 OK and because there are only 13 cards, for any pair of cards, 373 00:19:36,980 --> 00:19:42,710 it's always the case that I can choose the first card in such 374 00:19:42,710 --> 00:19:46,280 a way that the hidden card is, at most, 6 375 00:19:46,280 --> 00:19:50,270 away from the first card, OK? 376 00:19:50,270 --> 00:19:54,380 Because you could get into a situation where, 377 00:19:54,380 --> 00:19:59,630 obviously, if I ended up hiding the Jack and exposing the 2, 378 00:19:59,630 --> 00:20:03,170 I end up getting a 9, which is impossible to encode. 379 00:20:03,170 --> 00:20:10,810 But if I hide the 2 and expose the Jack, then I go 1, 2, 3, 4, 380 00:20:10,810 --> 00:20:14,540 and I am at, basically, 4, OK? 381 00:20:14,540 --> 00:20:16,520 So that's the last thing. 382 00:20:16,520 --> 00:20:18,080 So let's just do this really quickly 383 00:20:18,080 --> 00:20:22,100 with yet another set of five cards. 384 00:20:22,100 --> 00:20:25,590 Now obviously we practiced so we could do this fairly quickly, 385 00:20:25,590 --> 00:20:26,090 right? 386 00:20:26,090 --> 00:20:29,600 But-- and you can practice too, but sometimes with things you 387 00:20:29,600 --> 00:20:33,196 get lucky, you know, and you get easy things to encode. 388 00:20:33,196 --> 00:20:34,070 So what happens here? 389 00:20:34,070 --> 00:20:37,550 Someone wants to-- so now that you know the algorithm, 390 00:20:37,550 --> 00:20:40,700 you have some choices here, but obviously you have-- 391 00:20:40,700 --> 00:20:41,960 not all choices would work. 392 00:20:41,960 --> 00:20:43,790 You've got to be a little bit careful. 393 00:20:43,790 --> 00:20:47,920 What would you hide? 394 00:20:47,920 --> 00:20:50,570 So you need to make sure that you get-- 395 00:20:50,570 --> 00:20:52,202 you can choose a pair of-- 396 00:20:52,202 --> 00:20:53,660 I'll make this a little bit easier. 397 00:20:58,600 --> 00:21:04,390 Sometimes choices make things more difficult. 398 00:21:04,390 --> 00:21:08,700 Perfect, all right, so what you see here is-- 399 00:21:08,700 --> 00:21:10,930 you know that you have to do the clubs now, 400 00:21:10,930 --> 00:21:15,520 because you have the clubs as being the suit that's repeated. 401 00:21:15,520 --> 00:21:17,920 No other suits are repeated, right? 402 00:21:17,920 --> 00:21:20,590 So what am I going to expose? 403 00:21:20,590 --> 00:21:22,330 And what am I going to hide? 404 00:21:22,330 --> 00:21:25,250 That's your first question, right? 405 00:21:25,250 --> 00:21:27,560 Someone else? 406 00:21:27,560 --> 00:21:29,560 You guys are all going to have to do this trick. 407 00:21:29,560 --> 00:21:31,870 That's the final exam for this class. 408 00:21:31,870 --> 00:21:36,850 On Friday next week, you're all doing the trick-- no. 409 00:21:36,850 --> 00:21:38,720 So what am I going to-- 410 00:21:38,720 --> 00:21:39,670 yeah, go ahead, Josh? 411 00:21:39,670 --> 00:21:42,923 AUDIENCE: You are going to hide the Ace, the King of Clubs 412 00:21:42,923 --> 00:21:44,150 would be the first card. 413 00:21:44,150 --> 00:21:46,608 SRINI DEVADAS: You're going to hide the Ace, exactly right. 414 00:21:46,608 --> 00:21:48,350 You want to hide the Ace, because you 415 00:21:48,350 --> 00:21:49,527 want to go this way. 416 00:21:49,527 --> 00:21:52,110 And if you do it the other way around, it's not going to work. 417 00:21:52,110 --> 00:21:53,318 You're going to hide the Ace. 418 00:21:53,318 --> 00:21:58,050 And you're going to make the King the first card. 419 00:21:58,050 --> 00:22:02,780 And now, what you need to do is-- this is gone, right? 420 00:22:02,780 --> 00:22:05,210 And now what I need to do is, I need 421 00:22:05,210 --> 00:22:10,760 to encode a number between 1 and 6, in general. 422 00:22:10,760 --> 00:22:14,480 In this case, I need to encode the number 1 in order 423 00:22:14,480 --> 00:22:19,430 to give away the fact that the hidden card is an ace. 424 00:22:19,430 --> 00:22:23,310 And now I could do what was suggested before, 425 00:22:23,310 --> 00:22:25,670 which is have some sort of-- 426 00:22:25,670 --> 00:22:27,830 I mean, there's obviously an ordering 427 00:22:27,830 --> 00:22:32,000 associated with these cards that you see up here. 428 00:22:32,000 --> 00:22:34,940 If I call this a 1 and I call this a 13, 429 00:22:34,940 --> 00:22:37,850 then lets do the logical thing, which 430 00:22:37,850 --> 00:22:40,880 is, 1 is smaller than 2, which is smaller than 13, 431 00:22:40,880 --> 00:22:42,200 but I might end up-- 432 00:22:42,200 --> 00:22:44,750 I might have and Nine of Hearts here 433 00:22:44,750 --> 00:22:46,490 rather than a Five of Hearts. 434 00:22:46,490 --> 00:22:50,750 And I got to, obviously, be able to order the Nine of Hearts 435 00:22:50,750 --> 00:22:54,110 in relation to the Five of Hearts as well, so-- 436 00:22:54,110 --> 00:22:56,900 because I-- all of these could be nines actually, right? 437 00:22:56,900 --> 00:23:01,790 And so I can't just rely on the number to do the ordering, 438 00:23:01,790 --> 00:23:04,670 so I can just choose an arbitrary-- 439 00:23:04,670 --> 00:23:09,200 clubs is smallest. 440 00:23:09,200 --> 00:23:12,980 Diamonds is the next. 441 00:23:12,980 --> 00:23:15,680 And then I got Hearts. 442 00:23:15,680 --> 00:23:18,560 I just did this because this is a little bit 443 00:23:18,560 --> 00:23:20,570 easy to remember for me. 444 00:23:20,570 --> 00:23:22,550 You can do this in many different ways, 445 00:23:22,550 --> 00:23:26,960 in alphabetical order, you know, C-D-H-S. 446 00:23:26,960 --> 00:23:30,410 And so this-- that's moot here. 447 00:23:30,410 --> 00:23:33,810 What I need to do is to encode the number one, OK? 448 00:23:33,810 --> 00:23:36,440 But I encoded-- in order to encode the number one, 449 00:23:36,440 --> 00:23:39,320 I have to have some sort of way of ordering this. 450 00:23:39,320 --> 00:23:44,250 And so what I'm going to do is, I'm going to say SLM is one. 451 00:23:44,250 --> 00:23:46,460 So what do I mean by SLM? 452 00:23:46,460 --> 00:23:51,740 The smallest card is first-- 453 00:23:51,740 --> 00:23:55,390 I'm sorry, SML is-- 454 00:23:55,390 --> 00:23:58,170 increasing. 455 00:23:58,170 --> 00:24:01,320 The smallest card is the first one. 456 00:24:01,320 --> 00:24:03,670 The medium card is the second one. 457 00:24:03,670 --> 00:24:06,960 And the largest card is the third one, OK? 458 00:24:06,960 --> 00:24:08,800 And I'll write this out. 459 00:24:08,800 --> 00:24:10,390 And you can see the code for it. 460 00:24:10,390 --> 00:24:15,300 But when you see something like LMS, you're going to get a six. 461 00:24:15,300 --> 00:24:18,010 And there's obviously six of these different combinations, 462 00:24:18,010 --> 00:24:18,840 right? 463 00:24:18,840 --> 00:24:21,340 The details are actually entirely up to you. 464 00:24:21,340 --> 00:24:23,040 I mean, the most important thing here 465 00:24:23,040 --> 00:24:27,210 is the ordering that Billy had had to be ordering that I had. 466 00:24:27,210 --> 00:24:28,710 And so yesterday when we practiced, 467 00:24:28,710 --> 00:24:30,690 one time, there was a mismatch. 468 00:24:30,690 --> 00:24:32,040 And we got it wrong. 469 00:24:32,040 --> 00:24:36,090 But that's the only way the trick would fail, 470 00:24:36,090 --> 00:24:39,250 really, I mean, other than human error, is if the-- 471 00:24:39,250 --> 00:24:40,680 is the encoding. 472 00:24:40,680 --> 00:24:43,110 This is really encoding followed by decoding. 473 00:24:43,110 --> 00:24:47,950 And obviously, you need the same algorithm, if you will, 474 00:24:47,950 --> 00:24:52,290 which requires that you need the same ordering, in this case, 475 00:24:52,290 --> 00:24:53,990 for the cards, right? 476 00:24:53,990 --> 00:24:55,200 So that's it. 477 00:24:55,200 --> 00:24:57,710 That's the trick. 478 00:24:57,710 --> 00:25:00,900 It doesn't seem that interesting anymore, huh? 479 00:25:00,900 --> 00:25:03,570 But no, it is interesting if you show it to people. 480 00:25:03,570 --> 00:25:07,570 And the fun part is in actually doing it. 481 00:25:07,570 --> 00:25:10,570 So I encourage you all to do it. 482 00:25:10,570 --> 00:25:12,730 Any questions about how this trick works? 483 00:25:15,380 --> 00:25:20,740 So what I'd like to do is show you some code for this trick. 484 00:25:20,740 --> 00:25:25,150 And there's also a code that was useful to both of us, 485 00:25:25,150 --> 00:25:27,087 because we could practice by ourselves. 486 00:25:27,087 --> 00:25:29,170 We didn't have to be in the same room to practice, 487 00:25:29,170 --> 00:25:32,830 because I could randomly generate a bunch of these four 488 00:25:32,830 --> 00:25:33,400 cards. 489 00:25:33,400 --> 00:25:36,070 And obviously, the program knew what the hidden card was. 490 00:25:36,070 --> 00:25:36,930 And I could-- 491 00:25:36,930 --> 00:25:38,022 I'll show you the code. 492 00:25:38,022 --> 00:25:39,730 I could type in what the hidden card was. 493 00:25:39,730 --> 00:25:41,980 And it would say-- you know, I guess it would say, 494 00:25:41,980 --> 00:25:45,280 you're a mind reader extraordinaire, or sorry, 495 00:25:45,280 --> 00:25:46,330 not impressed. 496 00:25:46,330 --> 00:25:47,920 And Billy could do the same thing 497 00:25:47,920 --> 00:25:50,740 in terms of checking his encoding, all right? 498 00:25:50,740 --> 00:25:54,510 And then, after we're done here talking about the code-- 499 00:25:54,510 --> 00:25:58,060 and there are some interesting things with the code-- 500 00:25:58,060 --> 00:26:00,809 let's talk about whether you could-- 501 00:26:00,809 --> 00:26:02,350 talk about different kinds of tricks. 502 00:26:02,350 --> 00:26:03,975 And in particular, I want to talk about 503 00:26:03,975 --> 00:26:05,710 whether we could go from five cards 504 00:26:05,710 --> 00:26:11,310 to four cards using a different encoding scheme. 505 00:26:11,310 --> 00:26:19,700 Cool, so I wrote this code about a year ago. 506 00:26:19,700 --> 00:26:24,760 And I think I'd probably write it differently now, 507 00:26:24,760 --> 00:26:28,440 but we have what we have. 508 00:26:28,440 --> 00:26:34,590 So the first thing is you have to decide on an order. 509 00:26:34,590 --> 00:26:36,360 You absolutely have to decide an order. 510 00:26:36,360 --> 00:26:41,190 And the cards themselves, as I mentioned, 511 00:26:41,190 --> 00:26:44,650 there's a natural order associated with the numbers. 512 00:26:44,650 --> 00:26:48,810 And of course, you can decide if you want to start with a two, 513 00:26:48,810 --> 00:26:51,660 and then the ace could be 14-- 514 00:26:51,660 --> 00:26:54,822 I mean, kind of makes sense for you to go 1 through 13. 515 00:26:54,822 --> 00:26:56,280 So that's really what we have here. 516 00:26:56,280 --> 00:26:57,690 The ace is the smallest card. 517 00:26:57,690 --> 00:26:59,580 And the King is the biggest card. 518 00:26:59,580 --> 00:27:03,000 And as I mentioned, the clubs are smaller 519 00:27:03,000 --> 00:27:04,500 than the diamonds, et cetera. 520 00:27:04,500 --> 00:27:07,500 So I just have a deck of cards that 521 00:27:07,500 --> 00:27:09,570 is ordered as you see up there. 522 00:27:09,570 --> 00:27:11,370 And that's just a Python list that 523 00:27:11,370 --> 00:27:13,886 tells you what the ordering of these 52 cards are. 524 00:27:13,886 --> 00:27:14,760 Does that make sense? 525 00:27:18,580 --> 00:27:24,910 So there's many procedures here, many routines 526 00:27:24,910 --> 00:27:26,260 that do different things. 527 00:27:26,260 --> 00:27:27,890 And a lot of them use the same code, 528 00:27:27,890 --> 00:27:30,200 so I'm not going explain each one of them. 529 00:27:30,200 --> 00:27:32,270 But this one is a good one. 530 00:27:32,270 --> 00:27:35,260 And I'll also show you the computer assistant 531 00:27:35,260 --> 00:27:39,730 one, which is essentially this procedure except that it 532 00:27:39,730 --> 00:27:40,460 allows-- 533 00:27:40,460 --> 00:27:44,950 allowed me to practice by myself and generated cards randomly. 534 00:27:44,950 --> 00:27:48,940 In this case, what happens is, you input five cards. 535 00:27:48,940 --> 00:27:51,040 And what this does is-- 536 00:27:51,040 --> 00:27:53,800 so you could sort of take five cards out from the deck. 537 00:27:53,800 --> 00:27:58,360 And then manually, you can choose the hidden card, 538 00:27:58,360 --> 00:28:00,190 order the remaining four. 539 00:28:00,190 --> 00:28:02,740 And if you typed in those five cards 540 00:28:02,740 --> 00:28:05,110 into this particular procedure, it 541 00:28:05,110 --> 00:28:07,210 would give you the first four cards, OK? 542 00:28:07,210 --> 00:28:10,096 And so you can then verify that you've done the ordering. 543 00:28:10,096 --> 00:28:11,470 So this would be something that-- 544 00:28:11,470 --> 00:28:14,095 I don't know if Billy used this to practice, but he could have. 545 00:28:16,050 --> 00:28:17,920 So what do I have here? 546 00:28:17,920 --> 00:28:20,730 Well, the first thing is just printing out what the order is. 547 00:28:20,730 --> 00:28:23,580 There's a bunch of things that need to get initialized. 548 00:28:23,580 --> 00:28:28,830 Cards is simply a list of five cards. 549 00:28:28,830 --> 00:28:31,800 And then you have c index, or cind, 550 00:28:31,800 --> 00:28:35,670 which is the indices in that giant list 551 00:28:35,670 --> 00:28:39,004 that we have that had 52 cards in it. 552 00:28:39,004 --> 00:28:40,920 They're just the indices of the various cards. 553 00:28:40,920 --> 00:28:46,740 You can use .index, which is a method to go from a card, 554 00:28:46,740 --> 00:28:51,480 which is like a_c, for example, to the index. 555 00:28:51,480 --> 00:28:54,900 And then card suits are what suits are for the cards. 556 00:28:54,900 --> 00:28:58,830 And it's 0, 1, 2, and 3 for clubs, diamonds, et cetera. 557 00:28:58,830 --> 00:29:01,440 And then the numbers are what the numbers of the cards 558 00:29:01,440 --> 00:29:03,480 are, 1 through 13, OK? 559 00:29:03,480 --> 00:29:04,340 You kind of need-- 560 00:29:04,340 --> 00:29:05,631 there's a bunch of bookkeeping. 561 00:29:05,631 --> 00:29:08,820 As you can imagine, we're doing things in our head here, 562 00:29:08,820 --> 00:29:11,430 but if you want to get a computer program to actually do 563 00:29:11,430 --> 00:29:14,440 all of these computations, it's not complicated, 564 00:29:14,440 --> 00:29:16,380 but you have to worry about the four suits. 565 00:29:16,380 --> 00:29:18,330 And you've got to worry about the 13 cards. 566 00:29:18,330 --> 00:29:22,320 And you have to go ahead and encode SML, or produce 567 00:29:22,320 --> 00:29:23,280 this encoding, right? 568 00:29:23,280 --> 00:29:25,071 So you can imagine there's a bunch of code. 569 00:29:25,071 --> 00:29:28,951 It's not complicated code, but there's a bunch of code. 570 00:29:28,951 --> 00:29:30,450 So the first thing that happens here 571 00:29:30,450 --> 00:29:34,170 is, in this particular procedure, 572 00:29:34,170 --> 00:29:36,467 you want to input put these cards in. 573 00:29:36,467 --> 00:29:37,550 And so let me just run it. 574 00:29:37,550 --> 00:29:41,530 And so you get a sense of what this procedure does. 575 00:29:41,530 --> 00:29:42,810 All right, beautiful. 576 00:29:42,810 --> 00:29:45,360 So let's just say-- 577 00:29:45,360 --> 00:29:48,880 let me just pick five of these here. 578 00:29:48,880 --> 00:29:51,860 So the first one is Five of Hearts-- 579 00:29:51,860 --> 00:29:55,620 I'm sorry, Five of Hearts, yup, Five of Hearts, 580 00:29:55,620 --> 00:30:06,296 Nine of Diamonds, Jack of Spades, Ten of Hearts, 581 00:30:06,296 --> 00:30:07,990 Eight of Hearts. 582 00:30:07,990 --> 00:30:12,540 And so it essentially says the first-- 583 00:30:12,540 --> 00:30:14,380 so if I have something like this, 584 00:30:14,380 --> 00:30:23,990 it ended up choosing the Ten as the hidden card, 585 00:30:23,990 --> 00:30:28,520 and decided to choose Five as the first one. 586 00:30:28,520 --> 00:30:30,920 And then because Ten was the hidden card, 587 00:30:30,920 --> 00:30:33,470 you needed to encode 5, right? 588 00:30:33,470 --> 00:30:43,910 And so the way you encode 5 is by encoding L S and M. 589 00:30:43,910 --> 00:30:49,520 So the first card that should be up 590 00:30:49,520 --> 00:30:53,990 is a Jack, followed by the smallest card, 591 00:30:53,990 --> 00:30:56,760 which is an Eight, followed by a Nine. 592 00:30:56,760 --> 00:30:58,770 So that's essentially it. 593 00:30:58,770 --> 00:31:01,649 So now that you've seen that, let's take a look. 594 00:31:01,649 --> 00:31:03,815 I'm not going to go through every line of code here, 595 00:31:03,815 --> 00:31:09,140 but I want to point out a couple of things that are interesting. 596 00:31:09,140 --> 00:31:13,070 This is simply filling in the data structures. 597 00:31:13,070 --> 00:31:14,719 The only thing that's interesting here, 598 00:31:14,719 --> 00:31:16,760 or the thing that's probably the most interesting 599 00:31:16,760 --> 00:31:18,620 here is what I've highlighted. 600 00:31:18,620 --> 00:31:24,020 This is a way of taking an element in a Python list 601 00:31:24,020 --> 00:31:25,680 and getting the index for it. 602 00:31:25,680 --> 00:31:27,620 And so that's essentially something that-- 603 00:31:27,620 --> 00:31:29,670 it's object-oriented programming. 604 00:31:29,670 --> 00:31:33,560 We probably want to get into that in this class, 605 00:31:33,560 --> 00:31:38,040 but you'll definitely see that in 009 and other classes. 606 00:31:38,040 --> 00:31:40,640 And essentially, what we have here, given the ordering, 607 00:31:40,640 --> 00:31:49,640 is the suits simply correspond to whatever the indexes mod 4. 608 00:31:49,640 --> 00:31:52,180 Because, as you can see from this, 609 00:31:52,180 --> 00:31:58,070 the clubs are-- this is 0, the index 0, and the club 610 00:31:58,070 --> 00:32:02,870 is index 0, 1, 2, 3, 4. 611 00:32:02,870 --> 00:32:05,590 So you're going to get mod of clubs 612 00:32:05,590 --> 00:32:07,730 is always going to be-- mod 4 of clubs 613 00:32:07,730 --> 00:32:08,880 is always going to be a 0. 614 00:32:08,880 --> 00:32:12,800 Mod 4 of diamonds is always going to be a 1, et cetera, 615 00:32:12,800 --> 00:32:14,850 so that's essentially what happens here. 616 00:32:14,850 --> 00:32:17,490 And the first thing I need to do is figure out 617 00:32:17,490 --> 00:32:21,020 two a card that have the same suit, because that's important, 618 00:32:21,020 --> 00:32:24,560 because that's going to determine what my first card is 619 00:32:24,560 --> 00:32:25,880 and what my hidden cards are. 620 00:32:25,880 --> 00:32:28,160 And that's what happens over here. 621 00:32:28,160 --> 00:32:30,730 And then once I have that, I need-- 622 00:32:30,730 --> 00:32:34,490 I've just got to split these five cards into two piles, one 623 00:32:34,490 --> 00:32:37,760 of which has the hidden and the first card in it, 624 00:32:37,760 --> 00:32:40,550 and the other pile has the three cards that correspond 625 00:32:40,550 --> 00:32:41,654 to the ordering in it. 626 00:32:41,654 --> 00:32:43,070 Obviously, the computations that I 627 00:32:43,070 --> 00:32:45,500 have to do for the first couple are 628 00:32:45,500 --> 00:32:49,250 quite different from the ones for the remaining three cards. 629 00:32:49,250 --> 00:32:50,380 In one case, it's ordering. 630 00:32:50,380 --> 00:32:52,160 In the other case, it's a comparison. 631 00:32:52,160 --> 00:32:54,794 And I do have to-- the most interesting remaining part 632 00:32:54,794 --> 00:32:56,210 of the code that I'm going to show 633 00:32:56,210 --> 00:33:00,110 you is the determination of what the hidden card is 634 00:33:00,110 --> 00:33:01,550 and what the first card is. 635 00:33:01,550 --> 00:33:03,090 And that's going require-- 636 00:33:03,090 --> 00:33:05,600 this is the part that actually took me the longest to code. 637 00:33:05,600 --> 00:33:07,370 I got it wrong a couple of times. 638 00:33:07,370 --> 00:33:08,905 It's going to require me-- 639 00:33:08,905 --> 00:33:10,840 it's five lines of code, but it's subtle. 640 00:33:10,840 --> 00:33:13,250 It's going to require me to kind of figure out 641 00:33:13,250 --> 00:33:17,510 whether it's a jack versus two, you know, or vice versa. 642 00:33:17,510 --> 00:33:19,790 And things get a little bit interesting. 643 00:33:19,790 --> 00:33:20,856 For example, if you had-- 644 00:33:23,360 --> 00:33:31,250 if it wasn't the Jack and the Two, the example I had here, 645 00:33:31,250 --> 00:33:33,160 so let's do this-- put the Jack and Two. 646 00:33:33,160 --> 00:33:36,580 Let's say I had a Three and a Ten, right? 647 00:33:36,580 --> 00:33:38,800 They're kind of the furthest apart. 648 00:33:38,800 --> 00:33:42,070 And you had to be kind of super careful here, because 3 to 10 649 00:33:42,070 --> 00:33:45,130 is obviously 7, which is too large, 650 00:33:45,130 --> 00:33:47,720 but you need to go 10 to 3, which is 6, right? 651 00:33:47,720 --> 00:33:49,840 So the things that are diametrically 652 00:33:49,840 --> 00:33:52,120 opposite to each other are usually 653 00:33:52,120 --> 00:33:55,570 the hardest when it comes to actually doing the trick, 654 00:33:55,570 --> 00:33:58,210 but it's also hard from a standpoint of coding. 655 00:33:58,210 --> 00:34:01,120 I had to get the mods right, and the subtraction, 656 00:34:01,120 --> 00:34:05,420 and in terms of what got subtracted from the other. 657 00:34:05,420 --> 00:34:07,540 So the rest of it is-- 658 00:34:07,540 --> 00:34:09,949 I just have high level descriptions. 659 00:34:09,949 --> 00:34:13,900 Obviously, the code for these individual subroutines 660 00:34:13,900 --> 00:34:17,260 is in the file as well, but this one determines what's hidden, 661 00:34:17,260 --> 00:34:20,320 what the other card is, and what the number that you 662 00:34:20,320 --> 00:34:21,370 need to encode is. 663 00:34:21,370 --> 00:34:24,610 So when you go do the split, and you have the two cards, 664 00:34:24,610 --> 00:34:27,317 you obviously need to decide which one goes first, 665 00:34:27,317 --> 00:34:28,150 which one is hidden. 666 00:34:28,150 --> 00:34:29,860 And you also get the number. 667 00:34:29,860 --> 00:34:32,250 And that number had better be between 1 and 6, 668 00:34:32,250 --> 00:34:35,510 otherwise this is not going to work. 669 00:34:35,510 --> 00:34:38,515 And then you remove the other-- 670 00:34:38,515 --> 00:34:44,739 the two cards hidden in other from the set of five cards. 671 00:34:44,739 --> 00:34:49,030 In order to actually do this SML, 672 00:34:49,030 --> 00:34:53,230 it was a little easier for me to sort these cards. 673 00:34:53,230 --> 00:34:56,080 And then, depending on the number and code, 674 00:34:56,080 --> 00:34:57,550 I'd change the order. 675 00:34:57,550 --> 00:35:00,430 Obviously, if I sort the cards, I'm going to get SML. 676 00:35:00,430 --> 00:35:03,670 And that may not be what I want, but it's easier 677 00:35:03,670 --> 00:35:06,100 to start with SML, saying, this is 678 00:35:06,100 --> 00:35:09,430 the order that gave me the number 1 as an encoding. 679 00:35:09,430 --> 00:35:12,310 What do I need to do in order to change that encoding to a 2, 680 00:35:12,310 --> 00:35:14,650 or 5, or a 6, or what have you? 681 00:35:14,650 --> 00:35:18,660 OK, and so that's what this outputNext3Cards does. 682 00:35:21,650 --> 00:35:23,961 This is what took me the longest to code. 683 00:35:23,961 --> 00:35:25,960 I mean, it was a few minutes, but the rest of it 684 00:35:25,960 --> 00:35:29,320 was pretty much busywork. 685 00:35:29,320 --> 00:35:31,340 There wasn't too much thinking. 686 00:35:31,340 --> 00:35:36,890 So this thing here, as you can see, the encode is done-- 687 00:35:36,890 --> 00:35:40,970 you don't need to worry too much about the list itself, 688 00:35:40,970 --> 00:35:42,350 and the indexing into it. 689 00:35:42,350 --> 00:35:47,540 The bottom line is I need to figure out this situation. 690 00:35:47,540 --> 00:35:49,990 And I need to subtract. 691 00:35:49,990 --> 00:35:54,670 And so when I see something that says 10 and a 3, 692 00:35:54,670 --> 00:35:57,160 I end up getting a 7. 693 00:35:57,160 --> 00:36:00,310 And then I know that I have to do a flip, OK? 694 00:36:00,310 --> 00:36:03,900 But it also may be the case that I might get something that-- 695 00:36:06,430 --> 00:36:12,280 the reason I need the mod 13 is partly because I might end up 696 00:36:12,280 --> 00:36:13,990 getting a negative number. 697 00:36:13,990 --> 00:36:18,190 So it's not clear that encode, take away the mod 13, 698 00:36:18,190 --> 00:36:20,410 is going to give me a positive number. 699 00:36:20,410 --> 00:36:26,200 I might be subtracting 9 from 2, so I end up getting a minus 7. 700 00:36:26,200 --> 00:36:27,670 So you don't know this. 701 00:36:27,670 --> 00:36:29,989 I mean, the program doesn't know which one is which. 702 00:36:29,989 --> 00:36:31,780 And it has to figure out which one is which 703 00:36:31,780 --> 00:36:33,150 and flip them together. 704 00:36:33,150 --> 00:36:36,770 So if there's any code that you want to look at carefully, 705 00:36:36,770 --> 00:36:38,470 it's this code. 706 00:36:38,470 --> 00:36:40,302 And it's just a matter of sort of going 707 00:36:40,302 --> 00:36:42,010 through the combinations and making sure. 708 00:36:42,010 --> 00:36:45,330 I know it works, but you need to convince yourself it works. 709 00:36:45,330 --> 00:36:47,625 So that's pretty much it. 710 00:36:47,625 --> 00:36:50,950 There's not much more to say here 711 00:36:50,950 --> 00:36:56,560 that wouldn't be obvious to you looking at it carefully, 712 00:36:56,560 --> 00:36:59,730 so I don't want to belabor the obvious. 713 00:36:59,730 --> 00:37:03,920 And outputNext3Cards is the part that I just described. 714 00:37:03,920 --> 00:37:07,210 You start with the default ordering, which encodes a 1. 715 00:37:07,210 --> 00:37:09,400 And then you need to do a little bit of flopping, 716 00:37:09,400 --> 00:37:12,130 if you want to encode a 3, for example. 717 00:37:12,130 --> 00:37:13,840 And if you want to encode a 3, then you'd 718 00:37:13,840 --> 00:37:15,280 change things around. 719 00:37:15,280 --> 00:37:17,480 And this is exactly what I described to you before. 720 00:37:17,480 --> 00:37:19,760 So this is actually fairly straightforward. 721 00:37:19,760 --> 00:37:21,880 If you have that table written in front of you, 722 00:37:21,880 --> 00:37:25,420 you just go off it and write that. 723 00:37:25,420 --> 00:37:28,660 Certainly if you change the algorithm, all of this 724 00:37:28,660 --> 00:37:30,270 would change quite dramatically. 725 00:37:30,270 --> 00:37:34,660 And there's an exercise which asks 726 00:37:34,660 --> 00:37:39,400 you to do that, which you could certainly try to do. 727 00:37:39,400 --> 00:37:42,940 I want to show you one other thing, which is interesting. 728 00:37:42,940 --> 00:37:47,780 And then I want to run this new subroutine. 729 00:37:47,780 --> 00:37:51,230 So what I have here is, I'm going 730 00:37:51,230 --> 00:37:53,260 to run-- oh, I've already run it. 731 00:37:53,260 --> 00:37:57,820 So I want to show you computer assistant. 732 00:37:57,820 --> 00:37:59,230 It was very useful to me. 733 00:38:04,036 --> 00:38:05,910 And this says, please give me a random number 734 00:38:05,910 --> 00:38:07,680 of at least six digits. 735 00:38:07,680 --> 00:38:12,000 So obviously, I don't want to know 736 00:38:12,000 --> 00:38:13,980 what the hidden card is if I want to practice 737 00:38:13,980 --> 00:38:16,790 in a legitimate way. 738 00:38:16,790 --> 00:38:18,510 So what I did was, I said, I'm going 739 00:38:18,510 --> 00:38:19,677 to have this sort of hokey-- 740 00:38:19,677 --> 00:38:20,759 I mean, it's really hokey. 741 00:38:20,759 --> 00:38:22,650 I'm going to have this hokey algorithm that's 742 00:38:22,650 --> 00:38:26,490 going to take this giant number that, I'm going to type in. 743 00:38:26,490 --> 00:38:28,890 And it's somehow going to take this giant number. 744 00:38:28,890 --> 00:38:34,020 And it's going to deterministically generate 745 00:38:34,020 --> 00:38:38,582 5 cards based on this giant number, 746 00:38:38,582 --> 00:38:40,290 but I didn't want to have an obvious way. 747 00:38:40,290 --> 00:38:45,296 I mean, I don't want to say the number 12345 748 00:38:45,296 --> 00:38:47,670 and then end up getting the first five cards in the deck, 749 00:38:47,670 --> 00:38:49,200 or something like that, because that would sort of give it 750 00:38:49,200 --> 00:38:50,040 away right. 751 00:38:50,040 --> 00:38:53,610 So I want to have some sort of obfuscated way of taking 752 00:38:53,610 --> 00:38:56,490 a giant number and generating something that 753 00:38:56,490 --> 00:38:59,310 was at least unpredictable to me in terms of the five cards 754 00:38:59,310 --> 00:39:00,960 that are generated. 755 00:39:00,960 --> 00:39:04,940 And so what I do is, if I type in a number, 756 00:39:04,940 --> 00:39:06,480 some random number. 757 00:39:06,480 --> 00:39:08,580 And at this point, I have no idea 758 00:39:08,580 --> 00:39:13,020 what the five cards that are going to be generated are. 759 00:39:13,020 --> 00:39:17,950 And this just tell me-- it does do the assistant order 760 00:39:17,950 --> 00:39:20,670 the cards functionality, so it does take those five 761 00:39:20,670 --> 00:39:25,590 cards, hides a card, and then exposes the four cards to me. 762 00:39:25,590 --> 00:39:27,330 And so I'd get different-- depending 763 00:39:27,330 --> 00:39:28,380 on what number I type. 764 00:39:28,380 --> 00:39:31,800 So the way I'd practice is I'd just sort of 765 00:39:31,800 --> 00:39:34,170 close my eyes and just type some random number. 766 00:39:34,170 --> 00:39:36,220 And then it would produce four cards for me. 767 00:39:36,220 --> 00:39:39,830 And notice that this is wonderful. 768 00:39:39,830 --> 00:39:41,550 Notice that there's a bug, right? 769 00:39:41,550 --> 00:39:43,980 This is exactly why I put this up. 770 00:39:43,980 --> 00:39:49,222 And wow what luck, so notice that this didn't work. 771 00:39:49,222 --> 00:39:50,430 You know, and that's the fix. 772 00:39:50,430 --> 00:39:51,690 That's an exercise. 773 00:39:51,690 --> 00:39:53,280 I'm not-- I kid you not. 774 00:39:53,280 --> 00:39:56,130 It's an exercise that's going to be 775 00:39:56,130 --> 00:39:59,970 up there, which is fix my hokey algorithm so it doesn't 776 00:39:59,970 --> 00:40:01,470 do this. 777 00:40:01,470 --> 00:40:03,990 And so what happened here was, I had a deterministic way. 778 00:40:03,990 --> 00:40:05,890 This wasn't a random number generator. 779 00:40:05,890 --> 00:40:07,920 The good way of doing this would have 780 00:40:07,920 --> 00:40:12,630 been to use Python's random number generator facility 781 00:40:12,630 --> 00:40:15,690 and not have me do anything, because obviously I 782 00:40:15,690 --> 00:40:20,000 attached something that turned into that, which is a deck that 783 00:40:20,000 --> 00:40:22,620 has two King of Hearts in it. 784 00:40:22,620 --> 00:40:26,610 And so my deterministic way, which was a convenient way 785 00:40:26,610 --> 00:40:28,320 because it's only four lines of code 786 00:40:28,320 --> 00:40:35,100 didn't need me to include the Python random library, 787 00:40:35,100 --> 00:40:37,830 et cetera, causes trouble. 788 00:40:37,830 --> 00:40:39,730 So this obviously won't work. 789 00:40:39,730 --> 00:40:41,257 So I'll just type something. 790 00:40:41,257 --> 00:40:43,090 And it's going to say, sorry, not impressed. 791 00:40:43,090 --> 00:40:48,750 OK, not impressed with my guess and not impressed with my code, 792 00:40:48,750 --> 00:40:49,875 so let me do this again. 793 00:40:54,880 --> 00:40:58,150 And so let me just do that. 794 00:40:58,150 --> 00:40:59,140 And now-- what? 795 00:41:01,920 --> 00:41:04,290 Is this-- this is ridiculous. 796 00:41:04,290 --> 00:41:07,949 I mean, does my code even work? 797 00:41:07,949 --> 00:41:09,490 I'm going to blame it on my computer. 798 00:41:09,490 --> 00:41:12,370 I told you my laptop is acting up. 799 00:41:12,370 --> 00:41:12,870 OK. 800 00:41:16,940 --> 00:41:25,110 1111222-- ah-- thank you, all right, so now I see this. 801 00:41:25,110 --> 00:41:29,500 And I say Seven of Clubs, so that's the first card. 802 00:41:29,500 --> 00:41:30,990 So clearly, it's a clubs. 803 00:41:30,990 --> 00:41:35,160 And then Ten, King and Six, so Ten is medium. 804 00:41:35,160 --> 00:41:36,870 So I got medium, large-- 805 00:41:36,870 --> 00:41:38,910 MLS, right? 806 00:41:38,910 --> 00:41:41,370 So MLS, is-- 807 00:41:41,370 --> 00:41:43,200 MLS would be 4, right? 808 00:41:43,200 --> 00:41:47,950 So 4 would give me the Jack of Clubs, right? 809 00:41:47,950 --> 00:41:50,020 There you go. 810 00:41:50,020 --> 00:41:52,150 So this worked, OK? 811 00:41:52,150 --> 00:41:54,120 But now I want to show-- you the last thing 812 00:41:54,120 --> 00:41:55,370 I'll do is show you this code. 813 00:41:55,370 --> 00:41:58,050 And you guys should absolutely fix this code. 814 00:41:58,050 --> 00:42:01,200 It is clear what your exercise is. 815 00:42:01,200 --> 00:42:02,280 Or you could-- 816 00:42:02,280 --> 00:42:07,590 I do want to talk about doing this with four cards. 817 00:42:07,590 --> 00:42:12,750 So, as note is that, this is the offending line of code, OK? 818 00:42:12,750 --> 00:42:16,830 So what I did was, I wanted to generate five, kind of, 819 00:42:16,830 --> 00:42:19,530 random-looking numbers out of this giant number 820 00:42:19,530 --> 00:42:20,910 that I typed in, right? 821 00:42:20,910 --> 00:42:22,000 And I got lazy. 822 00:42:22,000 --> 00:42:24,310 And I was tired of this puzzle by the time 823 00:42:24,310 --> 00:42:26,050 I ended up coding it. 824 00:42:26,050 --> 00:42:27,620 So I just said, you know, I want-- 825 00:42:27,620 --> 00:42:32,194 I don't want to include random.lib from Python. 826 00:42:32,194 --> 00:42:33,360 I'm just going to take this. 827 00:42:33,360 --> 00:42:37,350 And I'm going to do some sort of iterative computation, where 828 00:42:37,350 --> 00:42:42,900 I'm generating what I think are random numbers between 1 and 52 829 00:42:42,900 --> 00:42:44,700 from this giant number that I typed in. 830 00:42:44,700 --> 00:42:46,986 And I'm going to do this five times. 831 00:42:46,986 --> 00:42:48,360 And what happened, as you saw, is 832 00:42:48,360 --> 00:42:50,910 that I generated the same number twice a couple of times, right? 833 00:42:50,910 --> 00:42:52,743 And that's why, obviously, the trick doesn't 834 00:42:52,743 --> 00:42:54,005 work in that case, right? 835 00:42:54,005 --> 00:42:55,380 What was interesting was, the way 836 00:42:55,380 --> 00:42:57,930 I found this bug was not the obvious way that we just 837 00:42:57,930 --> 00:42:58,590 saw here. 838 00:42:58,590 --> 00:43:04,410 It was actually something where the hidden card 839 00:43:04,410 --> 00:43:08,280 was the same as one of the four cards that was exposed. 840 00:43:08,280 --> 00:43:09,570 And I didn't know that, right? 841 00:43:09,570 --> 00:43:11,690 So I'm like, what? 842 00:43:11,690 --> 00:43:13,350 Why am I not getting this right? 843 00:43:13,350 --> 00:43:14,939 It kept saying, sorry, not impressed. 844 00:43:14,939 --> 00:43:17,355 And what it meant was, it wasn't impressed with my coding, 845 00:43:17,355 --> 00:43:20,400 not with my deductive skills. 846 00:43:20,400 --> 00:43:22,980 So it took me a while to figure this out. 847 00:43:22,980 --> 00:43:25,470 And you can fix it. 848 00:43:25,470 --> 00:43:28,440 OK, so that's it. 849 00:43:28,440 --> 00:43:30,900 Any questions about the-- what we've talked about, 850 00:43:30,900 --> 00:43:31,930 the puzzle, or the code? 851 00:43:34,860 --> 00:43:37,470 OK, so in the five minutes that we have left, 852 00:43:37,470 --> 00:43:38,970 let's talk about whether there would 853 00:43:38,970 --> 00:43:41,790 be a trick which would be perhaps even more 854 00:43:41,790 --> 00:43:46,110 impressive where we would only use four cards. 855 00:43:46,110 --> 00:43:50,880 So it would only be four cards that the audience selects. 856 00:43:50,880 --> 00:43:53,070 And we would-- 857 00:43:53,070 --> 00:43:56,640 Billy, I guess, would show me three cards. 858 00:43:56,640 --> 00:44:01,290 And I'd have to guess the fourth. 859 00:44:01,290 --> 00:44:04,080 Would that be possible? 860 00:44:04,080 --> 00:44:07,050 I mean, the numbers really don't work right, 861 00:44:07,050 --> 00:44:12,005 because that fourth card could be one out of-- 862 00:44:12,005 --> 00:44:13,380 I guess, if you show three cards, 863 00:44:13,380 --> 00:44:15,510 one of the 49 different possibilities. 864 00:44:15,510 --> 00:44:18,330 And it would be pretty difficult, right? 865 00:44:18,330 --> 00:44:25,560 You could think about something where-- 866 00:44:25,560 --> 00:44:27,620 the only way I could come up with 867 00:44:27,620 --> 00:44:29,304 was-- it required much more encoding, 868 00:44:29,304 --> 00:44:30,720 but I was thinking about something 869 00:44:30,720 --> 00:44:35,430 like this, where let's say I have these four cards, right? 870 00:44:35,430 --> 00:44:37,410 And let's even take-- let's say that they're 871 00:44:37,410 --> 00:44:39,977 all of different suits, right, because that's possible. 872 00:44:39,977 --> 00:44:41,810 The other thing that happens when you have-- 873 00:44:41,810 --> 00:44:43,860 when you only have four cards is they 874 00:44:43,860 --> 00:44:45,747 all four could be of different suits, right? 875 00:44:45,747 --> 00:44:46,830 That's certainly possible. 876 00:44:58,125 --> 00:44:58,750 What do I want? 877 00:44:58,750 --> 00:44:59,375 I want a heart. 878 00:44:59,375 --> 00:45:02,410 OK, good, so I have something like this. 879 00:45:02,410 --> 00:45:04,764 And now I'm in real trouble. 880 00:45:04,764 --> 00:45:06,430 I mean, clearly, anything that we talked 881 00:45:06,430 --> 00:45:08,410 about isn't going to work. 882 00:45:08,410 --> 00:45:14,830 So let's just say that I end up choosing one of these cards 883 00:45:14,830 --> 00:45:15,730 to hide, right? 884 00:45:15,730 --> 00:45:19,240 So this Ace is hidden, because it's not 885 00:45:19,240 --> 00:45:22,480 quite clear what I can do here, but bear 886 00:45:22,480 --> 00:45:24,590 with me for just a minute. 887 00:45:24,590 --> 00:45:28,390 So for argument's sake, let's say that now, at this point, 888 00:45:28,390 --> 00:45:31,240 I'm trying to get more information out of this. 889 00:45:31,240 --> 00:45:32,840 The ordering isn't going to help me. 890 00:45:32,840 --> 00:45:35,770 I mean, the ordering is going to help me a little bit, but what 891 00:45:35,770 --> 00:45:37,450 am I going to get, like 6-- 892 00:45:37,450 --> 00:45:40,030 1 through 6 from this? 893 00:45:40,030 --> 00:45:44,980 So I could say the first card is an anchor, OK? 894 00:45:44,980 --> 00:45:47,620 And so I'm going to expose this. 895 00:45:47,620 --> 00:45:51,002 So the only thing I could think of was, you could sort of do-- 896 00:45:51,002 --> 00:45:52,210 this is a little bit obvious. 897 00:45:52,210 --> 00:45:53,680 And I'm maybe giving things away. 898 00:45:53,680 --> 00:45:56,950 But depending on where you have the hidden card, 899 00:45:56,950 --> 00:46:01,660 and you can get more information based on the order 900 00:46:01,660 --> 00:46:04,510 in which you put these cards out and whether they're 901 00:46:04,510 --> 00:46:08,500 to the left or the right of this hidden card. 902 00:46:08,500 --> 00:46:10,210 So you'd need to do something like that. 903 00:46:10,210 --> 00:46:13,120 I mean, I haven't figured this out. 904 00:46:13,120 --> 00:46:18,970 At least, I can't think of a complete solution 905 00:46:18,970 --> 00:46:22,720 to this puzzle, but I do feel like that you 906 00:46:22,720 --> 00:46:26,110 can get some information, additional information based 907 00:46:26,110 --> 00:46:28,910 on whether you put things to the left or the right. 908 00:46:28,910 --> 00:46:31,780 And that's clearly a bit of information that you get. 909 00:46:31,780 --> 00:46:33,520 And maybe you could add to that. 910 00:46:33,520 --> 00:46:36,050 And you know, think about it. 911 00:46:36,050 --> 00:46:38,896 I think it makes for an interesting exercise. 912 00:46:38,896 --> 00:46:40,270 And obviously, there's other ways 913 00:46:40,270 --> 00:46:43,650 of doing the five-card trick, as well. 914 00:46:43,650 --> 00:46:46,690 Cool, all right, that's all I had for today. 915 00:46:46,690 --> 00:46:49,060 If there are no questions, we can 916 00:46:49,060 --> 00:46:51,620 close this particular session.