Interview Questions with an annual salary of 0.4 million

Source: Internet
Author: User

 

Interview Questions with an annual salary of 0.4 million

Mr. Zhang and Mr. Xiaoqiang are both students of Mr. Zhang. Their birthday is M-N, and neither of them knows that Miss Zhang's birthday is one of the following 10 groups. Mr. Zhang told James about M, mr. Zhang told Xiaoqiang about the N value and asked them if they knew his birthday was that day?
March 4
March 5
March 8
June 4
June 7
September 1
September 5
December 1
December 2
December 8
James said: If I don't know, I'm sure I don't know either.
Xiaoqiang said: I didn't know either, but now I know.
James said: Oh, I know.
Based on the preceding dialog, determine the day of Miss Zhang's birthday?

According to the conditions, we can see that M is 3, 6, 9, and 12. N = 1, 2, 4, 5, 7, 8. To facilitate the consideration, we arrange the date as follows.
March 4 March 5
June 4
September 1
December 1 December 2

First, I analyzed "James said: If I don't know, I don't know .", According to the table above, James cannot determine the teacher's birthday by m in any case, that is to say, James means that Xiaoqiang will not determine the teacher's birthday through the N value. According to the table above, when n = 2 or 7, Xiaoqiang can determine it, Because n = 2 is only in December 2. When n = 7, it can only be June 7. However, when Xiaoming knows only M, he knows that Xiaoqiang cannot judge it, indicating that M is not equal to 12 or 6. M = 3 or 9.

Then I analyzed "Xiaoqiang said: I didn't know either, but now I know .", Because m is 3 or 9, n can only be 1, 4, 5, or 8. Originally, Xiaoqiang did not know the teacher's birthday, but he heard James's words that he knew M = 3 or 9. Then he determined that N is not equal to 5, when n = 5, M = 3 and 9 are okay. N = 1, 4, 8.

Finally, I analyzed "James said: Oh, then I know .", At this time, James knew that after Xiaoqiang's judgment, N was not equal to 5, and he also determined that M was 9. If M = 3, then, according to the previous analysis, James can only know that the teacher's birthday is March 4 or March 8, but cannot be determined. If M = 9, only September 1 is used.

Therefore, according to the above reasoning, the teacher's birthday should be September 1.

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.