Skip to content

Instantly share code, notes, and snippets.

@svecon
Created August 28, 2017 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svecon/18d7dc0dfdcad6838a783d55bfa45d23 to your computer and use it in GitHub Desktop.
Save svecon/18d7dc0dfdcad6838a783d55bfa45d23 to your computer and use it in GitHub Desktop.
Logical puzzles
A mathematician and a lady strike conversation during a flight. The lady asks the mathematician to guess the age of her three daughters. Mathematician, being unable to answer the questions, asks for some hint(s).
The lady replies: The product of their ages is 36.
Still unable to answer, mathematician asks for another hint.
Hint 2: The sum of their ages is equal to your (i.e. mathematician's) seat number.
Mathematician still cann't answer the question.
Final hint: My (i.e. the lady's) youngest daughter has blue eyes.
Listening to the final hint, mathematician is able to answer the question.
x*y*z = 36 = 2*2*3*3
1*1*36 = 38
1*2*18 = 21
1*3*12 = 16
1*4*9 = 14
4*3*3 = 10
2*2*9 = 13
2*3*6 = 11
1*6*6 = 13
x+y+z=S
A teacher says: I'm thinking of two natural numbers greater than 1. Try to guess what they are.
The first student knows their product and the other one knows their sum.
First: I do not know the sum.
Second: I knew that. The sum is less than 14.
First: I knew that. However, now I know the numbers.
Second: And so do I.
What were the numbers?
first -> x*y
second -> x+y
first ???
second knew you didnt know
x+y < 14
=4
2+2 ** 4 u
=5
2+3 ** 6 u
=6
2+4 ** 8 u
3+3 ** 9 u
=7
2+5 ** 10 u
3+4 ** 12 !!
=8
2+6 ** 12 !!
3+5 ** 15 u
4+4 ** 16 !!
=9
2+7 ** 14 u
3+6 ** 18 !!
4+5 ** 20 !!
=10
2+8 ** 16 !!
3+7 ** 21 u
4+6 ** 24 !!
5+5 ** 25 u
=11
2+9 ** 18 !!
3+8 ** 24 !!
4+7 ** 28 u
5+6 ** 30 !!
=12
2+10 ** 20 !!
3+9 ** 27 u
4+8 ** 32 u
5+7 ** 35 u
6+6 ** 36 !!
=13
2+11 ** 22 u
3+10 ** 30 !!
4+9 ** 36 !!
5+8 ** 40 u
6+7 ** 42 u
You're about to have a picnic with your friends on the weekend and you wonder whether it will rain. You look at three independent weather forecasts, where two of them say the weekend will be rainy and another one says it won`t. You know that each of the three weather forecasts have only 3/4 chance that the forecast will be correct. What is the probability that it will actually rain during your picnic? You can assume that the prior probability of rain is equal to 1/5.
P(rain) = 1/5
P(sunny) = 4/5
P(f=rain | rain) = 3/4
P(f=rain | sunny) = 1/4
P(F=[rain,rain,sunny] | rain) = 3/4 * 3/4 * 1/4
P(F=[rain,rain,sunny] | sunny) = 1/4 * 1/4 * 3/4
P(rain | F=[rain,rain,sunny]) = ?
= P(F | rain) * P(rain) / P(F)
= P(F | rain) * P(rain) / [P(F | rain)*P(rain) + P(F | sunny)*P(sunny) ]
= 3/7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment