0% found this document useful (0 votes)
2 views46 pages

Lecture 1

The document outlines a course on Selected Topics in Discrete Mathematics, highlighting its relevance to various fields such as computer science and mathematics. It covers foundational concepts like logic, proofs, algorithms, and propositional logic, along with applications in digital circuits. References for further reading and resources, including textbooks and video links, are also provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views46 pages

Lecture 1

The document outlines a course on Selected Topics in Discrete Mathematics, highlighting its relevance to various fields such as computer science and mathematics. It covers foundational concepts like logic, proofs, algorithms, and propositional logic, along with applications in digital circuits. References for further reading and resources, including textbooks and video links, are also provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Selected Topics

Spring 2025 - Dr. Mohamed Medhat


Dr. Bassant Mostafa
Selected Topics
Lecture 1
Selected Topics in Discrete Mathematics

• Topics in discrete mathematics will be important and basics in many courses that you will
take in the future:

• Computer Science: Computer Architecture, Data Structures, Algorithms, Programming


Languages, Compilers, Computer Security, Databases, Artificial Intelligence, Networking,
Graphics, Game Design, Theory of Computation, ......

• Mathematics: Logic, Set Theory, Probability, Number Theory, Abstract Algebra,


Combinatorics, Graph Theory, Game Theory, Network Optimization, ...

• Other Disciplines: You may find concepts learned here useful in courses in philosophy,
economics, linguistics, and other departments.
References
• Kenneth Rosen, (2019) Discrete Mathematics and Its Applications, McGraw-Hill Higher.
• Susanna S. Epp, (2019) Discrete Mathematics with Applications, Cengage Learning.

• https://www.youtube.com/watch?v=eFDzhn1Inc4&list=PLxIvc-
MGOs6gZlMVYOOEtUHJmfUquCjwz

• https://www.youtube.com/watch?v=Ho7BD7Yqqtk&list=PLZyQU-
WOzZF1rmALoJZthmDKPsqxCV4mW
Table of Contents

● The Foundations: Logic and Proofs


● Basic Structures: Sets, Functions, Sequences and Matrices
● Algorithms
● Number Theory
● Induction and Recursion
● Counting Techniques
● Discrete Probability
● Relations
● Graphs
● Trees
● Boolean Algebra
Some topics from the following sections

• Introduction to Propositional Logic.


• Compound Propositions.
• Applications of Propositional Logic.
• Propositional Equivalences.
• Predicates and Quantifiers.
• Arguments.
What is Logic?
• Logic is the discipline that deals with the methods of reasoning.

• On an elementary level, logic provides rules and techniques for determining whether a
given argument is valid.

• Logical reasoning is used in mathematics to prove theorems.

A proposition (or statement) is a declarative sentence (that is, a sentence that declares a fact)
that is either true or false, but not both.

• The area of logic that deals with propositions is called propositional logics.
The Foundations: Logic and Proofs
Propositional Logic
Proposition:
Not [Questions - Command - Opinion - probabilities – variables]

EXAMPLE 1

1. Washington, D.C., is the capital of the United States of America.


2. Alexandria is the capital of Egypt.
3. 1 + 1 = 2.
4. 2 + 2 = 3.

Propositions 1 and 3 are true, whereas 2 and 4 are false.


The Foundations: Logic and Proofs

➢ Sentences 1 and 2 are not propositions because they are not declarative sentences.
➢ Sentences 3 and 4 are not propositions because they are neither true nor false.

➢ Note that each of sentences 3 and 4 can be turned into a proposition if we assign values to the variables.
The Foundations: Logic and Proofs
Examples: Propositions Truth value
2+3= 5 True
5−2= 1 False
Today is Friday False
𝑥+3= 7, for 𝑥 = 4 True
Cairo is the capital of Egypt True

Sentences Is a Proposition
What time is it? Not propositions
Read this carefully. Not propositions
𝑥+3= 7 Not propositions
The Foundations: Logic and Proofs

We use letters to denote propositional variables (or statement variables), that


is, variables that represent propositions, just as letters are used to denote
numerical variables.

The conventional letters used for propositional variables are p, q, r, s, The truth
value of a proposition is true, denoted by T, if it is a true proposition, and the
truth value of a proposition is false, denoted by F, if it is a false proposition.
The Foundations: Logic and Proofs
Simple (Primitive) propositions contain one sentence true or false.

Many mathematical statements are constructed by combining one or more propositions.


New propositions, called compound propositions, are formed from existing propositions
using logical operators.

Compound propositions combines between more than one propositions and need to
connect between them.
It is raining today, and I am happy.
The Foundations: Logic and Proofs

Negation:

Other notations you might see are:


The Foundations: Logic and Proofs

Example:

Find the negation of the proposition

𝑝: “Cairo is the capital of Egypt”


The Foundations: Logic and Proofs

Find the negation of the proposition

𝑝: “Cairo is the capital of Egypt”

Solution: The negation is

¬𝑝: “It is not the case that Cairo is the capital of Egypt”

This negation can be more simply expressed as

¬𝑝: “Cairo is not the capital of Egypt”


The Foundations: Logic and Proofs
The Foundations: Logic and Proofs

The truth table for the Negation of the propositions.

P ¬p

T F

F T

This table has a row for each of the two possible truth values of a proposition p. Each row
shows the truth value of ¬p corresponding to the truth value of p for this row.
No. of (Propositions) inputs
No. of rows appear in a truth table: 2
The Foundations: Logic and Proofs

It is raining today, and I am happy.

𝑝: Today is Friday.
𝑞: It is raining today.
𝑝 ∧ 𝑞: Today is Friday and
it is raining today.
The Foundations: Logic and Proofs

It is raining today, or I am happy.

