Mathematics for Computer Science


Mathematics for Computer Science

Corey
Welcome to 6.1200, or 6.120—either pronunciation works. Before getting into the mathematics, let's lay out how the course is organized. Lectures meet Tuesdays and Thursdays from 2:30 to 4:00, and recitations meet Wednesdays and Fridays.

Maria
Recitation is especially important because attendance is worth 10 percent of the grade. More importantly, it is a limited, valuable opportunity to work with peers in small groups while a teaching assistant offers advice and suggestions.

Corey
There are also warmup problems on Canvas. They are short, multiple-choice questions intended to get you thinking about the lecture material before recitation, not to create stress. You have infinite retries and immediate feedback until the deadline, so remembering to complete them should be enough to earn full credit.

Maria
The point is not to click through every option randomly, even though the system technically allows repeated attempts. Ideally, you think about the question first, so you arrive at recitation already familiar with the lecture topics and ready to ask questions and solve problems.

Corey
Weekly problem sets are released on Tuesdays and are due Monday nights at 11:59 PM. Collaboration is encouraged. You can work with friends, classmates in your residence hall, people you meet in office hours, or partners matched through the weekly problem-set partner site.

Maria
The partner site matches students with similar schedules shortly after each problem set is released, so sign up on time. If you miss the first matching round, there is another opportunity, and office hours are another good place to find collaborators.

Corey
But the central rule is: solve together, write alone. You can collaborate while figuring out challenging problems and keep the notes your group creates. When you prepare the submitted problem set, though, put those notes aside and reconstruct each solution in your own words.

Maria
That writing step matters because one of the main goals of the course is proof writing: producing precise, concise, correct mathematical arguments. Understanding someone else's proof is easier than constructing that proof yourself. Reading a solution and thinking, 'That makes sense,' does not prove that you could have discovered and written the argument independently.

Corey
Late problem sets are accepted through and including the last day of classes. During the first 50 hours after the deadline, the credit decreases by one percentage point per hour, from 100 percent on time to 50 percent at 50 hours late. After those first 50 hours, the submission earns 50 percent for the rest of the term.

Maria
So if you are one hour late because you need time to finish a final problem, you still receive 99 percent of the available points. The policy is designed to reduce stress and encourage you to work through the material, even if your schedule means a submission is late. More details are available in the course information and policies document on Canvas.

Corey
Now for the mathematics. A proof is a method of ascertaining truth—it is how we show that something is true. Society uses different methods in different settings: experiments and observation in the physical sciences, sampling to estimate election results, legal trials to determine what happened and who is responsible, investigations based on evidence, authority, religion, or even inner conviction.

Maria
Mathematics has its own procedure. A mathematical proof is a verification of a proposition by a chain of logical deductions from a base set of axioms. That definition has three important parts: proposition, logical deduction, and axioms. The first term to understand is proposition.

Corey
A proposition is a statement that is either true or false. 'Today is Tuesday' is a proposition if it is Tuesday, and 'Today is Thursday' is also a proposition even if it is false. Likewise, '2 plus 3 equals 5' and '2 plus 3 equals 4' are both propositions because each can be evaluated as true or false.

Maria
A statement can also contain quantifiers. For example, 'For all n in the natural numbers, n squared plus n plus 41 is prime' is a proposition. The natural numbers, written with blackboard-bold N, are 0, 1, 2, 3, and so on; for this course, zero is included.

Corey
Compare that with 'p is prime.' That is not yet a proposition because we do not know which value p represents. It is a predicate: a parametrized statement whose truth depends on variables. Once we specify p—for example, '7 is prime' or '12 is prime'—the predicate becomes a proposition.

Maria
The expression n squared plus n plus 41 is prime is similarly a predicate involving n. The phrase 'for all natural numbers n' turns it into a proposition by requiring the predicate to hold for every natural number. Testing many examples does not establish a universal claim in mathematics.

Corey
For n from 0 through 39, the expression produces prime numbers, including 41, 43, 47, and eventually 1,601. But at n equals 40, it gives 41 squared, and at n equals 41, it gives 41 times 43. Those are not prime, so a single counterexample disproves the proposition.

