[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:31.59,0:00:37.29,Default,,0000,0000,0000,,Ethic and Hedge are on the ground floor \Nof a massive tower. Dialogue: 0,0:00:37.29,0:00:41.94,Default,,0000,0000,0000,,Barriers of energy separate them \Nfrom their quest’s second goal: Dialogue: 0,0:00:41.94,0:00:43.94,Default,,0000,0000,0000,,the Node of Creation. Dialogue: 0,0:00:52.67,0:00:57.41,Default,,0000,0000,0000,,To reach it, Ethic must use \Nthree energy streams to climb the tower. Dialogue: 0,0:00:57.41,0:01:03.36,Default,,0000,0000,0000,,As soon as she steps forward a timer \Nwill begin counting down from 60 seconds. Dialogue: 0,0:01:07.36,0:01:11.66,Default,,0000,0000,0000,,At the back of the room \Nthere’s a basin made of invisible towers Dialogue: 0,0:01:11.66,0:01:14.74,Default,,0000,0000,0000,,that can hold energy between them. Dialogue: 0,0:01:14.74,0:01:18.86,Default,,0000,0000,0000,,After one minute, a torrent of energy \Nwill pour down from above, Dialogue: 0,0:01:18.86,0:01:21.02,Default,,0000,0000,0000,,filling one unit at a time, Dialogue: 0,0:01:21.02,0:01:25.50,Default,,0000,0000,0000,,with a force field preventing it \Nfrom spilling out the front or back. Dialogue: 0,0:01:25.50,0:01:27.62,Default,,0000,0000,0000,,During the 60 calm seconds, Dialogue: 0,0:01:27.62,0:01:32.72,Default,,0000,0000,0000,,Ethic and Hedge must decide exactly \Nhow many units of energy will fall. Dialogue: 0,0:01:32.72,0:01:34.42,Default,,0000,0000,0000,,For each of the three challenges, Dialogue: 0,0:01:34.42,0:01:38.09,Default,,0000,0000,0000,,they must choose the amount \Nthat will fill the basin exactly. Dialogue: 0,0:01:38.09,0:01:41.94,Default,,0000,0000,0000,,If they do so, the energy will propel them\Nfurther upwards. Dialogue: 0,0:01:41.94,0:01:46.56,Default,,0000,0000,0000,,But if they get the amount at all wrong, \Nthe energy lift will fail, Dialogue: 0,0:01:46.56,0:01:48.05,Default,,0000,0000,0000,,dropping them. Dialogue: 0,0:01:48.05,0:01:51.35,Default,,0000,0000,0000,,Diagrams on the walls \Nillustrate some examples. Dialogue: 0,0:01:51.35,0:01:55.62,Default,,0000,0000,0000,,This configuration \Nwill capture exactly 2 units of energy. Dialogue: 0,0:01:55.62,0:02:00.74,Default,,0000,0000,0000,,This configuration will capture 4—\N3 here, and 1 here. Dialogue: 0,0:02:00.74,0:02:03.28,Default,,0000,0000,0000,,And this one will also capture 4, Dialogue: 0,0:02:03.28,0:02:06.69,Default,,0000,0000,0000,,because any energy on the right \Nwould spill out. Dialogue: 0,0:02:06.69,0:02:08.91,Default,,0000,0000,0000,,The energy will rain down in such a way Dialogue: 0,0:02:08.91,0:02:13.54,Default,,0000,0000,0000,,that it’ll only overflow \Nif there’s no space that could hold it. Dialogue: 0,0:02:13.54,0:02:18.86,Default,,0000,0000,0000,,Hedge can make one tower of blocks visible\Nat a time and count how tall it is, Dialogue: 0,0:02:18.86,0:02:22.72,Default,,0000,0000,0000,,but he can’t look at \Nthe whole structure all at once. Dialogue: 0,0:02:22.72,0:02:25.53,Default,,0000,0000,0000,,How does Ethic program Hedge \Nto figure out Dialogue: 0,0:02:25.53,0:02:29.34,Default,,0000,0000,0000,,exactly how much energy \Neach basin can hold? Dialogue: 0,0:02:29.34,0:02:38.80,Default,,0000,0000,0000,,Pause now to figure it out for yourself. Dialogue: 0,0:02:38.80,0:02:41.64,Default,,0000,0000,0000,,Here’s one way of thinking about \Nwhat’s happening: Dialogue: 0,0:02:41.64,0:02:44.55,Default,,0000,0000,0000,,each unoccupied cell will hold energy Dialogue: 0,0:02:44.55,0:02:48.79,Default,,0000,0000,0000,,if and only if there is a wall \Neventually to its left, Dialogue: 0,0:02:48.79,0:02:51.52,Default,,0000,0000,0000,,and a wall eventually to its right. Dialogue: 0,0:02:51.52,0:02:56.32,Default,,0000,0000,0000,,But it would take a long time for Hedge \Nto check this for each individual cell. Dialogue: 0,0:02:56.32,0:03:01.18,Default,,0000,0000,0000,,So what if he were to consider \Na whole column of blocks at a time? Dialogue: 0,0:03:01.18,0:03:05.02,Default,,0000,0000,0000,,How many units of energy \Ncan this hold, for instance? Dialogue: 0,0:03:05.02,0:03:10.39,Default,,0000,0000,0000,,Pause now to figure it out for yourself. Dialogue: 0,0:03:10.39,0:03:13.76,Default,,0000,0000,0000,,Let’s analyze the problem \Nby looking at our example. Dialogue: 0,0:03:13.76,0:03:15.91,Default,,0000,0000,0000,,There are 5 columns of blocks here. Dialogue: 0,0:03:15.91,0:03:20.48,Default,,0000,0000,0000,,The leftmost one can’t hold any energy, \Nbecause there’s nothing higher than it. Dialogue: 0,0:03:20.48,0:03:23.12,Default,,0000,0000,0000,,The 2nd stack can have 3 units above it, Dialogue: 0,0:03:23.12,0:03:27.24,Default,,0000,0000,0000,,as they would be trapped \Nbetween these two 4 block stacks. Dialogue: 0,0:03:27.24,0:03:32.19,Default,,0000,0000,0000,,We get 3 units by taking the height \Nwhere the energy would level off— 4, Dialogue: 0,0:03:32.19,0:03:36.35,Default,,0000,0000,0000,,and subtracting the height of the stack— \Nso that’s 4 minus 1. Dialogue: 0,0:03:36.35,0:03:41.81,Default,,0000,0000,0000,,The 3rd stack is similar— 4 to the left,\N4 to the right, and it’s 3 high, Dialogue: 0,0:03:41.81,0:03:46.54,Default,,0000,0000,0000,,so it’ll hold 4 minus 3 equals 1 unit. Dialogue: 0,0:03:46.54,0:03:50.96,Default,,0000,0000,0000,,The 4th stack and 5th stacks have \Nnothing higher than them to the right, Dialogue: 0,0:03:50.96,0:03:53.43,Default,,0000,0000,0000,,so they can’t hold any energy. Dialogue: 0,0:03:53.43,0:03:57.24,Default,,0000,0000,0000,,We can adapt this idea into an algorithm. Dialogue: 0,0:03:57.24,0:04:01.02,Default,,0000,0000,0000,,Considering one column at a time \Nas the point of reference, Dialogue: 0,0:04:01.02,0:04:05.44,Default,,0000,0000,0000,,Hedge can look to the left stack by stack \Nto find the height of the tallest one, Dialogue: 0,0:04:05.44,0:04:08.16,Default,,0000,0000,0000,,look to the right to find the height \Nof the tallest one, Dialogue: 0,0:04:08.16,0:04:12.83,Default,,0000,0000,0000,,and take the smaller of the two \Nas the height the energy can fill up to. Dialogue: 0,0:04:12.83,0:04:15.96,Default,,0000,0000,0000,,If the result is higher than the column \Nin question, Dialogue: 0,0:04:15.96,0:04:18.54,Default,,0000,0000,0000,,subtract the height \Nof the original column, Dialogue: 0,0:04:18.54,0:04:23.63,Default,,0000,0000,0000,,and the result will be the number of units\Nthat column can hold. Dialogue: 0,0:04:23.63,0:04:27.19,Default,,0000,0000,0000,,If it's equal to or below the level \Nof the column in question, Dialogue: 0,0:04:27.19,0:04:29.40,Default,,0000,0000,0000,,the energy would spill off. Dialogue: 0,0:04:29.40,0:04:32.92,Default,,0000,0000,0000,,Hedge can apply that \Nto an entire basin with a loop Dialogue: 0,0:04:32.92,0:04:38.66,Default,,0000,0000,0000,,that starts on the left-most column \Nand moves right, one column at a time. Dialogue: 0,0:04:38.66,0:04:43.67,Default,,0000,0000,0000,,For each column, he’ll run the same steps—\Nlook all the way left for the tallest, Dialogue: 0,0:04:43.67,0:04:47.23,Default,,0000,0000,0000,,do the same to the right, \Ntake the lower height of the two, Dialogue: 0,0:04:47.23,0:04:49.32,Default,,0000,0000,0000,,subtract the original column height, Dialogue: 0,0:04:49.32,0:04:53.18,Default,,0000,0000,0000,,and increase the grand total \Nif that number is positive. Dialogue: 0,0:04:53.18,0:04:56.85,Default,,0000,0000,0000,,His loop will repeat \Nas many times as there are columns. Dialogue: 0,0:04:56.85,0:05:00.80,Default,,0000,0000,0000,,That will work, but it’ll take a long time\Nfor a large basin. Dialogue: 0,0:05:00.80,0:05:05.33,Default,,0000,0000,0000,,At every step Hedge repeats the action \Nof looking left and looking right. Dialogue: 0,0:05:05.33,0:05:10.28,Default,,0000,0000,0000,,If there are N stacks, \Nhe’ll look at all N stacks N times. Dialogue: 0,0:05:10.28,0:05:12.26,Default,,0000,0000,0000,,Is there a faster way? Dialogue: 0,0:05:12.26,0:05:15.61,Default,,0000,0000,0000,,Here’s one time saver: \Nbefore doing anything else, Dialogue: 0,0:05:15.61,0:05:17.47,Default,,0000,0000,0000,,Hedge can start on the left, Dialogue: 0,0:05:17.47,0:05:21.34,Default,,0000,0000,0000,,and keep a running tally \Nof what the highest stack is. Dialogue: 0,0:05:21.34,0:05:25.10,Default,,0000,0000,0000,,Here that would be 2, 2 again,\Nsince the first was higher, Dialogue: 0,0:05:25.10,0:05:27.85,Default,,0000,0000,0000,,then 4, 4, 4. Dialogue: 0,0:05:27.85,0:05:30.63,Default,,0000,0000,0000,,He can then find \Nthe highest right-most stacks Dialogue: 0,0:05:30.63,0:05:36.88,Default,,0000,0000,0000,,by doing the same going right-to-left: \N1, 3, 4, 4, 4. Dialogue: 0,0:05:36.88,0:05:40.72,Default,,0000,0000,0000,,In the end he’ll have a table \Nlike this in his memory. Dialogue: 0,0:05:40.72,0:05:45.96,Default,,0000,0000,0000,,Now, Hedge can take one more pass \Nto calculate how much energy there will be Dialogue: 0,0:05:45.96,0:05:50.00,Default,,0000,0000,0000,,above every stack \Nwith the same equation from before: Dialogue: 0,0:05:50.00,0:05:53.64,Default,,0000,0000,0000,,take the smaller of the stored left \Nand right values, Dialogue: 0,0:05:53.64,0:05:56.71,Default,,0000,0000,0000,,and subtract the height \Nof the current tower. Dialogue: 0,0:05:56.71,0:06:02.29,Default,,0000,0000,0000,,Instead of looking at N stacks N times, \Nhe’ll look at N stacks just 3 times— Dialogue: 0,0:06:02.29,0:06:04.57,Default,,0000,0000,0000,,which is what’s called linear time. Dialogue: 0,0:06:04.57,0:06:07.81,Default,,0000,0000,0000,,There are ways to optimize \Nthe solution even further, Dialogue: 0,0:06:07.81,0:06:10.56,Default,,0000,0000,0000,,but this is good enough for our heroes. Dialogue: 0,0:06:10.56,0:06:12.33,Default,,0000,0000,0000,,Ethic and Hedge work as one. Dialogue: 0,0:06:14.99,0:06:18.84,Default,,0000,0000,0000,,The first cascade is a breeze, \Nand they rise up the tower. Dialogue: 0,0:06:21.57,0:06:23.58,Default,,0000,0000,0000,,The second is a little tougher. Dialogue: 0,0:06:33.05,0:06:36.91,Default,,0000,0000,0000,,The third is huge, \Nwith dozens of stacks of blocks. Dialogue: 0,0:06:36.91,0:06:41.34,Default,,0000,0000,0000,,The timer ticks down towards zero, \Nbut Ethic’s program is fast. Dialogue: 0,0:06:41.34,0:06:44.31,Default,,0000,0000,0000,,She gets the wheel in position \Njust in time, Dialogue: 0,0:06:49.02,0:06:51.94,Default,,0000,0000,0000,,and the energy lifts them \Nto the Node of Creation. Dialogue: 0,0:06:55.64,0:07:01.07,Default,,0000,0000,0000,,Like the first, it reveals a vision: \Nmemories of years gone by. Dialogue: 0,0:07:01.07,0:07:03.19,Default,,0000,0000,0000,,The world machine changed everything, Dialogue: 0,0:07:03.19,0:07:06.86,Default,,0000,0000,0000,,and Ethic, in her position \Nas chief robotics engineer, Dialogue: 0,0:07:06.86,0:07:08.91,Default,,0000,0000,0000,,grew troubled by what she saw. Dialogue: 0,0:07:08.91,0:07:11.95,Default,,0000,0000,0000,,When the Bradbarrier went up \Nto keep the people in, Dialogue: 0,0:07:11.95,0:07:14.59,Default,,0000,0000,0000,,she knew something was seriously wrong. Dialogue: 0,0:07:14.59,0:07:16.68,Default,,0000,0000,0000,,So she created three artifacts Dialogue: 0,0:07:16.68,0:07:21.22,Default,,0000,0000,0000,,with the ability to restore people’s \Npower, creativity, and memory, Dialogue: 0,0:07:21.22,0:07:24.13,Default,,0000,0000,0000,,and smuggled them to three communities. Dialogue: 0,0:07:24.13,0:07:26.45,Default,,0000,0000,0000,,Before she could tell people \Nhow to use them, Dialogue: 0,0:07:26.45,0:07:29.96,Default,,0000,0000,0000,,the government discovered her efforts \Nand sent bots to arrest her Dialogue: 0,0:07:29.96,0:07:31.89,Default,,0000,0000,0000,,and the other programmers. Dialogue: 0,0:07:31.89,0:07:35.21,Default,,0000,0000,0000,,The last thing Ethic \Nused the world machine to create Dialogue: 0,0:07:35.21,0:07:37.100,Default,,0000,0000,0000,,was a robot that would protect \Nthe ancient device Dialogue: 0,0:07:37.100,0:07:42.33,Default,,0000,0000,0000,,from the forces of ignorance \Nby enclosing it in a giant maze. Dialogue: 0,0:07:42.33,0:07:44.74,Default,,0000,0000,0000,,She named her creation Hedge. Dialogue: 0,0:07:51.80,0:07:55.63,Default,,0000,0000,0000,,Without warning, the energy lift flickers,\Nthen fizzles out.