بعد سنين من القيام بالتجارب استطعت أخيرًا إنتاج حيوانات المستقبل الأليفة الأرانب القزمة! هم صغيرون وممتلئون ويتكاثرون بلمح البصر.
After years of experiments, you’ve finally created the pets of the future– nano-rabbits! They’re tiny, they’re fuzzy… and they multiply faster than the eye can see.
يوجد في مختبرك 36 خلية بيئية، مُنظمة على شكل هرم مقلوب، حيث يوجد 8 خلايا في الصف الأعلى. يوجد في أول خلية أرنب واحد، وفي الخلية الثانية أرنبان، وهكذا دواليك حتى نصل إلى ثمانية أرانب في آخر خلية. بقية الصفوف خالية إلى الآن. الأرانب مُخنّثة، وكل أرنب في كل خلية سيتكاثر مرّة واحدة مع كل الأرانب في الخلية المجاورة أفقيًا مُنتجًا مولودًا واحدًا بالضبط في كل مرة. ستنتقل الأرانب المولودة حديثًا إلى الخلية الموجودة مباشرةً أسفل خليتي والديهم وخلال دقائق سوف تنضج وتتكاثر بدورها. كل خلية بإمكانها احتواء 10^80 من الأرانب القزمة هذا يعني 1 يتبعه 80 صفر قبل أن يتمكنوا من الهرب وينطلقوا لاجتياح العالم أوصلتك حساباتك إلى رقم يتكون من 46 خانة لحساب عدد الأرانب في آخر خلية مساحة كبيرة للتوفير.
In your lab there are 36 habitat cells, arranged in an inverted pyramid, with 8 cells in the top row. The first has one rabbit, the second has two, and so on, with eight rabbits in the last one. The other rows of cells are empty… for now. The rabbits are hermaphroditic, and each rabbit in a given cell will breed once with every rabbit in the horizontally adjacent cells, producing exactly one offspring each time. The newborn rabbits will drop into the cell directly below the two cells of its parents, and within minutes will mature and reproduce in turn. Each cell can hold 10^80 nano-rabbits – that’s a 1 followed by 80 zeros – before they break free and overrun the world. Your calculations have given you a 46-digit number for the count of rabbits in the bottom cell– plenty of room to spare.
ولكن فقط عندما سحبت ذراع التشغيل لبدء التجربة يصل مساعدك مُحمّلًا بأخبار مريعة مختبر منافس لك قام بتدمير شيفرتك حيث تم حذف جميع الأصفار في نهاية نتائجك هذا يعني بأنك لا تعرف حقًا إذا كان باستطاعة آخر خلية تحمل جميع الأرانب والتكاثر ما يزال مستمرًا إلى الآن ولنزيد الطين بلّة أجهزتك وآلاتك الحاسبة جميعها معطلة إذًا لديك بضع دقائق فقط لإجراء العملية الحسابية يدويًّا كم صفرًا متتابعًا يجب أن يكون في نتيجة حساب عدد الأرانب في آخر خلية؟ وهل يجب عليك استخدام ذراع الطوارئ لإيقاف العمل؟
But just as you pull the lever to start the experiment, your assistant runs in with terrible news. A rival lab has sabotaged your code so that all the zeros at the end of your results got cut off. That means you don’t actually know if the bottom cell will be able to hold all the rabbits – and the reproduction is already underway! To make matters worse, your devices and calculators are all malfunctioning, so you only have a few minutes to work it out by hand. How many trailing zeros should there be at the end of the count of rabbits in the bottom habitat? And do you need to pull the emergency shut-down lever?
أوقف الفيديو الآن إذا أردت إيجاد الحل بنفسك
Pause the video now if you want to figure it out for yourself.
الحل خلال 3 ثواني
Answer in 3
خلال ثانيتين
Answer in 2
خلال ثانية واحدة
Answer in 1
لا يوجد وقت كافٍ لحساب عدد الأرانب في آخر خلية. الخبر الجيد أننا لا نحتاج إلى ذلك. كل ما نحتاجه لإجراء العميلة الحسابية هو عدد الأصفار التي تحتويها
There isn’t enough time to calculate the exact number of rabbits in the final cell. The good news is we don’t need to. All we need to figure out is how many trailing zeros it has.
ولكن كيف بامكاننا معرفة عدد الأصفار التابعة لرقم ما بدون حساب الرقم نفسه؟ ما نعرفه هو أننا نصل لمعرفة رقم الأرانب في آخر خلية عن طريق عملية مضاعفة حرفيًا عدد الأرانب في كل خلية هو نتاج عدد الأرانب في الخليّتين الأعلى منها وهناك طريقتين فقط للحصول على عدد متبوع بأصفار من خلال المضاعفة إما عن طريق ضرب عدد ينتهي بالرقم 5 مع أي رقم زوجي أو عن طريق ضرب أرقام لديها أصفار متتابعة ببعضها
But how can we know how many trailing zeros a number has without calculating the number itself? What we do know is that we arrive at the number of rabbits in the bottom cell through a process of multiplication – literally. The number of rabbits in each cell is the product of the number of rabbits in each of the two cells above it. And there are only two ways to get numbers with trailing zeros through multiplication: either multiplying a number ending in 5 by any even number, or by multiplying numbers that have trailing zeroes themselves.
لنحسب عدد الأرانب في الصف الثاني ولنرى أيّ أنماط ستظهر. رقمان لديهما أصفار متتابعة عشرون أرنب في الخلية الرابعة وثلاثون في الخامسة. ولكن لا يوجد أي رقم ينتهي بخمسة. وبما أن الطريقة الوحيدة للحصول على رقم ينتهي بخمسة عن طريق المضاعفة هي بالبدء برقم ينتهي بخمسة إذًا لن يكون هناك أي رقم ينتهي بخمسة في الصفوف السُفلى أيضًا هذا يعني بأننا يجب أن نقلق فقط بشأن الأرقام التي تحتوي على أصفار متتابعة بنفسها. وخدعة مُحكمة لحساب عدد الأصفار المتتابعة في ناتج ما هي بحساب وإضافة الأصفار المتتابعة في كل رقم على سبيل المثال 10x100=1000
Let’s calculate the number of rabbits in the second row and see what patterns emerge. Two of the numbers have trailing zeros – 20 rabbits in the fourth cell and 30 in the fifth cell. But there are no numbers ending in 5. And since the only way to get a number ending in 5 through multiplication is by starting with a number ending in 5, there won’t be any more down the line either. That means we only need to worry about the numbers that have trailing zeros themselves. And a neat trick to figure out the amount of trailing zeros in a product is to count and add the trailing zeros in each of the factors – for example, 10 x 100 = 1,000.
لنأخذ الأرقام في الخلية الرابعة والخامسة ونضاعفها إبتداء من هناك. 20 و30 لكل منها صفر واحد لذا الناتج منهما سيحتوي على صفرين بينما سيحتوي الناتج لأي من الخليتين مع خلية مجاورة ليس لديها أصفار صفرًا واحدًا فقط. وعندما نكمل البقية بنفس الطريقة سنحصل في النهاية على رقم معه 35 صفر في آخر خلية. وإذا لم تكن قلقًا للغاية لاحتمالية انتهاء العالم على أيدي الأرانب القزمة لربما تلاحظ أنه باحتساب الأصفار بهذه الطريقة يُشكل جزءًا من مثلث باسكال.
So let’s take the numbers in the fourth and fifth cells and multiply down from there. 20 and 30 each have one zero, so the product of both cells will have two trailing zeros, while the product of either cell and an adjacent non-zero-ending cell will have only one. When we continue all the way down, we end up with 35 zeros in the bottom cell. And if you’re not too stressed about the potential nano-rabbit apocalypse, you might notice that counting the zeros this way forms part of Pascal’s triangle.
بإضافة هذه الأصفار الـ35 إلى الرقم ذو 46 خانة الذي حصلنا عليه سابقَا ينتج رقمًا من81 خانة أكبر بكثير من أن يحتمله المسكن! ستندفع لشدّ ذراع الطوارئ بالضبط عندما كان الجيل السابع من الأرانب على وشك أن يُتمّ نموه وشيك للغاية من وقوع الكارثة!
Adding those 35 zeros to the 46 digit number we had before yields an 81 digit number – too big for the habitat to contain! You rush over and pull the emergency switch just as the seventh generation of rabbits was about to mature – hare-raisingly close to disaster.