Maria
Another example is Goldbach's Conjecture: every even number greater than 2 is the sum of two primes. Twelve works because 12 equals 7 plus 5, and 20 works because 20 equals 17 plus 3. Writing 20 as 9 plus 11 does not help, because 9 is not prime, but that also does not disprove the conjecture; one valid pair is enough for that particular number.

Corey
It is called a conjecture because mathematicians do not know whether the statement is true. Some very simple-looking questions in number theory remain beyond the reach of current mathematical tools. A proposition can therefore be perfectly well formed even when its truth value is not currently known.

Maria
Once we have propositions, we can combine them using Boolean operators. For a proposition A, not A is the proposition that A is false. It may be written as 'not A,' with a bar over A, or with a symbol resembling a right angle. Its truth table simply flips true to false and false to true.

Corey
For two propositions A and B, A and B is true only when both A and B are true. A or B is true when at least one of them is true. Mathematical 'or' is inclusive, meaning that it is also true when both A and B are true; it is false only when both are false.

Maria
That differs from everyday uses of 'or.' At a wedding, 'chicken or pasta' may mean choose exactly one, which is exclusive OR, or XOR. 'Coffee or tea' may allow either drink or neither but not both, while 'cream or sugar' might allow cream, sugar, both, or neither. Mathematical formulas use the precisely defined logical meaning, not whatever a conversational context suggests.

Corey
The same caution applies to the words 'and' and 'not.' Spoken language is imprecise and context-dependent, while mathematics needs exact meanings. If wording in class is ever unclear, ask for clarification; the instructor may have misstated something, or the question may reveal that the formal meaning needs to be made explicit.

Maria
Another essential operator is implication. A implies B can be written A arrow B or read 'if A, then B.' Its truth table has only one false case: A is true and B is false. The other three cases are true, including false implies true.

Corey
The rule 'On Wednesdays, we wear pink' makes that less mysterious. If it is Wednesday and someone is not wearing pink, the rule is violated. If it is Wednesday and the person is wearing pink, the rule is followed. On a non-Wednesday, the rule imposes no requirement, so wearing pink or not wearing pink both satisfy the implication.

Maria
In mathematics, implication does not automatically mean causation or a sequence in time. It does not say that A causes B or that A happens first. It is simply the logical relationship specified by the truth table, even when we do not yet know whether A or B is true.

Corey
Implication can be expressed using the earlier operators: A implies B is equivalent to B or not A. This highlights why the only failure occurs when A is true and B is false. If A is false, or if B is true, the implication is satisfied.

Maria
There are related forms worth recognizing. B implies A is the converse of A implies B. Not A implies not B is the inverse. Not B implies not A is the contrapositive. An implication is equivalent to its contrapositive, and the converse is equivalent to the inverse, but the original implication is not generally equivalent to its converse or its inverse.

Corey
For example, x less than 3 implies x less than 4, but the reverse does not necessarily hold. Knowing x is less than 4 does not tell us that x is less than 3. This distinction also explains why the statement 'I do not think, therefore I do not am' is not equivalent to Descartes' 'I think, therefore I am'; it uses an inverse-like reversal rather than the contrapositive.

Maria
Now let's establish some language for sets. A set is a collection of objects, written with curly braces. Order does not matter, and repetitions do not create additional elements. The sets containing 6, 1, 2, and 0; 2, 1, 6, and 0; and 6, 1, 2, 0, 0 are all the same set.

Corey
Important standard sets include the natural numbers N, the integers Z, the rationals Q, the real numbers R, and the complex numbers C. The rationals are numbers that can be written as one integer divided by a nonzero integer. The empty set contains no elements, but it is still a set; it is written with an empty pair of braces or with the empty-set symbol.

Maria
Be careful about elements and nested sets. If B contains 2, the set containing 3 and 4, and the empty set, then 3 is not an element of B; it is inside one of B's elements. The entire set containing 3 and 4 is an element of B, and the empty set itself is also an element of B.

