• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Nested loop
 

Nested loop

on

  • 784 views

Presentation on Predicate Logic as Symbolic Logic & the Concept of Nested Loops in Predicate Logic

Presentation on Predicate Logic as Symbolic Logic & the Concept of Nested Loops in Predicate Logic

Statistics

Views

Total Views
784
Views on SlideShare
784
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Nested loop Nested loop Presentation Transcript

      • Nepal College of
      • Informaiton Technology
      • Balkumari, Lalitpur
      May 18, 2010 ॐ NEPAL COLLEGE OF INFORMATION TECHNOLOGY  _ _ _ _ _ _ _ _ _ _ _ _ 2001
      • make statements about individual subjects
      • predicate P(x) has two parts:
        • variable ‘x’ is the subject of statement
        • propositional function P is the property that the subject can have
      • property of an inference
      May 18, 2010
      • property of description of subject in “domain or universe of discourse”
      • P(x) predicate
      • two condition:
        • all values of ‘x’ true
        • some values of ‘x’ true
      May 18, 2010 ‘ n’ objects ‘ x’ values
      • dynamic in nature
      • logic operator are used so called predicate logic
      • quantifiers & variables are used & variables bound the quantifier (universal or existential or both) i.e. symbolic logic
      May 18, 2010
      • P(x) : “x is man”
      • For all values of ‘x’, if P(x) is true then  x P(x) exists
      • For some values of ‘x’, if P(x) is true then  x P(x) exists
      • “ All students in this class love discrete structure.”
      •  x love(x, discrete structure)
      • “ All student love some subject.”
      •  x  y love(x, y)
      May 18, 2010
      • Two quantifiers are nested if one is within the scope of
      • the other, such as
      • ∀ x ∃y (x + y = 0)
      • Everything within the scope of a quantifier can be
      • thought of as a propositional function. Define the
      • propositional functions
      • Q(x) : ∃y P(x, y)
      • P(x, y) : x + y = 0
      • Then, we have
      • ∀ x ∃y (x + y = 0) ≡ ∀x ∃y P(x, y) ≡ ∀x Q(x) .
      May 18, 2010
      • Translation of nested quantifiers can be done by:
      • write out what the quantifiers and predicates in the expression means
      • convert this meaning into a simpler sentence without using any of the variables
      • Statements involving nested quantifiers can be negated by applying the rules for negating statements involving a single quantifier
      • Table : Negating Quantifiers
      May 18, 2010 Negation Equivalent Statement When Is Negation True? When False?  x P ( x )  x P ( x )  x  P ( x )  x  P ( x ) For every x , P ( x ) is false. There is an x for which P ( x ) is false. There is an x for which P ( x ) is true. P ( x ) is true for every x .
      • For example, to evaluate  x  y P(x, y) we loop through all the values of x , and for each x we loop through all the values of y.
      • Table : Quantifications of Two Variables
      May 18, 2010 Statement When True? When False?  x  y P(x, y)  y  x P(x, y) P(x, y) is true for every pair x, y. There is a pair x, y for which P(x, y) is false.  x  y P(x, y) For every x there is a y for which P(x, y) is true. There is an x such that P(x, y) is false for all y.  x  y P(x, y) There is an x for which P(x, y) is true for all y. For every x there is a y for which P(x, y) is false.  x  y P(x, y)  y  x P(x, y) There is a pair x, y for which P(x, y) is true. P(x, y) is false for every pair x, y.
      • Example: Translate the statement “The sum of two positive integers is always positive” into a logical expression.
      • Solution:
      May 18, 2010
      • K. Rosen, “ Discrete Mathematical Structures with Applications to Computer Science, WCB/ Mcgraw Hill ”, edition 6 2006
      • http://www.slideshare.net/../predicate-logic
      • www.cs.odu.edu/~toida/nerzic/conten ..
      • www.earlham.edu/../terms3.htm
      May 18, 2010
      • If you have any suggestion then let me know.
      May 18, 2010