The greatest challenge a vampire hunter can take on is to bring sunlight into a vampire's lair. You’ve stealthily descended into the darkness of a vampire cave, setting a sequence of mirrors as you go. When the sun reaches the right angle in the sky, a focused beam of light will ricochet along the mirrors, strike your diffuser, and illuminate the great chamber where the vampires sleep.
Самая сложная задача для охотника на вампиров — озарить солнечным светом логово вампиров. Вы тайно пробрались в тёмную пещеру вампиров, расставив по пути зеркала. Когда солнце окажется в небе под правильным углом, направленный пучок света отразится от зеркал, попадёт в ваш рассеиватель света и осветит большой зал, где спят вампиры.
You set the final mirror and sneak through an opening in the corner of the great chamber. The diffuser must be wall-mounted, but the walls are crowded with coffins, which you don’t dare disturb. The only open spots are in the other three corners of the room.
Вы устанавливаете последнее зеркало и пробираетесь в большой зал через проход в углу. Рассеиватель света нужно установить на стене, но к стенам прислонены гробы, которые вам лучше не трогать. Открытыми остаются только три угла зала.
The light will enter through the southwest corner at a 45 degree angle and bounce off the perfectly smooth metallic walls until it hits one of the other three corners. But which corner will it hit? You know the room is a rectangle 49 meters wide and 78 meters long.
Свет пройдёт через юго-западный угол под углом 45 градусов и будет отражаться от идеально гладких металлических стен, пока не попадёт в один из этих трёх углов. В какой угол он попадёт? Комната представляет собой прямоугольник 49 на 78 метров.
You could probably find the answer by drawing a scale model of the room and tracing the path of the light, but the sun will be in its place in just minutes, and you’ve got no time to spare. Fortunately, there’s a different way to solve this puzzle that’s both simple and elegant.
Скорее всего, вы найдёте ответ, нарисовав модель комнаты в масштабе и проследив путь луча, но солнце вот-вот достигнет нужной точки, поэтому нельзя терять ни минуты. К счастью, существует другой, одновременно простой и элегантный способ решить эту загадку.
So in which corner should you place the diffuser to flood the vampire lair with sunlight?
В каком углу нужно разместить рассеиватель света, чтобы полностью осветить вампирское логово?
Pause the video if you want to figure it out for yourself.
Нажмите на паузу, чтобы решить задачу самостоятельно.
Answer in 2
[Ответ через: 2]
Answer in 1
[Ответ через: 1]
You could tackle this problem by examining smaller rooms, and you’d find a lot of interesting patterns. But there’s one insight that can unravel this riddle in almost no time at all.
На примере комнат поменьше можно обнаружить много интересных вариантов решения проблемы. Но есть один способ решить эту загадку практически мгновенно.
Let’s draw the chamber on a coordinate grid, with the Southwest corner at the point (0,0). The light passes through grid points with coordinates that are either both even or both odd. This is true even after it bounces off one or more walls. Another way of thinking about it is this: since the light travels at a 45 degree angle, it always crosses the diagonal of a unit square. Traveling 1 meter horizontally changes the x coordinate from even to odd or vice versa. Traveling 1 meter vertically changes the y coordinate from even to odd or vice versa. Traveling diagonally – as the light does here – does both at once, so the x and y coordinates of any points the light passes through must be both even, or both odd. This observation is more powerful than it seems. In particular, it means that we have a way to identify the kinds of points the light won’t ever go through If one of the coordinates is even and the other is odd, the light will miss them. That means it’ll miss the top two corners of the room, since those points have one even and one odd coordinate. The Southeast corner is the only option for the diffuser.
Нанесём зал на координатную сетку, где юго-западному углу достанутся координаты (0;0). Свет проходит через точки либо с двумя чётными, либо с двумя нечётными координатами. Причем неважно, отскочит свет от одной или нескольких стен. Посмотрим на это с другой стороны: поскольку свет падает под углом 45 градусов, он всегда пересекает диагональ единичного квадрата. Перемещение на один метр по горизонтали меняет координаты оси X с чётных на нечётные и наоборот, а движение на один метр по вертикали меняет координаты оси Y от чётных к нечётным и наоборот. Идеальный путь — по диагонали; тогда свет пройдёт через точки, у которых обе координаты X и Y либо чётные, либо нечётные. Этот вывод гораздо важнее, чем кажется на первый взгляд. Получается, у нас есть способ определить типы точек, через которые свет не пройдёт никогда. Если только одна из координат чётная, то свет пройдёт мимо. Значит, свет пройдёт мимо двух верхних углов зала, поскольку эти точки имеют одну чётную и одну нечётную координаты. Юго-восточный угол — единственный вариант для рассеивателя света.
And indeed, when that precious beam of sunlight enters the hall, it bounces between the walls and strikes the Southeast corner, spot on. The vampires, sensing the intrusion, burst from their coffins and turn to dust in the light. It was a “high stakes” test, and you passed with flying colors.
Когда бесценный пучок света попадёт в зал, он отразится от стен и попадёт прямо в юго-восточный угол. Почувствовав вторжение, вампиры выскакивают из гробов и превращаются в пыль. Это был тест с «высокими ставками», и вы справились с ним блестяще.