CIS-375 Help Session Note 1 (Spring 2020)
11 Feb 2020Scire ad trascendere - Learn to transcend.
Topics covered:
- Boolean logic, truth tables
- Understanding and using definitions
- Divisibility and fundamental theorem of artithmetic
- Proof of if-then and iff statements
Develop the ability to understand new concepts
In the future, no matter where you are going to work in (e.g. industry, academia, etc.), you are likely to encounter new concepts. During undergraduate education, you are taught with general knowledge, which acts as a foundation for your further specialization. There are too many technologies in this world to be covered within a four-year time span. Therefore, instead of teaching you everything, it would be much more practical if we choose to cultivate an ability to understand everything individually.
One of the key purposes of this course is to help you form the skills to comprehend mathematical concepts that are necessary for all computer science literature. Personally speaking, I think mathematical concepts are the “easiest” to understand among all other categories, simply because:
- They are usually very concise.
- They usually exclude any possible ambiguity.
- It is very easy to verify whether one has understood the concept correctly or not.
More concretely, the definition of a simplest mathematical concept looks like this:
A circle is a shape consisting of all points in a plane that are a given distance from a given point, the centre. (Wikipedia)
Whereas in psychology, the definition of a fundamental concept looks like this:
Emotions are biological states associated with the nervous system brought on by neurophysiological changes variously associated with thoughts, feelings, behavioural responses, and a degree of pleasure or displeasure. (Wikipedia)
There is no doubt that the mathematical concept possesses higher degree of clarity and definitiveness. Therefore, please do not be afraid of new concepts in mathematics. After all, they are not the most difficult things you’ll need to deal with in your future studies.
Identifying the key components of a definition
Having finished grading your homework, I find out that many of you are unable to understand the definitions provided by the homework guidelines effectively. The sentence structure or wording in mathematical materials may differ from standard English documents, which perhaps creates difficulty for you to perceive an idea. However, the fact that these contents tend to be grammatically correct implies that they contain all essential components that build up a sentence, i.e. subject, verb, object, complements, etc. To understand a concept thoroughly, I think the first thing you need to do is to identify what each component is. Let’s look at the examples below.
Consider the following definition of Pythagorean triples:
Let there be three positive integers \(a\), \(b\) and \(c\). The triple \((a, b, c)\) is called a Pythagorean triple if \(a^2 + b^2 = c^2\).
Suppose we have a triple \((3, 4, 5)\). How do we know if it is a Pythagorean triple? We compute \(3^2 + 4^2\) and compare it with \(5^2\). You should be able to find out that \(3^2 + 4^2 = 5^2\), which means it is a Pythagorean triple. But here comes the question: what is it? In other words, which of the following is a Pythagorean triple?
Consider the following definition of even numbers:
Let there be an integer \(n\). It is called an even number if \(2 \mid n\).
Suppose there are two even numbers \(m\) and \(n\). Obviously, we have \(2 \mid m\) and \(2 \mid n\). Now you are asked to verify “if the sum of two even numbers is an even number”, which quantity should you focus on?
You may begin to notice that “\(A\) is said to be \(B\) if \(C\)” is a very common expression in mathematical literature. In this case, usually \(A\) is the subject, \(B\) is the name of the definition, and \(C\) the predicate for determining whether \(A\) can be called \(B\). For Pythagorean triples, \(A\) is \((a,b,c)\), \(B\) is “Pythagorean triple”, and \(C\) is \(a^2 + b^2 = c^2\). For even numbers, \(A\) is \(n\), \(B\) is “even number”, and \(C\) is \(2 \mid n\). It is essentially saying: if \(C\) is true, then \(A\) is \(B\). Otherwise, \(A\) is not \(B\).
Let’s come back to Toyota number, which appears in the homework question. The definition of Toyota number is as follows:
Let \(n\) be a positive integer. Then \(n\) is said to be a Toyota number if \(3 \mid n^2 + 5n\).
Here, \(A\) is \(n\), \(B\) is “Toyota number” and \(C\) is \(3 \mid n^2 + 5n\). If \(3 \mid n^2 + 5n\ (C)\) is true, then \(n\ (A)\) is a “Toyota number (\(B\))”. Otherwise, if \(3 \mid n^2 + 5n\ (C)\) is false, then \(n\ (A)\) is not a “Toyota number (\(B\))”. It is important to realize that the subject here is \(A\) instead of \(C\). Therefore, we are trying to decide whether \(n\) is a Toyota number, not \(3 \mid n^2 + 5n\) or \(n^2 + 5n\).
In question 2b, you are asked to prove/disprove if “the product of two Toyota numbers is a Toyota number.” Let there be two Toyota numbers \(m\) and \(n\), you should determine if \(mn\) is a Toyota number. Some people try to calculate if \((m^2 + 5m)(n^2 + 5n)\) is a Toyota number, which is completely irrelevant to what the question is asking.
Consider the following definition of logical consequence:
Let \(p_1, p_2,\ldots,p_k\) and \(q\) be Boolean expressions. We say that \(q\) is a logical consequence of \(p_1, p_2,\ldots,p_k\) if \(p_1 \land p_2 \land \ldots \land p_k \rightarrow q\) is a tautology.
You are asked to answer this question:
Let \(a, b\) and \(c\) be Boolean variables. Show, by constructing a complete truth table, that \(\neg a\) is a logical consequence of \(a \rightarrow (b \lor c)\), \(\neg b\) and \(\neg c\).
Let’s do a step-by-step matching between these two statements:
- \(p_1\) is \(a \rightarrow (b \lor c)\)
- \(p_2\) is \(\neg b\)
- \(p_3\) is \(\neg c\)
- \(q\) is \(\neg a\)
Therefore, we need to construct the following truth table:
$$a$$ | $$b$$ | $$c$$ | $$b \lor c$$ | $$a \rightarrow (b \lor c)$$ | $$\neg b$$ | $$\neg c$$ | $$(a \rightarrow (b \lor c)) \land (\neg b) \land (\neg c)=u$$ | $$u\rightarrow (\neg a)$$ |
---|---|---|---|---|---|---|---|---|
T | T | T | T | T | F | F | F | T |
T | T | F | T | T | F | T | F | T |
T | F | T | T | T | T | F | F | T |
T | F | F | F | F | T | T | F | T |
F | T | T | T | T | F | F | F | T |
F | T | F | T | T | F | T | F | T |
F | F | T | T | T | T | F | F | T |
F | F | F | F | T | T | T | T | T |
We are able to conclude \(\left((a \rightarrow (b \lor c)) \land (\neg b) \land (\neg c)\right) \rightarrow \neg a\) is a tautology, for the last column is all true. As a result, \(\neg a\) is a logical consequence of \(a \rightarrow (b \lor c)\), \(\neg b\) and \(\neg c\).
Converting definitions to something easier to comprehend
Sometimes definitions are written in a most compact and concise form, which can increase the difficulty to understand them. When you find a new definition confusing, maybe you can try to convert them to “everyday language”, which greatly facilitates problem solving. For example, we mentioned the definition of Toyota numbers before:
A positive integer \(n\) is said to be a Toyota number if \(3 \mid n^2 + 5n\).
It is easy to see that \(n^2 + 5n = n(n+5)\), which means that we can check if \(3 \mid n(n+5)\) instead.
The fundamental theorem of arithmetic states that every integer greater than 1 either is a prime number itself or can be represented as the product of prime numbers and that, moreover, this representation is unique, except for the order of the factors. With this knowledge in our mind, we can conduct the following derivation:
- If \(3 \mid n^2 + 5n\), it means that 3 is a factor of \(n^2 + 5n\).
- \(n^2 + 5n = n(n+5)\). The fundamental theorem of arithmetic indicates \(n\) and \(n+5\) can both be represented as the product of prime numbers (now assume \(n > 1\)).
- 3 is a prime number. If 3 is a factor of \(n(n+5)\), then either 3 is a factor of \(n\) or 3 is a factor of \(n+5\) (or both).
You may find the third step a bit obscure. You can think about it in this way: suppose 3 is not a factor of \(n\) nor \(n+5\), there is no way that 3 is a factor of \(n(n+5)\), because you cannot find two integers other than \(1\) and \(3\) whose product is 3.
With the conclusion of step 3, we can rewrite the definition of Toyota number as follows:
A positive integer \(n\) is said to be a Toyota number if either \(n\) is divisible by 3 or \(n+5\) is divisible by 3 (or both). 2
It is a lot longer and much easier to understand. But you know what? Mathematicians hate it. So everyone one them will prefer the old definition.
The definition of square free integers is even trickier:
Let \(n\) be a positive integer. Then \(n\) is said to be a square free integer if \(n\) is divisible by no perfect square other than 1.
Many of you are unable to tell whether a number is square free or not, because the definition is simply too abstract. For example, some of you consider 12 to be a square free integer, which is not true because \(4 \mid 12\), and 4 happens to be a perfect square. Here comes the question: using the fundamental theorem of arithmetic, can you “simplify” the definition of square free integers? I will provide the answers below, but feel free to think about it for now.
Answer (click to expand)
The fundamental theorem of arithmetic states that we can write \(n\) as the product of its prime factors. That is, we can write
\[n = p_1^{e_1}p_2^{e_2}\ldots p_n^{e_n},\]where \(p_i\)’s are its prime factors and \(e_i\)’s are exponents greater than zero. For example, we can write \(60=2^2 \times 3 \times 5\), \(2 \times 3^2 \times 5\), etc.
Now it should be fairly easy to see that \(n\) is a square free number if none of the exponents are greater than 1! Because if any exponent \(e_j\) is greater than 1, then \(n\) would be divisible by a perfect square \(p_j^2\). This allows us to rewrite the definition of square free numbers as follows:
Let \(n\) be a positive integer. Then \(n\) is said to be a square free integer if all exponents of its prime factors are equal to one. 3
This definition also provides a way of examining whether an integer is square free or not. For example, because \(2310 = 2 \times 3 \times 5 \times 7 \times 11\), we know that it is a square free number; because \(2520 = 2^3 \times 3^2 \times 5 \times 7\), it is not a square free number. Isn’t this definition much easier to understand?
Therefore, when you come across a definition that is obscure, try to convert it into a form which you can handle with ease. I know there are a lot of unspoken techniques involved in this process, so it is vitally important that you do more exercises to perfect your skills.
Learn the foundation of proofs
In my opinion, a proof is a formal argument to show that a mathematical statement is true. Once you get familiar with writing proofs, it almost feels like a novelist writing his new piece. As a result, everyone can have his/her unique way of presenting an elegant proof, as long as the logic is consistent. However, despite being a highly malleable form of argument, there are still some basic rules to follow. Just like a novel can be of any topic, but it always needs to have characters, plot, theme, etc.
There are many well-known templates to write proofs, such as proof by contradiction, proof by induction and so on. I believe we may get to these advanced methods later in this semester, but they are not required at this stage. Now we are only constructing direct proofs, which has little constraint. However, there is one case where special care should be taken, that is when you are proving iff statements. Always remember that you need to prove both directions of an iff statement!
Prove the following statement:
Let \(a\) be an integer. Then \(a\) is odd if and only if \(a\) is the sum of two consecutive numbers.
We can write the statement like this (informally):
\[a\mbox{ is odd} \Leftrightarrow a\mbox{ is the sum of two consecutive numbers.}\]Proof:
(\(\Rightarrow\)) If \(a\) is odd, by definition, we know \(a = 2k+1\), where \(k\) is an integer. Because \(2k+1=k + (k+1)\), which is the sum of two consecutive numbers, we can conclude that \(a\) is the sum of two consecutive numbers.
(\(\Leftarrow\)) If \(a\) is the sum of two consecutive integers, let those two numbers be \(k\) and \(k+1\). It can be seen that \(a=k+(k+1)=2k+1\), which indicates that \(a\) is an odd number.
Remarks. For grading purposes, it would be better to write “\(\Rightarrow\)” and “\(\Leftarrow\)” explicitly. It demonstrates that you know how to write proofs properly.
Find a correct direction
Usually, you are asked to either prove/disprove a statement. These are two distinct directions, and only one of them is correct. Therefore, it is important to have an idea of whether the statement itself is actually true/false. If it seems to be true, we will prove it to be true (using direct proofs). It is seems to be false, then we can disprove it (with counterexamples).
One of the easiest ways to figure out if a statement is true or not is to test it with examples. An example is shown as below.
Proof or disprove:
The sum of two square free integers is a square free integer.
Confirming whether it is true or false:
-
Come up with some square free numbers. Using the new definition of square free numbers that we derived before, we can generate many square free numbers in the following ways:
\[\begin{align*} 2 &= 2\\ 3 &= 3\\ 6 &= 2 \times 3\\ 5 &= 5\\ 10 &= 2 \times 5\\ &\vdots \end{align*}\] -
Now we can test the statement with the square numbers above. For example, \(2+3=5\), which is square free. \(2+5=7\), which is square free. But \(2+6=8\), which is not square free. Therefore, we have found an counterexample, where the sum of two square free numbers is not square free. Therefore, we can go ahead to disprove this statement with this counterexample.
During the trial-and-error phase, if you have tested a number of cases, and the statement still holds true, then you should consider proving the statement to be true.
Remember the purpose of proving is to show that the statement is always true, given the constraints. It only takes one counterexample to disprove a statement, but to prove something, you need to convince everyone that the statement is perpetually correct. Therefore, you cannot prove a statement by examples, because it is usually impossible to enumerate all possible cases (except for some special cases where the number of possibilities is finite, e.g. Boolean logic).
Think about the well-known Goldbach’s conjecture, which states that “every even integer greater than 2 can be expressed as the sum of two primes.” For example, \(6=3+3\), \(8=3+5\), \(10=3+7\), \(12=7+5\), etc. People have tested all even numbers from 2 to 4,000,000,000,000,000,000 with computers, and the conjecture is true for all these numbers. But this doesn’t mean that this conjecture is proved, because the program can never test all possible even numbers. However, if the program finds one even number that cannot be represent as the sum of two primes, then we can immediate disprove this conjecture that has puzzled some of the most talented mathematicians around the world for hundred of years.
Just let it be
To this day, I still remember the catchphrase of my high school math teacher–when we had difficulty solving a question, he would always say “顺其自然”, which basically means “let it be”. In a mathematical context, it means to approach a question with what you have in hand, even when it seems very distant from what is being asked. It is somehow correct because all these exam/homework questions are designed in a way that they are solvable for an average student. Right now, you are not dealing with read-world problems. You are just solving questions that are meticulously created for students, which are supposed to be easy. If you are greatly confused by these questions, it only means that you are not familiar with the techniques taught in class.
With this attitude in mind, let’s look at the most difficult problem in homework #2, which is to prove/disprove “the product of two Toyota numbers is a Toyota number.” The first step is to figure out whether the statement is true or not. To do that, we need to find some Toyota number. With the new Toyota number definition above, we can immediately enumerate these Toyota numbers: 1, 3, 4, 6, 7, 9, … And then we can start the testing phase. We can quickly verify that \(3 \mid (3 \times 4)^2 + 5 \times (3 \times 4)\), \(3 \mid (4 \times 7)^2 + 5 \times (4 \times 7)\), \(3 \mid (6 \times 9)^2 + 5 \times (6 \times 9)\), so we should consider proving this statement instead of disproving it.
Let \(m\), \(n\) be two Toyota numbers, then by definition, we know that \(3 \mid m^2 + 5m\) and \(3 \mid n^2 + 5n\). Now we need to find out if the product of these two Toyota numbers (which is \(mn\), not \((m^2 + 5m)(n^2 + 5n)\)) is a Toyota number. Using the definition of Toyota numbers, we can say that our goal is to determine if \(3 \mid (mn)^2 + 5mn\) is true.
Right now, there is not much to work with, as all statements we have are discriminative rather than quantitative. More specifically, \(3 \mid m^2 + 5m\) just tells you “3 divides \(m^2 + 5m\)”, but there is not a value or equality that you can play with. Recall the definition of divisibility indicates that there exists an integer \(k_1\) such that \(m^2 + 5m = 3k_1\). Similarly, there is another integer \(k_2\) such that \(n^2 + 5n = 3k_2\). We have gone from nothing to something, namely two equalities to work with:
\[\begin{align*} m^2 + 5m &= 3k_1,\\ n^2 + 5n &= 3k_2. \end{align*}\]Our goal is to prove \(3 \mid (mn)^2 + 5mn\). Here, \((mn)^2\) is a quadratic term, which is difficult to deal with. If we look at the two equalities, it is not hard to observe that
\[\begin{align*} m^2 &= 3k_1 - 5m,\\ n^2 &= 3k_2 - 5n, \end{align*}\]which means we can substitute the quadratic terms with linear terms. This can bring us closer to form of the second term (\(5mn\)) in the target, maybe there is a chance for something magical to happen. Therefore, we can write
\[\begin{align*} (mn)^2 + 5mn &= m^2n^2 + 5mn\\ &= (3k_1 - 5m)(3k_2 - 5n) + 5mn\\ &= 9k_1k_2 - 15k_1n - 15k_2m + 25mn + 5mn\\ &= 9k_1k_2 - 15k_1n - 15k_2m + 30mn\\ &= 3(k_1k_2 - 5k_1n - 5k_2m + 10mn). \end{align*}\]Because \(k_1k_2 - 5k_1n - 5k_2m + 10mn\) is an integer, by the definition of divisibility, we can conclude that \(3 \mid (mn)^2 + 5mn\), which means \(mn\) is a Toyota number.
The thought process of the solution is clear:
- Find out if we should prove or disprove the statement.
- Write down our target.
- Derive a step further from what we have known to generate two equalities to work with.
- Compare our target and the equalities, then find a way to combine them.
- The result shows that the statement is true.
I think the “let it be” spirit can be reflected vividly in this process. When you don’t know whether to prove or disprove, you just test the statement with cases to find a general direction. When there is no equation to work with, you create something out of nowhere. When you do have something in your hand, you go ahead and figure out a way to combine them so that you can unravel the answer that is carefully hidden by the test maker. Try to play with the knowledge in your head and rearrange the equations on your draft paper. At some point, you will come up with something constructive.
If you are not that good at observing…
In the proof above, there is a “clever step” where we substitues the \((mn)^2\) term with the product of two linear terms. What if you are unable to devise it on your own? In the discussion above, we have shown that the definition of Toyota numbers is equivalent to:
A positive integer \(n\) is said to be a Toyota number if either \(n\) is divisible by 3 or \(n+5\) is divisible by 3 (or both).
Let \(m\), \(n\) be two Toyota numbers, there are only four possibilities:
What do we do next? We’ll have to verify them one by one!
-
If \(3 \mid n, 3 \mid m\), we can write \(n = 3k_1, m=3k_2\), then \(mn = 9k_1k_2\). It can be seen that
\[\begin{align*} (mn)^2 + 5mn &= (9k_1k_2)^2 + 5 \cdot (9k_1k_2)\\ &= 81k_1^2k_2^2 + 45k_1k_2\\ &= 3(27k_1^2k_2^2 + 15k_1k_2). \end{align*}\]Hence, we know that \(mn\) is a Toyota number in this case.
-
If \(3 \mid (n + 5), 3 \mid m\), we can write \(n + 5 = 3k_1, m = 3k_2\). Therefore, \(n = (3k_1 - 5)\) and \(mn = 3k_2(3k_1 - 5)\). It can be seen that
\[\begin{align*} (mn)^2 + 5mn &= \left[3k_2(3k_1 - 5) \right]^2 + 5 \cdot \left[3k_2(3k_1 - 5)\right]\\ &= 9k_2^2(3k_1 - 5)^2 + 15k_2(3k_1 - 5)\\ &= 3\cdot \left[ 3k_2^2(3k_1 - 5)^2 + 5k_2(3k_1 - 5) \right] \end{align*}\]Hence, we know that \(mn\) is a Toyota number in this case.
-
If \(3 \mid n, 3 \mid (m + 5)\), similar to Case 2, we know that \(mn\) is a Toyota number in this case.
-
If \(3 \mid (n + 5), 3 \mid (m + 5)\), we can write \(n + 5 = 3k_1, m + 5= 3k_2\). Therefore, \(n = (3k_1 - 5)\) and \(m = (3k_2 - 5)\). Now, we have \(mn = (3k_1-5)(3k_2-5)\). It can be seen that
\[\begin{align*} (mn)^2 + 5mn &= \left[(3k_1-5)(3k_2-5)\right]^2 + 5 \cdot \left[(3k_1-5)(3k_2-5)\right]\\ &= (3k_1-5)(3k_2-5) \left[ (3k_1-5)(3k_2-5) + 5 \right]\\ &= (3k_1-5)(3k_2-5) (9 k_{1} k_{2} - 15 k_{1} - 15 k_{2} + 30)\\ &= 3 (3k_1-5)(3k_2-5) (3 k_{1} k_{2} - 5 k_{1} - 3 k_{2} + 10). \end{align*}\]Hence, we know that \(mn\) is a Toyota number in this case.
We have shown that \(mn\) is a Toyota number in all four possible cases. Therefore, \(mn\) is always a Toyota number.
There are always multiple ways to solve a question. Of course, this approach is more complicated than the previous one, but it is still a valid proof that can get you full marks. If you just try to play with the information given by the question, you will get yourself closer to one of the correct paths and eventually come up with a valid solution.
Beyond this help session…
If you want to do better in course, try these:
- Read the textbook carefully.
- Finish some practice questions on textbook.
- If you find it difficult to solve homework questions, feel free to come to office hours.
- Access different types of resources. For example, learn from YouTube, Coursera, etc.
- Rewrite proofs that you did in course activities and office hours to consolidate your impression.
-
Don’t ever write an expression like this! \(2 \mid m\) means “two divides \(m\)”, it does not indicate any value! Another similar example is the perpendicular symbol (\(\perp\)). When you write \(a \perp b\), it means \(a\) is perpendicular to \(b\). You can’t say \(c = a \perp b\). ↩
-
There is still one key step missing: in step 2, we assume that \(n>1\). So for the new definition to be completely identical to the old one, we also need to verify one more case, i.e. when \(n = 1\). There is a chance that when \(n=1\), our new definition fails to represent the old one. Fortunately, these two definitions are indeed equivalent. ↩
-
Again, we did not consider \(n=1\). It should be added into this definition as a special case. For simplicity, I am leaving it in the footnotes. This just shows the expressive power of mathematical definitions: sometimes a shorter definition can be more accurate than a longer one. ↩