The Resistance | Think Like A Coder, Ep 2

The Resistance | Think Like A Coder, Ep 2

After breaking Ethic out of prison, Hedge flies them both towards
a frontier settlement in the shadow of the Bradbarrier,
the great wall that encircles the nation. All the settlers there will soon gather
for the monthly feeding. The people of the wall spend their days
gathering up works of art and literature, from all across the land. On feeding day, the furnace-bots arrive,
ravenous. If they eat, the lights stay on,
and the food gets delivered. If they starve, the people do too. Hedge’s fuel supply runs out just as he
and Ethic reach the outskirts of town, and they come in for a crash landing. Luckily, everyone is too busy preparing
for the feeding to notice. Today’s feeding is where Ethic
can find the leader of an underground resistance movement. This person knows the location of the
first of three powerful artifacts. The problem is, Hedge and
Ethic don’t know the resistance leader’s name
or appearance. But Hedge has gathered the
following information: The leader has green eyes. If the leader has red hair, their name has
at least one consecutive double letter. If the leader wear glasses,
their name has exactly 2 vowels. Otherwise, their name has
exactly 3 vowels. There is exactly one person for whom
these are all true. As a fugitive, Ethic can’t sneak into the crowd without
drawing attention to herself. But she can give instructions to Hedge. And one tool she has is what
programmers call a conditional. That’s a statement of the form
“If A, then B.” Flowcharts are great illustrations
of how those work. This conditional translates to:
if A is true, carry out instruction B. There are also conditionals that account
for different possibilities. This says, “If A is true, perform
instruction B. Otherwise, carry out instruction C.” So what instructions does she give Hedge
so he can find the resistance leader? Pause now to figure it out for yourself. With a problem like this,
it can help to simplify first. What if Hedge just has to examine
this one person? What information does he need
to collect about her? He might ask, “Does she have green eyes?” What other questions should Hedge
ask to find the resistance leader, and how can he track those answers? Pause now to figure it out for yourself. It may seem intuitive how you’d approach
this problem as a human. But Hedge isn’t a human, and so the challenge comes from needing
to give him systematic instructions that will work in any scenario. Hedge needs to examine the settlers,
one at a time, until he discovers the right person. In other words, like with the
lock on the prison cell, this is a loop that repeats the
same instructions. Only this time the loop will involve
a series of questions in the form of conditionals, and will end as soon as Hedge
finds his target. But first, you’ll want to organize
your information. Each person has a set of characteristics:
Eye color, hair color, glasses, and name. Does this person have green eyes? If so, mark a check next to “eye color.”
If not, mark an X there. If they have red hair, does their
name contain a double letter? If so, mark a check next to “hair color.” If they don’t have a double letter,
mark an X next to “hair color.” Anyone with red hair and no double
letter can’t be the resistance leader. But notice that if they have blue hair, Hedge will skip this question and
go on to the next one. For the last question, we can say, “If they wear glasses, does their name
have exactly 2 vowels? If they don’t have glasses, does their
name have exactly 3 vowels?” There will be people in the crowd with
glasses and 1 vowel, or no glasses and 2 vowels. But they’re not who we’re looking for,
so they’ll get X’s. The resistance leader must be someone
with either check marks or blanks next to every question. Blanks are ok, because if someone
has blue hair, the rule about red hair doesn’t
apply to them. You could have Hedge ask every question
about every person, and then choose the person with
only checks and blanks. But there’s a way to save yourself lots
of time: as soon as Hedge marks an X, have him move on to the next person. You don’t need to know the answer
to every question; just one X means they’re not the target
of your search. Hedge buzzes through the crowd, and within minutes finds Adila,
the resistance leader, and brings her back to Ethic. Adila agrees to help them steal the first
artifact— the node of power— but under one condition: that Ethic and Hedge jump-start
the revolution by reprogramming the furnace-bots
that terrorize the town. And right on cue, the robots descend.

