0% found this document useful (0 votes)
59 views

Discrete Math Lecture 1

This document provides an overview of the topics to be covered in the first week of the CS 250 Discrete Structures course. The topics include propositions and truth values, and and or operators, and truth tables. The goals are to understand the importance of logic in computer science, understand what constitutes a proposition, learn how to combine propositions using basic operations, and use truth tables to formalize reasoning. Logic allows representing problems precisely using facts and rules in order to remove ambiguity from natural language. Propositions are declarative sentences that are either true or false, and propositional variables are used to represent propositions. Truth tables demonstrate the truth values of propositions and how operators like negation, conjunction and disjunction affect those values.

Uploaded by

RH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Discrete Math Lecture 1

This document provides an overview of the topics to be covered in the first week of the CS 250 Discrete Structures course. The topics include propositions and truth values, and and or operators, and truth tables. The goals are to understand the importance of logic in computer science, understand what constitutes a proposition, learn how to combine propositions using basic operations, and use truth tables to formalize reasoning. Logic allows representing problems precisely using facts and rules in order to remove ambiguity from natural language. Propositions are declarative sentences that are either true or false, and propositional variables are used to represent propositions. Truth tables demonstrate the truth values of propositions and how operators like negation, conjunction and disjunction affect those values.

Uploaded by

RH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

The University of Alabama at Birmingham

Department of Computer Science

CS 250 Discrete Structures Spring 2020 Instructor: Dr. Ragib Hasan

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.

Before we do anything: Please accept the following fact


Technically, there is no difference between your toaster and your computer.

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.

And here is where logic comes to the rescue!!

Logic: A systematic way of reasoning with facts.

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.

Logic allows us to formalize and systematize this type of reasoning.

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:

It is snowing today. (true if it is snowing, false if it is not snowing)

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”).

What are not propositions?


Statements that either have no specific truth values

Example: Questions, commands, unknown values.

Please stand up. (this is a command)


What is your name? (this is a question)
x-3 = 21 (this is true if x is equal to 24, it is false otherwise, so the value of the entire
statement is unknown)

Propositional variables: lowercase letters used to represent propositions. (Writing out entire
sentences is cumbersome, so we use these as shortcuts)

For example, we can write: .

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)

For example, operations can be

How do we negate a proposition? (i.e. say the opposite of a statement?)

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.

For example, Negation of the proposition p is ¬ p

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”.

Combining two propositions:

Combining two propositions can be done in two ways:

And (a.k.a. conjunction): When we want the combined proposition to be true only when both
propositions are true.

p ∧q is true if both p and q are true.

Or (a.k.a. disjunction): when we want the combined proposition to be true only if either/both are
true.

p ∨q is true if one or both of p and q is/are true.

How to remember these rules? Use a truth table

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.

Truth table for negation

3
Truth table for conjunction (and) Truth table for disjunction (or)

Further reading:

Rosen: Page 1 to top half of Page 6 (before 1.1.3)

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

Exercise 1-8. (See page 13)

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.

You might also like