CS231-Lecture 1

You might also like

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

CS231 - DISCRETE

MATHEMATICS
Lecture 1 - Introduction
Dr. Raja Hashim Ali
28 Aug 2018

FCSE - GIKI CS231 - Discrete Mathematics


Instructor, TA, Class timings,
Office hours
• Instructor
– Name: Dr. Raja Hashim Ali (teaching 1st time)
– Email: Hashim.ali@giki.edu.pk (Add “CS231[2018]” to the subject)
– Office: F8 A - Second floor (next to Hardware lab), FCSE.
– Office hours: Mon, Tues, Wed, Thurs 10.00-11.00 & by appointment.
• Teaching Assistant
– Name: Engr. Waleed Khalil (assisting 1st time)
– Email: waleed.khalil@giki.edu.pk
– Office: G35 - Office # 6, Ground floor, FCSE.
– Office hours: Mon, Wed 09.00-13.00, Tues 09.00-12.20, Thurs 14.30-
17.00
• Class Hours (all lectures in MLH 1 FCSE)
– Tues 14:30-15:20.
– Wed 14:30-15:20.
– Fri 15:30-16:20.

FCSE - GIKI CS231 - Discrete Mathematics


Class webpage, email
• GIKI Content Management System - GIKI CMS
– Read the page carefully and regularly!
– Get assignments, results and updates on the
page.
• Email policy
– Include CS231[2018] in the subject of your e-mail
– Use TA as much as possible.

FCSE - GIKI CS231 - Discrete Mathematics


Textbook
• Discrete Mathematics
and its applications
– Kenneth H. Rosen (Rosen)
– 7th edition
– McGraw Hill
– 2012
• Solution manual for odd
numbered exercises
available!

FCSE - GIKI CS231 - Discrete Mathematics


Evaluation and rules
• Evaluation:
– Assignments (6) 10%, quizzes (6) 15%, mid-term 30% and a Final
exam 45%.
• The following rules will be strictly enforced.
– All quizzes and examinations are closed book and closed notes.
– Do not schedule any absence during the semester - there are no
make-up quizzes.’
– All quizzes are unannounced.
– Due dates for all assignments are STRICT.
– All assignments must be received before the start of the class to
receive credit.
• No late assignment will be graded.
– It is your responsibility to make sure that the TA has ticked that you
have submitted the assignment - TA will not be responsible for the
unmarked missing assignment.
– Do not ever put your assignment/faryaad under the instructor’s/TA’s
office door.
FCSE - GIKI CS231 - Discrete Mathematics
Evaluation and rules
• Institute attendance policy to sit in final exams will be
STRICTLY enforced - 80% attendance - 36/45.
– A grace of 5% maybe given upon special circumstances
but NO MORE - less than 34 lectures  NO final exam.
• Attendance will be taken at the start of class
– If you come after 10 minutes, you are not allowed to
mark your presence  DO NOT insist with TA.
• PLEASE do not put proxy of your friend OR face the
music.
• If the class has started, use the back door.
– I will lock the front door at the start of each class (except
today) - DO NOT try, knock, kick or bang on it, if it is not
open!

FCSE - GIKI CS231 - Discrete Mathematics


Evaluation and rules
• Marking is performed by the TA for the assignments and quizzes,
and by the instructor for mid-term and final.
• The TA shall return the marked assignment, quiz, and mid-term
exams within 5 days after the submission.
• If you have a question about marking quizzes/assignments, talk to
TA.
– Only if something unreasonable has occurred will the instructor
intervene.
• Furthermore, there is a limit of 5 days from when an assignment
or quiz or mid-term is returned (whether you are there to receive
it or not including the day) for grading problems to be dealt with.
– After that period, such will not be considered.
– The sole exception to this rule is the final examination.
Evaluation and rules
• Cheating of any type will NOT be tolerated.
– Cheating in final exams will lead to straight F in course.
– Cheating in a quiz will result in 0/15% of quizzes.
– Cheating in an assignment will result in 0/10% in all assignments.
– Cheating in a mid-term will result in a 0/30% in mid-term exam.
– Proxy for a friend will lead to 3 absentees for both students.
• Observe discipline of the class and do not disturb the class in any
way.
– Mobile phones/tabs should preferably be not brought to class (NO
CALLS).
– Put mobile phones on silent (NO VIBRATION) in case of emergency.
– Mobile phones will be confiscated for a week (SEVEN days) in case it
disturbs the class.
– Making noise in the class, and talking to a friend will get you expelled
from the class and next class without warning!
– You are allowed to sleep (if you can) but do not snore!

FCSE - GIKI CS231 - Discrete Mathematics