100 thoughts to “The Resistance | Think Like A Coder, Ep 2”

  1. 8 episodes remain! Don't want to miss the action? Make sure to subscribe and turn on notifications! Whether you're a coder or not, this epic adventure is for you. There will be varying levels of difficulty throughout each episode. See if you can rise to the challenge!

  2. At last!!🤪 I was waiting for this from the moment I watched the first episode! I just love this series 💖💖. I hit the like button even before I started playing the video 🤩. The animation style AND the narrator were really good. Please upload the next episode ASAP!!! I am very eager to watch it.

  3. As someone in their first year of a programming course this show is awesome! Can't wait to watch more!
    I enjoy that the show uses psuedocode. Thats nice for people who watch this before deciding what language they want to learn first.

  4. something i'd like to add so it may help understanding, since TED-Ed doesnt explain the final algoritm. for the searching to become more efficient, is to think the fastest way Hedge can move on between each people. Since everytime a condition fails to be met, the person in question is guaranteed to NOT be the leader. the fastest way is from looking their eyes, Since there are at least more than 3 eye color, therefore the percentage between each color is smaller. whereas for example glasses where there's only 2 possibility.

    lets say there's 100 people , with glasses theoretically 50% wears one and the other doesnt, so you have to check up to 50 people until the condition is met (lets say the leader is checked at 50th position). whereas with eye color lets say theres only 10 person who has green eyes , so you have to check AT MAX until 10 times.

    then you can proceed on checking the next variables.

    note : a computer doesnt work like human , they work linearly. Whereas human can probably "scan" the area to see differences as a whole, a computer has to check each person one by one

  5. Ok, having been through a coding class…I get what they are going for with series…especially good for people who have NEVER coded before…but…yeah this weak.

  6. I feel like the animator was kicked out of Disney for being much better than the required level , also the guy who created the story knows what he is doing. Oh and the narrator is lit

  7. Oh my gosh! This is exactly what I'm learning at school (and struggling with too). I'm sticking to this series!

  8. Strange. You tell about checkbox, but didn't tell about variables. You tell about human having list of attributes, but didn't tell about classes. And nothing about arrays too. In next episodes then?
    And you didn't tell anything about how this bot could count vowels or find two same letters in a row. Of course it's little too specific and requires knowledge of what methods is…

  9. I'm not sure if I've changed or the channel has, but the content seems to be veering in a different direction. While I am unsubscribing, I'm sure you will continue to enjoy views while you try to capture a new audience (possibly at the expense of some of the old)…

  10. On the last Episode I saw a post that went like " Think like a coder, Only on T e d F l i x " 😂 marvelous job Ted-Ed, keep it going

  11. I am waiting for the next episode.

    By the way, who had watched the first episode on the release date and is a big fan of coding and Ted-Ed?

    Leave a like if you are…

  12. Hi ted-ed
    What an interesting episode?
    Learned about conditional statement.
    And animation is fantastic..
    Can't wait to see upcoming episode?
    Thanks for the video ted-ed🙏👍😊

  13. I'm loving this! Animations look amazing and the world the story plays in is very interesting. I like problem solving and also can't stop listening to the Intro-sountrack.
    Dieau-dieau, dieaudieau-diea-dauda …🎶

  14. Thank you for the series! I’ve watched a bunch of TED-Ed videos in the past. They’re all amazing. This is no exception. I’ll be waiting for the next episode!

  15. how exactly did they get this strange conditional knowledge about the leader? also didn't the robot run out of battery?

  16. Headcannon:
    The information Hedge had about Adila was written as a puzzle on purpose. Note that whoever did that was a source trustable enough for Hedge for that information

  17. I find it useful to go back to the core principles of programming, even if you do already know how to code. I'm hoping these challenges will get really hard in future episodes.

  18. I love what they are doing with names. We have Ethic & Hedge as protagonist & deuteragonist respectively, obvious meaning. And now we have the resistance leader Adila, which is feminine singular of Adil & a common name of Arabic origin means fair, truthful, correct, to equate, neutralize, to balance
    On the other hand Adila is similar to The Greek word Adili άδηλη a feminine singular from Ádilos which means latent, uncertain, unknown. I don't if the Greek part was intentional, but I liked it nevertheless & needless to say that it is a brilliant content, also the animation style, the music and the artistry in crafting.

  19. loop {
    if (!green_eyes) continue;
    if (red_hair)
    if (!two_consecutive_letters) continue;
    if (glasses)
    if (!two_vowels) continue;
    if (!three_vowels) continue;
    print("The person is {}!", person);

  20. I always "mapped" my code in flowchart to give some idea of the direction I am heading.
    Not many books/videos teach this skill anymore.

  21. The bots built the wall and made the humans pay for it…..I'll just show myself out now. But in all seriousness great work.

  22. Im a beginner coder coding 6 months now but i never thought i should think this way. Loved it, hope ill think like her

Leave a Reply

Your email address will not be published. Required fields are marked *