Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Discrete Structure

Mathematical foundations of computer science

ALLPPT.com_ Free PowerPoint Templates, Diagrams and Charts


Discrete Structure
• Textbook
Discrete Mathematics and its Application by K. H. Rosen, 8th Edition
•Reference Texts
Discrete Mathematics, Lecture Notes, by L. Lovasz and K. Vesztergombi
Book of Proof, by Richard Hammack, 2009
•Assessments
•Quizzes (15%) Total 4 (No retake)
•Assignments (15%) Total 4 (No late submission)
•Class Activity (10%) No compensation
•Mid Term (20%) Unseen Problems
•Final Term (40%) Unseen Problems

•Course Learning Objective


• The students will be able to solve basic problems fundamental concepts of sets, relations, func-
tions, Loops, recursion, graphs, matrices, quantifiers and combinatorics.
• The students will be able to apply sets, relations, functions, etc. plus logical/mathematical con-
cepts to real problems in computer science, AI and data networking.
• The students will be able to demonstrate how mathematical concepts like graphs and tree con-
cepts are used to solve problems arising in the computer science.
Handshakes
In some countries it is customary at business meetings to shake hands with everybody in the
meeting. If there are 2 people there is 1 handshake, there are 3 people there are 3 handshakes
and so on.
• How many handshakes are there for 4 people?
• Copy and complete this table.

Number of people Number of handshakes

2
3
4
5
6
7 Do not join the points in this case as
8 we are dealing only with whole (dis-
9
10 crete) numbers.
• Plot the points on a Cartesian coordinate plane with the number of people
on the x-axis and the number of handshakes on the y-axis. d
• Write a formula for the number o handshakes, H, in terms of the number
of people, n.
Password

Each user on a computer system has a password, which


is six to eight characters long, where each character is an
uppercase letter or a digit. Each password must contain
at least one digit. How many possible passwords are
there?

Each user on a computer system has a password, which


is six to eight characters long, where each character is a
letter or a digit. Each password must contain at least
ONE DIGIT, ONE UPPER CASE and ONE LOWER CASE let-
ter. How many possible passwords are there?
Rolling dice

During the mid-1600s, mathematicians Blaise Pascal, Pierre de Fermat and Antoine Gombaud puz-
zled over this simple gambling problem:
• Which is more likely, rolling a six on four throws of one dice,
• or rolling a double six on 24 throws with two dice?
• Which option do you think is more likely? Why?

Rolling a dice three times


Tossing a coin once
Picking two cards from a pack of 52 playing cards
Recording the number of cars that pass the school gate in a 5-minute period.
0 and 1

• We can express the chance of an event occurring using a number


between 0 and 1. On this scale, 0 represents an impossible event
and 1 represents an event that is certain to happen.

Statement either True of False


1. The red apple is an element of the set.
2. The green apple is also a member of the set.
3. The yellow apple is also an element of the set.
4.The Orange is an element of the set
Computer

Computer science is the study of computers and computa-


tional systems. It is a broad field which includes everything
from the algorithms that make up software to how software
interacts with hardware to how well software is developed
and designed.

A Computer Scientist is a person who can construct algorithms based on con-


jectures he/she can prove.
Algorithms: Efficient and Correct

How do we approach:
• Solve a Problem (proofs – problem solving – Discrete Maths)
• Construct an Algorithm (Analysis of Algorithms – Data Structures)
• Develop Code (All other relevant skills)
Trichotomy
• Division into three parts or elements.
• A system based on three parts or elements, especially the theological description
of humans as consisting of body, soul, and spirit.

Means of Source of Goal of


knowledge knowledge knowledge

Mathematics Mathematics Soul / Spirit Intuition / Imagination Formal

Physical Circuits Hardware Body Physical Circuit Discrete

Programming Software Mind Reason / Problem Solving Abstraction


Mathematic
Mathematics for computer science is categorized

I Proofs
1 What is a Proof? III Counting
2 The Well Ordering Principle 14 Sums and Asymptotics
3 Logical Formulas 15 Cardinality Rules
4 Mathematical Data Types 16 Generating Functions
5 Induction
6 State Machines IV Probability
7 Recursive Data Types 17 Events and Probability Spaces
8 Infinite Sets 18 Conditional Probability
19 Random Variables
II Structures
9 Number Theory
10 Directed graphs & Partial Orders
11 Communication Networks
12 Simple Graphs
13 Planar Graphs
Proof