Corey
The notation A is a subset of B means every element of A is also an element of B. The empty set is a subset of every set because there is no element of the empty set that could violate the requirement. Notice, however, that being a subset is different from being an element; the empty set can be a subset of A without being one of A's listed elements.

Maria
Sets can be combined in several ways. The union A union B contains everything in A or B or both. The intersection A intersect B contains exactly what is in both sets. The set difference A minus B, also written A backslash B, contains the elements of A that are not elements of B.

Corey
If a set contains another set as an element, membership does not pass through that inner set. For instance, if the set containing 3 and 4 is an element of B, then 3 is not an element of B. Consequently, subtracting B from another set removes that entire nested set only if it appears as an element; it does not remove separate elements 3 and 4 merely because they occur inside it.

Maria
Set-builder notation connects sets with predicates. The set of all natural numbers n such that n is prime selects from the natural numbers exactly those elements satisfying the predicate 'n is prime.' This notation lets us describe a subset by specifying both the larger set and the condition its elements must meet.

Corey
Tuples are different from sets. A tuple is an ordered list, written with parentheses, and repetitions are allowed. The tuple containing 6, 1, 2, and 0 differs from the tuple containing 6, 1, 2, 0, and 0 because one has four entries and the other has five. It also differs from 2, 1, 6, 0 because order matters.

Maria
We generally do not talk about unions, intersections, or differences of tuples, because those operations are defined for sets. Sets care about which elements are present; tuples care about sequence and position.

Corey
Let's return to the definition of proof: a verification of a proposition by a sequence of logical deductions from a base set of axioms. An axiom is a proposition that we assume is true. We do need assumptions to begin mathematics, but the important practice is to identify them in advance so we know what we are allowed to use.

Maria
Axioms are not necessarily claims that are universally self-evident. They are assumptions adopted for a particular mathematical system. Different choices can produce different, meaningful theories, as long as we understand which axioms we are using.

Corey
Euclid's parallel postulate illustrates this. In Euclidean geometry, for every point not on a given line, there is a unique line through that point parallel to the given line. For centuries, mathematicians tried to prove this postulate from Euclid's other four, but eventually established that it cannot be derived from them.

Maria
If the postulate is replaced with the claim that there are no such parallel lines, we obtain spherical geometry: the surface is a sphere, lines are great circles, and every pair of great circles intersects. If it is replaced with the claim that infinitely many such lines exist, we obtain hyperbolic geometry. These systems use different axioms and therefore support different conclusions, but they are still meaningful geometries.

Corey
A desirable set of axioms should be consistent, meaning that we cannot prove a contradiction—specifically, that false is true. If a system proved false, then by the principle of explosion, false would imply anything, and every proposition could be proved. The resulting theory would lose its ability to distinguish truth from falsity.

Maria
Ideally, a system would also be complete: every true proposition could be proved from its axioms. But Gödel's Incompleteness Theorem says that any sufficiently powerful consistent system—one capable of handling ordinary addition and multiplication—cannot be both consistent and complete.

Corey
So if we choose consistency, there must be true mathematical statements that cannot be proved using the current axioms. To prove one of those statements, we would need to add more axioms, but the expanded system would then have its own statements that remain unprovable. Goldbach's Conjecture could conceivably be an example, although its truth and provability are not settled here.

Maria
For this course, the working axioms are roughly the facts of standard high-school mathematics: familiar, general, and simple results that are normally part of every high-school curriculum. When using one, it is good practice to identify it—for example, state that the product of two even numbers is even—so the justification for every step in a proof is clear.

Corey
That brings the main ideas together. The course develops the ability to read, evaluate, and write proofs. To do that, we need precise propositions and predicates, carefully defined logical operators, a clear understanding of sets and tuples, and awareness of the axioms that support our deductions.

Maria
And on the practical side, attend recitations, complete the warmups, collaborate while solving problem sets, then write your submitted proofs independently. Check Canvas for recitation times and course policies, and remember that recitation is the next place to put these ideas into practice.

Ask anything
We've read this whole study set, so questions about it get the best answers.