Problems solved using discrete
mathematics
• How many secure passwords in a given length?
• Probability of winning ‘zero kaata’/Tic tac
toe/chess etc. from a certain position?
• How can I encrypt a message?
• Shortest paths between Topi and Islamabad
using public transportation?
• How many steps required to sort 10,000
numbers? Is this algorithm correct?
• How to design a circuit that multiply two
integers?

FCSE - GIKI CS231 - Discrete Mathematics


Why study discrete mathematics?
• Proof
– Ability to understand and create mathematical argument
• Gateway to more advanced CS courses
– Data structures,
– Algorithms,
– Automata theory,
– Formal languages,
– Database,
– Networks,
– Operating system,
– Security/Cryptography.

FCSE - GIKI CS231 - Discrete Mathematics


Guide for successful study
• No minimalist approach
– Homework would be sufficient! NOPE!!!
– Read relevant sections before coming to class
– Do the homework (of course!!!)
– Solve much more problems (odd numbered)
• Work regularly
– Most chapters are building blocks for other chapters
• So you cannot catch up 2 week lectures in 2 days
– On average 8 hours EVERY week!
• Creativity
– No questions will require you to put just numbers to formula.
– Need to know how to apply! This can be improved by practice!
• Learning  Book, class, note, homework
– It is combination of everything!
• Think yourself, discuss with your friends, write your own answer!

FCSE - GIKI CS231 - Discrete Mathematics


Course content
• Logic (Ch 1) • Combinatorics (Ch 6)
– Sum and product rules
– Propositional logic
– Pigeon hole principle
– Connectives – Permutations
– Conditional statements – Combinations
– Biconditionals – Binomial theorem
– Predicate logic – Generalized combinations
• Algorithm Analysis (Ch 3) • Graph theory (Ch 10, Ch 11)
– Big O notation – Types
– Theorems – Paths
– Application to common – Circuits
algorithms – Euler paths
– Hamiltonian paths
• Integers and algorithms (Ch 4)
– Shortest paths
– Number theory – Isomorphism
– Residue arithmetic – Planar graphs
– Integer representation – Trees
– Arithmetic algorithms – Spanning trees

FCSE - GIKI CS231 - Discrete Mathematics


FCSE - GIKI CS231 - Discrete Mathematics
Propositions
• A proposition is a statement that can be either
true (T) or false (F).
– “I have a laptop.”
– “I weigh 25 kg.”
– “3 = 2 + 1”
– “3 = 2 + 2”
• Not propositions:
– “Are you from Topi?”
– “x = 7”
– “The textbook is heavy.”

FCSE - GIKI CS231 - Discrete Mathematics


Propositional variables
• We use propositional variables to refer to
propositions
– Usually are lower case letters starting with p (i.e.
p, q, r, s, etc.)
– A propositional variable can have one of two
values: true (T) or false (F)
• A proposition can be…
– A single variable: p
– An operation of multiple variables: p∧(q∨¬ r)

FCSE - GIKI CS231 - Discrete Mathematics


Introduction to logical variables
• About a dozen logical operators
– Similar to algebraic operators + * - /
– For example “and”, “or”, “xor”, “not”, etc.
• In the following examples,
– p = “Today is Friday”
– q = “Today is my birthday”

FCSE - GIKI CS231 - Discrete Mathematics


Logical operators: Not (Negation)
• A “not” operation switches (negates) the truth value.

• Symbol:  or ~
• The negation of p, denoted by p (also denoted by ), is
the statement
“It is not the case that p.”
• The proposition p is read “not p.”
• The truth value of the negation of p, p, is the opposite
of the truth value of p.
• p = “It is not the case that today is Friday.”
FCSE - GIKI CS231 - Discrete Mathematics
Logical operators: And (Conjunction)
• Connective operator - an operator that connects two or more
propositions.
• An “and” operation is true if both operands are true and false otherwise.

• The conjunction of p and q, denoted by p  q, is the proposition “p and q.”


• Symbol: 
– It’s like the ‘A’ in And
• pq = “Today is Friday and today is my birthday”

FCSE - GIKI CS231 - Discrete Mathematics


Logical operators: Or (Disjunction)
• An “or” operation is false if both operands are false
and true otherwise.

• The disjunction of p and q, denoted by p  q, is the


proposition “p or q.”
• Symbol: 
• pq = “Today is Friday or today is my birthday (or
possibly both)”
FCSE - GIKI CS231 - Discrete Mathematics
Logical operators: Exclusive Or
(Exclusive disjunction)
• An “xor” operation is false if both operands are either
false or true, and true otherwise.

• The exclusive disjunction of p and q, denoted by p⊕q,


is the proposition “p or q, but not both.”
• Symbol: ⊕ ⊻
• p⊕q = “Today is Friday or today is my birthday, but not
both.”
FCSE - GIKI CS231 - Discrete Mathematics
QUESTIONS?

FCSE - GIKI CS231 - Discrete Mathematics

You might also like