Which day is your birthday?

Source: Internet
Author: User

Both Xiao Ming and Xiao Qiang are students of Mr. Zhang. His birthday is m month n,
Both of them know that Miss Zhang's birthday is one of the 10 groups below,
Instructor Zhang told James about m and John about N,
Teacher Zhang asked them if they knew his birthday was that day?
March 4 March 5
June 4
September 1
December 1 December 2
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.

Determine the day of Miss Zhang's birthday Based on the conversation above.

Answer:

It is more convenient to use the Matrix Representation for this question:

  1 2 4 5 7 8
3     Yes Yes   Yes
6     Yes   Yes  
9 Yes     Yes    
12 Yes Yes       Yes

James said: If I don't know, I'm sure I don't know either.

Indicates:

1. James does not know at present, that is, there is only one yes row vector in the Matrix. There is nothing to exclude here.

2. James is sure that Xiaoqiang does not know at this time, that is, the column vector in the matrix has only one yes, that is, it can be excluded in June 7 and December 2,

After the exclusion, we need to exclude only one "yes" in the row vector. For example, in June 4, James should know that it was July June if it was July June 4, therefore, this rule can be ruled out in June 4.

The matrix status is:

  1 2 4 5 7 8
3     Yes Yes   Yes
6            
9 Yes     Yes    
12            

Xiaoqiang said: I didn't know either, but now I know.

Indicates:

1. Now I know, we can exclude multiple yes column vectors in the column vector, that is, we can exclude March 5 and September 5 (because if Xiaoqiang takes number 5, at this time, he is still not sure which day)

The matrix status is

  1 2 4 5 7 8
3     Yes     Yes
6            
9 Yes          
12            

James said: Oh, I know.

Indicates:

The answer is that there is only one "yes" date in the row vector at this time, namely "July September 1" (because James still cannot tell the exact number if he takes "July March ).

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.