General explanation:
Because there are 11 apples total in the basket. There are two Boolean statements that are simultaneously true. The statements “There are 11 apples total in the basket” AND “the basket contains 10 apples” can both be true. This is a logic problem using True and False values. i.e. containing 10 apples doesn’t mean the basket has no more than 10 apples in it. Another way to see it is that the basket having n apples total implies it contains n apples, but containing n apples implies it contains n - 1 and so forth for n > 1. So assuming that the basket has n apples total, it contains n - 1, so n - (n - 1) = 1, after giving away the (n-1) apples your basket contains.
Mathematical Solution 1
(simple proof by recursion):
We can argue this recursively,
Base case:
Say there are 2 apples in the basket.
“The basket contains an apple” is a true statement because it’s true if there EXISTS an apple in the basket . You give away an apple, there is still an apple left over. “The basket has one apple left” is a true statement.
Recursive step:
We know there are n apples total in the basket, the statement “The basket contains n-1 apples” is true. So we must prove that if there are n+1 apples total in the basket, the statement “the basket contains n apples” is true. And after subtracting n apples, we still have 1 left.
We add an apple to the basket. There are now n+1 apples total in the basket. Since we know that the statement “The basket contains n-1 apples” was true before adding an apple to the basket, “the basket contains n apples” is true after adding an apple. You give away n apples and there is now n+1 - n= 1 apple left in your basket leftover. Therefore the proof holds for all values of n>1.
Mathematical Solution 2
(Boolean algebra):
Define Boolean variable P as the statement “the basket contains 10 apples before gifting apples”.
Define Q := “there are 11 apples total in the basket before gifting apples”.
Define R := “After gifting 10 apples from the basket, there is one apple total left in the basket”
”A and B” is a statement that is only true when both statements A and B are true. Otherwise it is false.
A => B is a logical formula that is read “A implies B”. This bigger logical statement is only false when A is true and B is false. The implication as a whole is true the rest of the time.
My theory restated in logic is:
P and R implies Q.
Remember that my theory can only be wrong (false) if P and R are both true and Q is false.
Proof by contradiction:
We know P and R are true because it’s given in the problem.
Suppose I’m wrong though and P and R are true but Q is false. So there aren’t 11 apples total in the basket. that means the basket either has more than 11 apples or it has less than 11 apples. If the basket has 12 or more apples total, then giving away 10 apples leaves us with 2 or more apples left in the basket and R is contradicted (can’t be both true and false). Similarly there can’t be 10 or less apples in the basket because then we have 0 or less apples total in the basket after giving away 10 apples (contradicts R again).
Therefore Q must be true. And my theory P and R => Q holds.