0:00:22.038,0:00:24.606 After breaking Ethic out of prison, 0:00:24.606,0:00:27.821 Hedge flies them both towards [br]a frontier settlement 0:00:27.821,0:00:34.641 in the shadow of the Bradbarrier, [br]the great wall that encircles the nation. 0:00:34.641,0:00:38.973 All the settlers there will soon gather [br]for the monthly feeding. 0:00:38.973,0:00:43.188 The people of the wall spend their days [br]gathering up works of art and literature, 0:00:43.188,0:00:45.788 from all across the land. 0:00:45.788,0:00:50.378 On feeding day, the furnace-bots arrive, [br]ravenous. 0:00:50.378,0:00:56.119 If they eat, the lights stay on, [br]and the food gets delivered. 0:00:56.119,0:00:59.409 If they starve, the people do too. 0:01:00.954,0:01:05.934 Hedge’s fuel supply runs out just as he [br]and Ethic reach the outskirts of town, 0:01:05.934,0:01:08.732 and they come in for a crash landing. 0:01:10.576,0:01:14.996 Luckily, everyone is too busy preparing [br]for the feeding to notice. 0:01:14.996,0:01:17.870 Today’s feeding is where Ethic [br]can find the leader 0:01:17.870,0:01:20.551 of an underground resistance movement. 0:01:20.551,0:01:24.819 This person knows the location of the [br]first of three powerful artifacts. 0:01:24.819,0:01:27.222 The problem is, Hedge and [br]Ethic don’t know 0:01:27.222,0:01:30.618 the resistance leader’s name [br]or appearance. 0:01:30.618,0:01:34.801 But Hedge has gathered the [br]following information: 0:01:34.801,0:01:37.216 The leader has green eyes. 0:01:37.216,0:01:43.236 If the leader has red hair, their name has[br]at least one consecutive double letter. 0:01:43.236,0:01:48.286 If the leader wear glasses, [br]their name has exactly 2 vowels. 0:01:48.286,0:01:52.299 Otherwise, their name has [br]exactly 3 vowels. 0:01:52.299,0:01:57.109 There is exactly one person for whom [br]these are all true. 0:01:57.109,0:01:58.324 As a fugitive, 0:01:58.324,0:02:02.514 Ethic can’t sneak into the crowd without [br]drawing attention to herself. 0:02:02.514,0:02:05.326 But she can give instructions to Hedge. 0:02:05.326,0:02:09.505 And one tool she has is what [br]programmers call a conditional. 0:02:09.505,0:02:13.185 That’s a statement of the form [br]“If A, then B.” 0:02:13.185,0:02:16.376 Flowcharts are great illustrations [br]of how those work. 0:02:16.376,0:02:22.266 This conditional translates to: [br]if A is true, carry out instruction B. 0:02:22.266,0:02:26.178 There are also conditionals that account [br]for different possibilities. 0:02:26.178,0:02:30.025 This says, “If A is true, perform [br]instruction B. 0:02:30.025,0:02:33.718 Otherwise, carry out instruction C.” 0:02:33.718,0:02:38.828 So what instructions does she give Hedge [br]so he can find the resistance leader? 0:02:38.828,0:02:43.492 Pause now to figure it out for yourself. 0:02:43.492,0:02:47.407 With a problem like this, [br]it can help to simplify first. 0:02:47.407,0:02:50.987 What if Hedge just has to examine [br]this one person? 0:02:50.987,0:02:54.232 What information does he need [br]to collect about her? 0:02:54.232,0:02:57.236 He might ask, “Does she have green eyes?” 0:02:57.236,0:03:01.688 What other questions should Hedge [br]ask to find the resistance leader, 0:03:01.688,0:03:05.728 and how can he track those answers? 0:03:05.728,0:03:10.718 Pause now to figure it out for yourself. 0:03:10.718,0:03:14.607 It may seem intuitive how you’d approach [br]this problem as a human. 0:03:14.607,0:03:16.380 But Hedge isn’t a human, 0:03:16.380,0:03:20.990 and so the challenge comes from needing [br]to give him systematic instructions 0:03:20.990,0:03:23.654 that will work in any scenario. 0:03:23.654,0:03:26.578 Hedge needs to examine the settlers, [br]one at a time, 0:03:26.578,0:03:29.139 until he discovers the right person. 0:03:29.139,0:03:32.709 In other words, like with the [br]lock on the prison cell, 0:03:32.709,0:03:36.555 this is a loop that repeats the [br]same instructions. 0:03:36.555,0:03:40.083 Only this time the loop will involve [br]a series of questions 0:03:40.083,0:03:41.770 in the form of conditionals, 0:03:41.770,0:03:45.081 and will end as soon as Hedge [br]finds his target. 0:03:45.081,0:03:48.592 But first, you’ll want to organize [br]your information. 0:03:48.592,0:03:55.130 Each person has a set of characteristics: [br]Eye color, hair color, glasses, and name. 0:03:55.130,0:03:57.297 Does this person have green eyes? 0:03:57.297,0:04:02.367 If so, mark a check next to “eye color." [br]If not, mark an X there. 0:04:02.367,0:04:06.207 If they have red hair, does their [br]name contain a double letter? 0:04:06.207,0:04:09.543 If so, mark a check next to “hair color.” 0:04:09.543,0:04:13.832 If they don’t have a double letter, [br]mark an X next to “hair color.” 0:04:13.832,0:04:18.582 Anyone with red hair and no double [br]letter can’t be the resistance leader. 0:04:18.582,0:04:20.832 But notice that if they have blue hair, 0:04:20.832,0:04:25.432 Hedge will skip this question and [br]go on to the next one. 0:04:25.432,0:04:27.801 For the last question, we can say, 0:04:27.801,0:04:32.551 “If they wear glasses, does their name [br]have exactly 2 vowels? 0:04:32.551,0:04:38.129 If they don’t have glasses, does their [br]name have exactly 3 vowels?” 0:04:38.129,0:04:42.457 There will be people in the crowd with [br]glasses and 1 vowel, 0:04:42.457,0:04:44.864 or no glasses and 2 vowels. 0:04:44.864,0:04:48.673 But they’re not who we’re looking for, [br]so they’ll get X’s. 0:04:48.673,0:04:52.198 The resistance leader must be someone [br]with either check marks 0:04:52.198,0:04:55.027 or blanks next to every question. 0:04:55.027,0:04:58.113 Blanks are ok, because if someone [br]has blue hair, 0:04:58.113,0:05:01.923 the rule about red hair doesn’t [br]apply to them. 0:05:01.923,0:05:05.511 You could have Hedge ask every question [br]about every person, 0:05:05.511,0:05:09.215 and then choose the person with [br]only checks and blanks. 0:05:09.215,0:05:14.165 But there’s a way to save yourself lots [br]of time: as soon as Hedge marks an X, 0:05:14.167,0:05:16.722 have him move on to the next person. 0:05:16.722,0:05:19.294 You don’t need to know the answer [br]to every question; 0:05:19.294,0:05:24.404 just one X means they’re not the target [br]of your search. 0:05:26.283,0:05:28.085 Hedge buzzes through the crowd, 0:05:28.085,0:05:31.646 and within minutes finds Adila, [br]the resistance leader, 0:05:31.646,0:05:33.785 and brings her back to Ethic. 0:05:33.785,0:05:39.055 Adila agrees to help them steal the first [br]artifact— the node of power— 0:05:39.055,0:05:41.018 but under one condition: 0:05:41.018,0:05:43.746 that Ethic and Hedge jump-start [br]the revolution 0:05:43.746,0:05:48.349 by reprogramming the furnace-bots [br]that terrorize the town. 0:05:48.349,0:05:51.129 And right on cue, the robots descend.