3. Vesna, Boris, and Nikola are excellent students who never lie. In response to the question about the grades they received on their math test, they answered:

Vesna: "If Nikola and I got 5, then Boris also got 5";

Boris: "If I got 5, then Vesna also got 5"; and

Nikola: "If Boris or I got 5, then Vesna also got 5"

It is known that one of them got a 4 and the other two got 5. What grades did Vesna, Boris, and Nikola receive?
Solution. Let $p, q$ and $r$ be the statements "Vesna got a 5", "Boris got a 5", and "Nikola got a 5", respectively. Knowing that one of them is false, and the other two are true, we create the following table:

| $p$ | $q$ | $r$ | $p \wedge r \Rightarrow q$ | $q \Rightarrow p$ | $q \vee r \Rightarrow p$ |
| :---: | :---: | :---: | :---: | :---: | :---: |
| $\mathrm{T}$ | $\mathrm{T}$ | $\perp$ | $\mathrm{T}$ | $\mathrm{T}$ | $\mathrm{T}$ |
| $\mathrm{T}$ | $\perp$ | $\mathrm{T}$ | $\perp$ | $\mathrm{T}$ | $\mathrm{T}$ |
| $\perp$ | $\mathrm{T}$ | $\mathrm{T}$ | $\mathrm{T}$ | $\perp$ | $\perp$ |

Since the statements by Vesna, Boris, and Nikola (i.e., $p \wedge r \Rightarrow q, q \Rightarrow p, q \vee r \Rightarrow p$) are true, from the table it is derived that Vesna and Boris got a 5, and Nikola got a 4.