Discrete Math Lecture 1
Discrete Math Lecture 1
Week 1 Class 1
Topics:
Propositions and truth values (1.1)
And and Or Operators (1.1)
Truth Tables (1.1)
Goals
1. Understand the importance of logic in computer science.
2. Understand what is a proposition and what is not a proposition.
3. Learn about basic operations on propositions (how to combine two or more
propositions)
4. Learn how to remember rules using a truth table.
Both are dumb electronic devices. The only difference is that your computer can follow instructions
precisely and very fast.
Why are computers so good? – they Follow instructions, precisely, very fast.
What we need to do then? Convert our real life problems into precisely stated facts and instructions.
Why do we need logic? Because human language is not precise ... can have multiple meanings, and is
difficult to represent symbolically.
(Example: Even laws require interpretation, because people argue on what the law actually means.)
Solution? Take out the part that has double meanings or no meaning, and leave out the language that
has only one meaning.
In other words: Logic allows us to make our imprecise and double-meaning language into precisely
defined arguments subject to specific laws; the laws allow us to process and combine the facts and
reach a conclusion. (Taking out the guesswork!)
Example: We know that when it rains, the roads will be wet. You look outside and see that it is
raining. What does that tell you about road conditions? Wet or dry?
It may be obvious to you that the roads will be wet. But how do YOU know that? You
subconsciously combined the rule (rain means wet roads) and the fact (it is raining) to reach the
conclusion.
1
Basic building block of logic: Propositions
Proposition: A proposition is a declarative sentence (that is, a sentence that declares a fact) that
is either true or false, but not both (or none).
Example:
The temperature outside is 80 degrees. (true if the thermometer reads 80 degrees, false
otherwise)
Both of the above statements are either false or true (not none, or not “both”).
Propositional variables: lowercase letters used to represent propositions. (Writing out entire
sentences is cumbersome, so we use these as shortcuts)
p: It is snowing today.
q: The temperature outside is now 80 degrees
Truth value: The value a propositional variable can have. The only possible values are True
(often written as T), False (written as F)
Operations on propositions:
Operators are used to symbolize an action taken on one or more propositons.
They can be unary (applied to only one proposition) or binary (applied to two propositions)
How do we combine two propositions? (e.g., It is snowing today and the professor is
wearing a red jacket)
2
Negation operator: ¬
It negates (flips the value from True to False or False to True) of the proposition.
How to negate an English sentence proposition? : Two steps – first add “It is not the case that” before
the original sentence. Second, simplify the sentence if possible.
Example:
To negate the proposition “I have a red car”, we first write, “It is not the case that I have a red car”.
Then we can simplify it as “I do not have a red car”.
And (a.k.a. conjunction): When we want the combined proposition to be true only when both
propositions are true.
Or (a.k.a. disjunction): when we want the combined proposition to be true only if either/both are
true.
A Truth Table is a tabular way to show the result of an action, using all possible values of the
variables. Variables (or their combinations) to in the top row, the rest of the rows are filled with truth
values.
3
Truth table for conjunction (and) Truth table for disjunction (or)
Further reading:
Sections 1.1.1-1.1.2
Practice suggestion:
Go through examples 1-9. See how they are solved. Then using the same approach, try solving
Interesting people:
Aristotle (see bottom of page 2) started the field of logic. After two thousand years, George Boole
(page 5) in the 19th century introduced symbolic/mathematical logic and greatly advanced the field.