As a wildfire rages through the grasslands, three lions and three wildebeest flee for their lives. To escape the inferno, they must cross over to the left bank of a crocodile-infested river. Fortunately, there happens to be a raft nearby. It can carry up to two animals at a time, and needs as least one lion or wildebeest on board to row it across the river. There's just one problem. If the lions ever outnumber the wildebeest on either side of the river, even for a moment, their instincts will kick in, and the results won't be pretty. That includes the animals in the boat when it's on a given side of the river. What's the fastest way for all six animals to get across without the lions stopping for dinner? Pause here if you want to figure it out for yourself. Answer in: 3 Answer in: 2 Answer in: 1 If you feel stuck on a problem like this, try listing all the decisions you can make at each point, and the consequences each choice leads to. For instance, there are five options for who goes across first: one wildebeest, one lion, two wildebeest, two lions, or one of each. If one animal goes alone, it'll just have to come straight back. And if two wildebeest cross first, the remaining one will immediately get eaten. So those options are all out. Sending two lions, or one of each animal, can actually both lead to solutions in the same number of moves. For the sake of time, we'll focus on the second one. One of each animal crosses. Now, if the wildebeest stays and the lion returns, there will be three lions on the right bank. Bad news for the two remaining wildebeest. So we need to have the lion stay on the left bank and the wildebeest go back to the right. Now we have the same five options, but with one lion already on the left bank. If two wildebeest go, the one that stays will get eaten, and if one of each animal goes, the wildebeest on the raft will be outnumbered as soon as it reaches the other side. So that's a dead end, which means that at the third crossing, only the two lions can go. One gets dropped off, leaving two lions on the left bank. The third lion takes the raft back to the right bank where the wildebeest are waiting. What now? Well, since we've got two lions waiting on the left bank, the only option is for two wildebeest to cross. Next, there's no sense in two wildebeest going back, since that just reverses the last step. And if two lions go back, they'll outnumber the wildebeest on the right bank. So one lion and one wildebeest take the raft back leaving us with one of each animal on the left bank and two of each on the right. Again, there's no point in sending the lion-wildebeest pair back, so the next trip should be either a pair of lions or a pair of wildebeest. If the lions go, they'd eat the wildebeest on the left, so they stay, and the two wildebeest cross instead. Now we're quite close because the wildebeest are all where they need to be with safety in numbers. All that's left is for that one lion to raft back and bring his fellow lions over one by one. That makes eleven trips total, the smallest number needed to get everyone across safely. The solution that involves sending both lions on the first step works similarly, and also takes eleven crossings. The six animals escape unharmed from the fire just in time and begin their new lives across the river. Of course, now that the danger's passed, it remains to be seen how long their unlikely alliance will last.
Хүчтэй түймэр хээр талд тархахад гурван арслан болон гурван гну гөрөөс амиа аврахаар зугтлаа. Тамын галаас оргохын тулд матартай голын зүүн эрэг рүү гарах ёстой болно. Азаар ойрхон нэгэн сал байж таарлаа. Хамгийн ихдээ хоёр амьтныг даах энэ салыг багадаа нэг амьтан сэлүүрдэж явах хэрэгтэй. Нэг л асуудал байна. Голын аль ч талд арслангууд гөрөөснөөс тоогоороо илүү байвал, хэсэгхэн хугацаанд ч гэсэн араатан араншин нь гарч ирэх бөгөөд үр дүн нь тийм ч таатай биш байх болно. Голын аль талд ч байсан арслан гөрөөснөөс олон байж болохгүй. Арслангууд гөрөөсийг зооглолгүй зургаан амьтан голыг гатлах хамгийн хурдан арга юу вэ? Өөрөө бодохыг хүсвэл энд бичлэгийг түр зогсоогоорой. Хариулт эхлэхэд: 3 Хариулт эхлэхэд: 2 Хариулт эхлэхэд: 1 Хэрвээ иймэрхүү асуудал дээр гацчихвал гаргаж болох бүх шийдвэрээ, үр дүнтэй нь жагсааж бичээд үз. Жишээлбэл, хэн эхлээд гол гатлах вэ гэдэг дээр 5 сонголт байна: нэг гөрөөс, нэг арслан, хоёр гөрөөс, хоёр арслан, эсвэл хоёулангаас нь нэг нэг. Хэрвээ нэг амьтан ганцаар явбал, буцаад л салаа авч ирэх хэрэгтэй болно. Хэрвээ 2 гөрөөс эхлэн явбал, үлдсэн нэг шууд л идүүлнэ. Тэгэхээр тэр сонголтууд бүгд болохгүй. Хоёр арслан явуулах, эсвэл хоёр амьтнаас нэг нэгийг, гэсэн сонголтууд хоёул ижил тооны нүүдэлтэй шийдлүүд өгнө. Цаг үрэхгүйн тулд хоёр дахь сонголтыг тайлбарлая. Амьтан бүрээс нэг нэг эхэлж гатлана. Хэрвээ гөрөөс үлдээд арслан буцвал, баруун эрэг дээр 3 арслан гарч, Үлдсэн 2 гөрөөст байдал хүнд болно. Тэгэхээр бид арсланг үлдээх хэрэгтэй боллоо. Гөрөөс буцаад баруун эрэг рүү явна. Одоо бидэнд өмнөх таван сонголт байна. Гэхдээ нэг арслан аль хэдийн зүүн эрэг дээр оччихсон. Хэрвээ хоёр гөрөөс явбал, үлдсэн нэг нь идүүлнэ, Мөн амьтан бүрээс нэг нэг явбал, сал дээрх нэг гөрөөс нөгөө эрэг дээр очингуутаа тоогоороо бага болно. Энэ нь мухар төгсгөл учир, гурав дахь гатлалт дээр, зөвхөн хоёр арслан л явж болно. Нэг нь үлдээд, зүүн эрэг дээр хоёр арслан байна. 3 дахь арслан салаа буцаан баруун эрэг дээр авч ирнэ. Тэнд бусад гөрөөсүүд хүлээж байгаа. Одоо яах вэ? 2 арслан нөгөө талд хүлээж байгаа exnj ганц сонголт нь 2 гөрөөс л явуулах. Дараа нь, 2 гөрөөс буцаж ирвэл утгагүй зүйл болно. Сүүлийн нүүдлээ бууцаалаа л гэсэн үг. Хэрэв хоёр арслан буцвал, баруун эрэг дээрх гөрөөсийг тоогоороо давчихна. Тэгэхээр нэг арслан, нэг гөрөөс буцаад салтайгаа явна. Одоо зүүн эрэг дээр амьтан бүрээс нэг харин баруун эрэг дээр амьтан бүрээс 2 үлдэнэ. Арслан, гөрөөс хоёрыг дахин буцаах нь утгагүй зүйл, тэгэхээр дараагийн гатлалтаар хос арслан эсвэл хос гөрөөс байх хэрэгтэй. Хэрвээ хоёр арслан явбал зүүн эрэг дээрх гөрөөсийг иднэ, тиймээс тэд үлдэн, оронд нь хос гөрөөс явна. Бүх гөрөөс очих газраа байгаа тул дуусахад их ойрхон байна. Тоогоор дутаагүй байна. Одоо нэг арслан буцаж сэлүүрдэн яваад, бусад арслангуудаа нэг нэгээр нь авч ирнэ. Энэ нь нийтдээ 11 гатлалт бөгөөд, бүх амьтдыг аюулгүй гарахад хэрэгтэй хамгийн бага тоо. Эхний аялалд 2 арслан явуулах нь төстэй аргаар явж, мөн л 11 гатлалт хийнэ. Бүх 6 амьтан галаас ямар ч гэмтэлгүй амжиж зугтаан, голын нөгөө талд шинэ амьдарлаа эхлүүлнэ. Мэдээж, аюул ард үлдсэн учираас, тэдний эв нэгдэл хэр удаан үргэлжлэхийг харах л үлдлээ.