29
Discrete Discrete Mathematical Mathematical Structure Structure Wednesday 6.45 pm to Wednesday 6.45 pm to 9.45pm 9.45pm

Lecture 1

Embed Size (px)

DESCRIPTION

Lecture 1

Citation preview

  • Discrete Mathematical Structure Wednesday 6.45 pm to 9.45pm

  • Foundations

    LogicSets and Functions

  • Logic Rules of Logic :specify the meaning of mathematical statements.(ie) it helps us to understand statement like there exist an integer that is not the sum of two square numbers For every positive integer n the sum of the positive integers not exceeding n is n(n+1)/2

  • LogicProposition: A declarative statement(ie) either true or false Example: 1+1 = 2 ; 7-1 = 6; Capital of Pakistan is Islamabad Capital of UAE is Dubai; 5+2 = 8Note: The first three statements are True the last two are false.

  • LogicConsider the following sentences What is the time ?Read this carefully.

    These sentences are neither true nor false.So they cannot be clamed as propositions

  • LogicArea of logic that deals with propositions is called propositional calculus or propositional Logic.

    Mathematical Statements are combinations of one or more propositions (ie) Compound Propositions.

  • LogicSome instances of propositions and their representations: It is raining to day Say p : raining to day Opposite of this statement (negation)It is not the case that it is raining to daySymbolized as ~p

  • LogicToday is Friday

    negation of this statement It is not the case that today is Friday or simply Today is not Friday

  • LogicConnectives Conjunction Examples: Its raining today and college declared holiday Two ideas: raining ; holiday connected by conjunction and Symbolically: Raining = r ; holiday = h then can be symbolized as r ^ h

  • Logic Truth table: Conjunction

  • Logic Connectives Disjunction Example: Get me cool drink or water

    Two ideas: get me cool drink ; get me water connected by disjunction or Symbolically: cool drink = c ; water = w then can be symbolized as c v w

  • LogicTruth Table: Disjunction

  • Negation :Truth table

  • Implications Implications: Conditional Statements

    If it rains then its a holiday Two ideas: raining = p ; holiday = q(ie) p implies q symbolizing

    If p then q

  • Logic: other forms of if thenIf p then q If p,q p is sufficient for q q if p q when p a necessary condition for p is q p implies qp only if q a sufficient condition for q is pq whenever pq is necessary for pq follows from p

  • Logic Truth table:

  • Logic

    Converse

    Contra positive

    Inverse If p then q

  • Logic Home team wins whenever it is rainingIf it is raining then the home team wins

    Converse If home team wins then it is raining

    Contra positive If the home team doe not win then it is not raining

    Inverse If it is not raining then the home team does not win

  • LogicBi conditional p if and only if q Truth Table

  • Logic: Precedence Like in arithmetic it important to put : brackets and parentheses; 2 X 3 2Can have any of the following interpretation: 2 X (3 2) (2 X 3 ) 2

  • LogicExample: Precedence of logical operators

    You can access the internet from the campus only if you are a computer science major or you are not a freshman.

    In symbol form

  • LogicExample: Precedence of logical operators You cannot ride the roller coaster if you are under 4 feet tall and older than 16 years. 3 ideas You can ride the roller coaster = q You are under 4 feet tall =rYou are older than 16 years = sIn symbol form

  • Logic- System Specifications Another example from the field of computer science The automated reply cannot be sent when the file system is full. q denotes the file system is full p denotes the automated reply can be sentFinally symbolized as

  • Determine whether the system specifications are consistent. The diagnostic message is stored in the buffer or it is retransmittedThe diagnostic message is not stored in the buffer if the diagnostic message is stored in the buffer, then it is retransmitted

    Logic- System Specifications

  • Logic- System SpecificationsSolution: For consistency system specification should not conflict (ie) there must be a true value assigned to all the variables in the expression should result in a true out put from each of the specificationp denotes : the diagnostic message is stored in the buffer q denotes the diagnostic message is retransmitted Then we can symbolize these ides as

  • Logic- System SpecificationsSolution

    To get a true out put from each of the specification p must be false and q must be true Recall the truth table

  • Boolean SearchesSearch university in new MexicoSearch 1 : NEW and MEXICO and UNIVERSITYResult : this will include all the pages of interest together with the list of new universities in Mexico.

    Search university in New Mexico or ArizonaSearch 2 : (NEW and MEXICO or ARIZONA) and UNIVERSITYResult: all the page that contains the word university and either both the words NEW and MEXICO or the word ARIZONA.

  • Logic PuzzlesIn an island that has two kinds of inhabitants, knights who always tell the truth, and their opposites, knaves, who always lie. You encounter two people A and B. What are A and B if A says B is a knight and B says the two of us are opposite type ?

  • Logic PuzzlesIn a flight crew, the position of pilot, copilot and the flight engineer are held by three persons Allen, Brown and Carr not necessarily in that order. The copilot who is an only child earns the least. Carr who married Browns sister earns more than the pilot. What position does each of the three hold?