𝑝: Today is Friday.
𝑞: It is raining today.
𝑝 ∨ 𝑞: Today is Friday or
it is raining today.
The Foundations: Logic and Proofs

Example

p : They are parents.


q : They are children.
p  q : They are parents or
children but not both.

p  q  (p ∧ ¬ q) ∨ (¬ p ∧ q)
The Foundations: Logic and Proofs

Implication
CONDITIONAL

(¬ p ∨ q)
The Foundations: Logic and Proofs

Example 1:

Or

Example 2:
The Foundations: Logic and Proofs

BICONDITIONAL
The Foundations: Logic and Proofs
Precedence of logical operators.

Brackets first ()

No. of (Propositions) inputs


No. of rows appear in a truth table: 2
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
Example

𝒑 𝒒 𝒓 ¬𝒒 𝒑 ∧ ¬𝒒 𝒑 ∧ ¬𝒒 → 𝒓
𝐓 𝐓 𝐓
𝐓 𝐓 𝐅
𝐓 𝐅 𝐓
𝐓 𝐅 𝐅
𝐅 𝐓 𝐓
𝐅 𝐓 𝐅
𝐅 𝐅 𝐓
𝐅 𝐅 𝐅
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
Example

𝒑 𝒒 𝒓 ¬𝒒 𝒑 ∧ ¬𝒒 𝒑 ∧ ¬𝒒 → 𝒓
𝐓 𝐓 𝐓 𝐅
𝐓 𝐓 𝐅 𝐅
𝐓 𝐅 𝐓 𝐓
𝐓 𝐅 𝐅 𝐓
𝐅 𝐓 𝐓 𝐅
𝐅 𝐓 𝐅 𝐅
𝐅 𝐅 𝐓 𝐓
𝐅 𝐅 𝐅 𝐓
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
Example

𝒑 𝒒 𝒓 ¬𝒒 𝒑 ∧ ¬𝒒 𝒑 ∧ ¬𝒒 → 𝒓
𝐓 𝐓 𝐓 𝐅 𝐅
𝐓 𝐓 𝐅 𝐅 𝐅
𝐓 𝐅 𝐓 𝐓 𝐓
𝐓 𝐅 𝐅 𝐓 𝐓
𝐅 𝐓 𝐓 𝐅 𝐅
𝐅 𝐓 𝐅 𝐅 𝐅
𝐅 𝐅 𝐓 𝐓 𝐅
𝐅 𝐅 𝐅 𝐓 𝐅
The Foundations: Logic and Proofs
Truth Tables of Compound Propositions
Example

𝒑 𝒒 𝒓 ¬𝒒 𝒑 ∧ ¬𝒒 𝒑 ∧ ¬𝒒 → 𝒓
𝐓 𝐓 𝐓 𝐅 𝐅 𝐓
𝐓 𝐓 𝐅 𝐅 𝐅 𝐓
𝐓 𝐅 𝐓 𝐓 𝐓 𝐓
𝐓 𝐅 𝐅 𝐓 𝐓 𝐅
𝐅 𝐓 𝐓 𝐅 𝐅 𝐓
𝐅 𝐓 𝐅 𝐅 𝐅 𝐓
𝐅 𝐅 𝐓 𝐓 𝐅 𝐓
𝐅 𝐅 𝐅 𝐓 𝐅 𝐓
The Foundations: Logic and Proofs

Computers represent information using bits. A bit is a symbol with two possible
values, namely, 0 (zero) and 1 (one). This meaning of the word bit comes from binary
digit, because zeros and ones are the digits used in binary representations of numbers
A bit can be used to represent a truth value, because there are two truth values, namely,
true and false. As is customarily done, we will use a 1 bit to represent true and a 0 bit to
represent false. That is, 1 represents T (true), 0 represents F (false). A variable is called a
Boolean variable if its value is either true or false. Consequently, a Boolean variable
can be represented using a bit.
The Foundations: Logic and Proofs

• We will also use the notation OR, AND, and XOR for
the operators ∨, ∧, and ⊕, as is done in various
programming languages.
The Foundations: Logic and Proofs
Bit Strings

• Information is often represented using bit strings, which are lists of zeros and ones.
When this is done, operations on the bit strings can be used to manipulate this
information.

Ex: 101010011 is a bit string of length nine.


The Foundations: Logic and Proofs
The Foundations: Logic and Proofs

Example: Prove that

No of propositions =3
p, q, and r
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Applications of Propositional Logic:

Logic Circuits
• A logic circuit (or digital circuit) receives input signals
𝑝1 , 𝑝2 , … , 𝑝𝑛 , each a bit [either 0 (off) or 1 (on)], and
produces output signals 𝑠1, 𝑠2, … , 𝑠𝑛, each a bit.
The Foundations: Logic and Proofs
Applications of Propositional Logic:

Logic Circuits:
The Foundations: Logic and Proofs
Applications of Propositional Logic:

Example
• Build a digital circuit that produces the output
(𝑝 ∨ ¬𝑟) ∧ (¬𝑝 ∨ (𝑞 ∨ ¬𝑟))
when given input bits 𝑝, 𝑞, and 𝑟.
The Foundations: Logic and Proofs
Applications of Propositional Logic:

(𝑝 ∨ ¬𝑟) ∧ (¬𝑝 ∨ (𝑞 ∨ ¬𝑟))


The Foundations: Logic and Proofs
Applications of Propositional Logic:

(𝑝 ∨ ¬𝑟) ∧ (¬𝑝 ∨ (𝑞 ∨ ¬𝑟))


The Foundations: Logic and Proofs
The Foundations: Logic and Proofs

Spring 2025 - Dr. Mohamed Medhat


Dr. Bassant Mostafa

You might also like