• A mathematical proof is an argument which convinces other people that


something is true.
• In mathematics, we study statements, sentences
• that are either true or false but not both.
For example,
6 is an even integer
And
4 is an odd integer are statements.
(The first one is true, and the second is false.) We will use letters such as ‘p’
and ‘q’ to denote statements.

In logic, we have certain operations for combining or modifying statements;


some of these operations are ‘and’, ‘or’, ‘not’,
Proof

Not. If p is a statement, then ‘not p’ is defined to be


• true, when p is false;
• false, when p is true. The statement ‘not p’ is called the negation of p.
And. If p and q are two statements, then the statement ‘p and q’ is defined to be
• true, when p and q are both true;
• false, when p is false or q is false or both p and q are false.
Or. If p and q are two statements, then the statement ‘p or q’ is defined to be
• true, when p is true or q is true or both p and q are true;
• false, when both p and q are false.
If. . . then. If p and q are statements, then the statement ‘if p then q’ is defined to be
• true, when p and q are both true or p is false;
• false, when p is true and q is false. We sometimes abbreviate the statement
‘if p then q’ by ‘p implies q’, or ‘p ⇒ q’. If p is false, then we say that p ⇒ q is vac-
uously true. If and only if. If p and q are statements, then the statement ‘p if and only
if q’ is defined to be
• true, when p and q are both true or both false;
• false, when one of p, q is true and the other is false. The symbol for ‘if and
only if’ is ‘ ⇐⇒ ’. When p ⇐⇒ q is true, we say that p and q are equivalent.
Proof
Structures

• The properties of the set of integers are the subject of Number Theory
OR Number theory is the study of the integers.
• Numbers as a “structure” that has multiple parts of different kinds.
 One part is, of course, the set of all the integers.
 A second part is the collection of basic integer operations: addition, multiplication, expo-
nentiation,. . . .
 Other parts are the important subsets of integers—like the prime numbers—out of which
all integers can be built using multiplication.
• Structured objects more generally are fundamental in computer science. Whether
you are writing code, solving an optimization problem, or designing a network, you
will be dealing with structures.
• Graphs, also known as networks, are a fundamental structure in computer science.
Graphs can model associations between pairs of objects; for example, two exams
that cannot be given at the same time, two people that like each other, or two sub-
routines that can be run independently.
Counting

• Counting seems easy enough: 1, 2, 3, 4,


etc. This direct approach works well for
counting simple things,.
• The number of different ways to select a dozen
doughnuts when there are five varieties available.
• The number of 16-bit numbers with exactly 4
ones.
Answer: Perhaps surprisingly, but certainly
not coincidentally, these two numbers are
the same: 1820.
Counting

Counting is useful in computer science for several reasons:


• Determining the time and storage required to solve a
computational problem— a central objective in com-
puter science—often comes down to solving a counting
problem.
• Password and encryption security counts on having a
very large set of possible passwords and encryption
keys.
• Counting is the basis of probability theory, which plays
a central role in all sciences, including computer science.
Probability

• Probability can be conceptualized as finding the


chance of occurrence of an event. Mathemati-
cally, it is the study of random processes and
their outcomes.
• Probability is especially important in computer
science—it arises in virtually every branch of the
field. In algorithm design and game theory, for
example, algorithms and strategies that make
random choices at certain steps frequently out-
perform deterministic algorithms and strategies.
Probability

• Probability is the study of likelihood.


1. How likely is it to rain tomorrow?
2. What are the chances that you’ll be dealt a pocket pair in a poker
game?
3. What is the likelihood of earning a living as a concert pianist?
These are all questions that probability can help answer.
• We measure probability on a scale from 0 to 1, where 0 and
1 both represent certainty.
• A probability of 0 indicates that an event will definitely not
happen, while a probability of 1 indicates that the event defi-
nitely will happen.
• We can express probabilities using decimals, percentages, or
fractions.

You might also like