Adapt the solved exercises to your subject. Register for free
Solved mathematical logic problems to practice reasoning
(0) Mathematical logic problems that you must prove using some logical method
[0.1] Roque, a barber in Batuecas, shaves all the inhabitants who do not shave themselves and only them. Why is this impossible?
INTUITIVE ANSWER:
Suppose Roque shaves himself: in that case, since he is an inhabitant of Batuecas, he should not shave himself. But the truth is that he does shave.
Now, suppose Roque does not shave himself: Well, in that case Roque shaves himself for that very reason.
MATHEMATICAL ANSWER:
This demonstrates that these premises lead to a contradiction, that is, that Roque shaves and does not shave himself. Since these two premises lead us to a contradiction, we can affirm that both premises are inconsistent. Impossible!
[0.2] A journalist interviews a centenarian elderly man and he reveals the secret of his longevity: "If I don't drink beer, then I eat fish" and "I don't eat fish if I have ice cream or don't drink beer". Is it possible to follow such a regimen? What is the secret ingredient?
Formalization:
"If I don't drink beer, then I eat fish" = ¬p → q
"I don't eat fish if I have ice cream or don't drink beer" = r ∨ ¬p → ¬q
Three alternatives in his diet:
1. Beer and no ice cream.
2. Beer and no fish.
3. Beer, fish, and no ice cream.
The ingredient for longevity is Beer!
[0.3] The logician Caferino was asked: Do you love Queta, Petra, or Rosana? He thought: "I love at least one of the three. If I love Petra but not Queta, then I love Rosana. Either I love Queta or Rosana, or I don't love any of the three. If I love Queta, I also love Petra." Who does the logician Caferino love?
Formalization:
1. p ∨ q ∨ r (I love at least one of the three)
2. (p ∧ ¬q → r) (If I love Petra but not Queta, then I love Rosana)
3. [(q ∨ r) ∧ ¬(q∧r)) ∨ ¬(p ∨ q ∨ r)] (Either I love Queta or Rosana, or none)
4. q → p (If I love Queta, I also love Petra)
Three solutions:
1. He loves Petra and Queta, but not Rosana.
2. He loves Petra and Rosana, but not Queta.
3. He only loves Rosana.
[0.4] A hat box contains 5 hats (3 white and 2 black). 3 logicians blindfold themselves and put on a hat. The first says "I don't know what color my hat is". The second says "Neither do I". The third, without removing his blindfold, states "Mine is white". How did he deduce it?
If A knows, then B and C have black hats. Therefore, if they don't know, at least one has white.
This means that if C has black, then B has white. B knows this.
B looks at C and doesn't know. If B knew, then C would have had black.
C knows that A and B don't know, therefore, he knows that his is white.
(1) Mathematical logic problems using truth tables
[1.1] An image consultant must advise a client on accessories for a wedding. She has: blue earrings, pearl necklace, black bracelet, red earrings, brown belt, red necklace. She wants to wear exactly 2 accessories. (a) How many combinations without restrictions? (b) Combinations with one red and one black? (c) Combinations with maximum 2? (d) Combinations with reds and others, only 2 accessories?
a=blue earrings, b=pearl necklace, c=black bracelet, d=red earrings, f=brown belt, g=red necklace
(1) 2 to the power of 6 = 64 options to combine her accessories.
(2) Two accessories: one red and one black; and at most two accessories.
Solution: (d ∧ c) ∨ (g ∧ c) = (d ∨ g) ∧ c
(3) 15 possible combinations.
(4) 20 possible combinations.
[1.2] A hacker needs to determine four boolean values (1 or 0) to bypass a security system. He has decided to apply brute force. Could you represent in a truth table all possible combinations?
With 4 boolean values (p, q, r, s), the total number of possible combinations is:
2^4 = 16 possible combinations
This can be represented in a truth table with 16 rows, one for each combination of 0 and 1 values for the four variables.
[1.3] A choreographer lists the ways a dancer can hold a ballerina: back, left arm, right arm, neck, or left leg. (a) Without physical limitations, how many combinations? (b) Only 2 places, with restrictions: not both arms, and if neck must hold from another place.
(a) Without physical limitations: 2^5 = 32 possible combinations (5 body parts)
(b) Can only hold from two places at a time:
Combinations of 5 elements taken 2 at a time = C(5,2) = 10 combinations
With the additional restrictions:
- If holding one arm, cannot hold the other arm
- If holding the neck, must hold from some other place
The combinations are reduced by eliminating those that violate these rules.
[1.4] At a bus stop we don't remember which bus takes us home. Only lines 34, 43, 23 operate. Line 34 doesn't connect with any line nor does it transfer, but you remember that last time you made a transfer. How many logical possibilities are there of getting lost?
Variables: p=line 34, q=line 43, r=line 23
Restriction: Line 34 doesn't connect with any line nor does it transfer.
We remember that last time we made a transfer, therefore line 34 is not the correct one.
With this information, the possibilities of getting lost depend on choosing between 43 or 23.
Logical possibilities of getting lost: 2 possible options (choosing 43 or 23 incorrectly)
[1.5] In a driving exam: "A driver is considered to be the person... (a) Who drives a two-wheeled moped. (b) Who handles a steering wheel when driving in practice. (c) Who handles the steering mechanism or is in command of the vehicle." Which has more true interpretations?
Analyzing each option:
a) "Drives a two-wheeled moped" - specific condition
b) "Handles a steering wheel of a vehicle when driving in practice" - specific condition
c) "Handles the steering mechanism or is in command of the vehicle" - disjunctive condition
Option c) has more true interpretations because it is a disjunction (v), which is true when at least one of the two parts is true.
In a truth table, the disjunction has 3 true cases out of 4 possible, while the other options are more restrictive.