Summary of Intellectual problems (2)

Source: Internet
Author: User

1. You are under a 100-storey building with 21 wires with a number 1. 21st. These wires have been extended to the top of the building and the head of the roof is marked with a letter A. U You don't know the correspondence between the numbers below and the letters above. You have a battery, a light bulb, and many very short wires. How can you determine the correspondence between wires and threads when you go downstairs only once?

Answer: in the following 2, 3 together, the 4 to 6 are connected together, 7 to 10 are connected together, and so on, so you put the wire into 6 "equivalence class", the size of 1, 2, 3, 4, 5, 6. Then to the roof, to determine which line and all other wires are not connected, which lines and the other connected, which lines and the other two connected, and so on, thus determining the letter A. Which equivalence class you belong to. Now, the first letter in each equivalence class is joined together to form a new equivalence class of size 6, and the second letter in the next 5 equivalence classes is joined together to form a new equivalence class of size 5; Go back downstairs and differentiate the new equivalence class. In this way, you can solve the problem by knowing the first few letters of the original equivalence class that each number corresponds to.

2. A certain prescription is very strict, you need to take both A and B pills each day, you can not more or less. This medicine is very expensive, you do not want to have any little waste. One day, you open the vial of pill a, pour out a pill in your hand, then open another vial, but accidentally poured out two pills. Now, you have a pill a, two pills B in your hand, and you can't tell which one is a and which is B. How can you strictly follow the prescription pill and not have any waste?

Answer: The three pieces of medicine on the hand are cut into two halves, divided into two piles. Take another pill A, cut it in half, and add a half piece of a to each pile. Now, each pile of pills contains exactly two pieces of a and two and a half pieces of B. Take one of these piles a day.

3. You are on a spaceship, the computer on the ship has n processors. Suddenly, the spacecraft was attacked by an alien laser weapon, and some of the processors were damaged. You know that more than half of the processors are still good. You can ask a processor whether the other processor is good or bad. A good processor always tells the truth, a bad processor always tells lies. Use N-2 to find a good processor.

Answer: label the processor from 1 to N. Using the symbolic a->b to indicate to the processor labeled a that processor B is not good. First Ask 1->2, if 1 said no, they both get rid of (remove a good and a bad, then the rest of the processor is still half good), and then from the 3->4 began to ask. If 1 says 2 is good, continue to ask 2->3,3->4, ... Until one time J said J+1 is bad, remove J and j+1, then ask J-1-j+2, or start with j+2-j+3, if there is no j-1 in front (it has been removed before). Notice that you always maintain such a "chain", and each of the preceding processors says that the latter is good. All the processors in this chain are either good or bad. When the chain grows longer and fewer processors are left, there is always a time when the chain is more than half the rest of the processor, so be sure all the processors in the chain are good. Or, more and more processors are removed, the length of the chain is still 0, and finally only one or two processors have not been asked, then they must be good. Also note that the first processor is good or bad has never been asked, think about you will find that the last processor is not good or bad can not be asked (if the chain longer than the remaining half of the processor, or the last one is left out of this is only this, you do not ask), so the number of queries will not exceed n-2.

4. You let the workers work for you for 7 days, the return is a gold bar, the gold bars are divided into 7 segments connected, you must at the end of each day to give them a piece of gold bars. How do you pay your workers if you are allowed to break the gold bars only two times?

Answer: 1. Cut into 1 segments, 2 segments, and four segments.

Day 1: Give 1.

2: Give 2, return 1.

3: Give 1.

4: Give 4, return 3.

5: Give 1.

6: Give 2, return 1.

7: Give 1.

5. There are 50 people in the village, each with a dog. In these 50 dogs there is a sick dog (the disease is not contagious). So people are going to find a sick dog. Everyone can observe the other 49 dogs to see if they are ill and only their own dogs can not. The results obtained after observation shall not be communicated, nor can the owner of the sick dog be notified. Once the owner has calculated that his home is a sick dog will shoot his own dog, and everyone only the right to shoot their own dogs, no right to kill other people's dogs. On the first day, the next day there was no gunshot. On the third day, a burst of gunfire was heard, asking how many sick dogs to calculate. (and the puzzle Summary (1) 11 identical)

answer : Suppose there are 1 sick dogs, the owner of the sick dog will see other dogs are not sick, then know that their dog is sick, so the first night will have a gun. Because there is no gunshot, the number of sick dogs is greater than 1. Suppose there are 2 sick dogs, the owner of the sick dog will see there are 1 sick dogs, because the first day did not hear the gunshot, is the number of sick dogs more than 1, so the owner of the sick dog will know that his dog is a sick dog, so the next day will have a gun ring. Since the next day every gun rang, indicating that the number of sick dogs is more than 2. This reasoning, if the third day of the gunshot, there are 3 sick dogs.

6. A disc is coated with black and white two colors, each of which occupies a semicircle. The disc rotates at an unknown speed, in an unknown direction. You have a special camera that allows you to instantly observe the color of a point on a circle. How many cameras do you need to determine the direction of the disc rotation?

Answer: You can put two of the camera on the disk close to the two points, and then observe which point first color. In fact, just needing a camera is enough. The control camera moves clockwise around the center of the disc, observing how often the color changes, and then letting the camera move counterclockwise around the center of the disc at the same speed, observing the frequency of discoloration again. It can be concluded that the frequency of discoloration is slower, the camera rotation direction is the same as the disc.

7. There are 25 horses, the speed is different, but the speed of each horse is fixed value. There are now only 5 tracks that cannot be timed, that is, the relative speed of 5 horses can be known at most for each tournament. Ask at least a few races to find the top 3 of the 25 horses? (Baidu 2008 Interview questions)

answer: every horse has at least one chance to compete, so 25 horses are divided into 5 groups, and the first 5 games are unavoidable. It's also easy to find the champions, and the champions of each group play together in one game (6th game). The last is to find 2nd and 3rd place. We named the Group A, B, C, D, E in the first 5 games, in turn, according to the position we got in the 6th game. That is: the champion of Group A is 1th in the 6th game, and the winner of Group B is the 2nd of 6th field ... The 5 horses in each group are numbered from fast to slow according to the results they have been racing:

Group A: 1,2,3, 4,5

Group B:1,2, 3,4,5

Group C:1, 2,3,4,5

Group D: 1,2,3,4,5

Group E: 1,2,3,4,5

From the information we have now, we can know which horses have been excluded from the 3. As long as 3 or 3 horses are already known to be faster than this horse, it has been eliminated. As you can see, only the 5 horses in the bold blue in the table above are likely to be 2 or 3. namely: 2, 3 in Group A, 1, 2 in Group B, 1th in Group C. Take the 5 horses for the 7th game, the first two of the 7th game is 25 horses in 2, 3. So there are at least 7 games.

There are some variants of the problem, such as 64 horses looking for the top 4. method is the same, in the 1th place after the search for the next 3 candidates will be able to.

8.5 prisoners, respectively, according to 1-5 in the sack with 100 mung beans to catch mung beans, the rule that each person at least one, and the most grasping and the fewest people will be executed, and they can not communicate, but in the grasp, you can touch the remaining number of beans. Ask who is the most likely to survive??

Tips:

1, they're all very smart people.

2, their principle is to seek the survival of the first, and then to kill more

3,100 of them don't have to be finished.

4, if there is duplication, it is also the largest or smallest, and executed

Answer: Assuming that the 1th prisoner took X, the 2nd prisoner took y, then the 3rd prisoner knew that the 1th, 2nd Total took (x+y), then he must choose the nearest (x+y)/2 in order to survive, the same as the 4th prisoner selection is the closest (x+y+ (x +y)/2) 3= (x+y)/2 integer, and so on, the 5th prisoner will also be selected to the nearest (x+y)/2 integer. Of course, because all the prisoners are smart enough, 1th, the 2nd prisoner should also understand this truth, then, if X is not equal to Y, then 1th, 2nd prisoners will die, the other 3 survived, because the rules are first to survive, can not protect also more kill, then the 2nd prisoner chose X, so all people choose X, all die.

Also, will the discussion of x be greater than 100/5=20?

Obviously, X>20 's words, the first prisoner will die, and there must be someone alive, according to the above-mentioned prisoner psychological analysis, so this will not happen.

Combined with the above results, all will die.

9. Why is the lid of the sewer round?

answer : The reason is the circle, because the circle each diameter length is equal, does not fall to the sewer. There are at least two heavy vertical lines in other shapes. There is a possibility of falling down.

10. A census clerk asked a woman, "How many children do you have and how old are they?" ”

The woman replied: "I have three children, their age is multiplied by 36, the old is equal to the house number next door." The census clerk immediately went to the side room and looked at it and said, "How much information do I need?" The woman replied, "I am very busy now, my oldest child is sleeping upstairs." "The census clerk said:" Thank you, I know. ”

Question: What is the age of the three children?

answer : = 1x2x2x3x3

All the possibilities are

1,1,36;sum = 38

1,2,18;sum = 21

1,3,12;sum = 16

1,4,9;sum = 14

1,6,6;sum = 13

2,2,9;sum = 13

2,3,6;sum = 11

3,3,4;sum = 10

Since the census-takers know the age and are still unsure of the age of each child, the likelihood is

1,6,6;sum = 13

2,2,9;sum = 13

Since the largest (implying only one of the largest) children are sleeping, it is only possible that

2,2,9;sum = 13

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Summary of Intellectual problems (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.