# 1 Discrete Structures Lecture 25 Quantification IV.

## Presentation on theme: "1 Discrete Structures Lecture 25 Quantification IV."— Presentation transcript:

1 Discrete Structures Lecture 25 Quantification IV

2 Recall: (8.14) Axiom, One Point Rule (  x | x=E : P) = P[x:=E] Provided ¬occurs('x','E') (8.16) Axiom, Range Split (no overlap) (  x | R V S:P) = (  x | R:P)  (  x | S:P) provided R  S  false (8.17) Axiom, Range Split (with overlap) (  x | R V S:P)  (  x | R  S:P) =(  x | R:P)  (  x | S:P)

3 Axioms re: dummies (8.19) Axiom, Interchange of dummies (  x | R:(  y | Q:P)) = (  y | Q:(  x | R:P) --provided ¬occurs('y','R') and ¬occurs('x','Q') Nested quantifications with the same operator can be interchanged.

4 Axioms re: dummies (8.20) Axiom, Nesting (  x,y | R  Q:P)) = (  x | R:(  y | Q:P) --provided ¬occurs('y','R') Single quantification over a list of dummies can be viewed as a nested quantification.

5 Axioms re: dummies (8.21) Axiom, Dummy Renaming (  x | R:P) = (  y | R[x:=y]:P[x:=y]) --provided ¬occurs('y','R,P') Can replaced dummies with a "fresh" variable as long as it's done consistently.

6 Splitting Ranges (8.23) Theorem Split off Term (  i | 0 ≤ i < n+1:P) = (  i | 0 ≤ i < n:P)  P[i:=n] (  i | 0 ≤ i < n+1:P) = P[i:=0]  (  i | 0 < i < n+1:P) NN For n: N and dummies i: N

7 (8.5) Prove the following theorems. Provided 0 ≤ n (b) (  i | 0 ≤ i ≤ n: b[i]) = (  i | 0 ≤ i < n: b[i]) + b[n] (  i | 0 ≤ i ≤ n: b[i]) = (  i | 0 ≤ i < n: b[i]) + b[n]

8 Prove 8.5(b) without (8.23), part one (b) (  i | 0 ≤ i ≤ n: b[i]) = (  i | 0 ≤ i < n: b[i]) + b[n] 0 ≤ i ≤ n = 0 ≤ i  i ≤ n = 0 ≤ i  (i < n V i=n) = (0 ≤ i  i<n) V (0 ≤ i  i=n) = (0 ≤ i < n) V (0 ≤ i  i=n) = (0 ≤ i<n) V (0 ≤ n  i=n) = (0 ≤ i < n) V i=n

9 Now we can prove the theorem (b) (  i | 0 ≤ i ≤ n: b[i]) = (  i | 0 ≤ i < n: b[i]) + b[n] (  i | 0 ≤ i ≤ n: b[i]) = (  i | 0 ≤ i < n V i=n: b[i]) = (  i | 0 ≤ i < n: b[i]) + (  i | i=n: b[i]) = (  i | 0 ≤ i < n: b[i]) + b[n]

10 Splitting ranges (8.24) (8.24): b ≤ c ≤ d  (b ≤ i < d  b ≤ i < c V c ≤ i < d) Example: Suppose 0 ≤ n ( V i | 0 ≤ i < n+1: b[i]=0) = <(8.24) b,c,d:=0,n,n+1 0 ≤ n ≤ n+1  (0 ≤ i ( V i | 0 ≤ i < n V n ≤ i < n+1: b[i]=0) Now we can split the range.

11 8.6(a) without using 8.23 ( V i | 0 ≤ i < n+1: b[i]=0)  ( V i | 0 ≤ i < n: b[i]=0) V b[n]=0 ( V i | 0 ≤ i < n+1: b[i]=0) = ( V i | 0 ≤ i < n V n ≤ i < n+1: b[i]=0) = ( V i | 0 ≤ i < n: b[i]=0) V ( V i | n ≤ i < n+1: b[i]=0) = ( V i | 0 ≤ i < n: b[i]=0) V b[n]=0

12 8.6(c) without using 8.23, part one ( V i | 0 ≤ i < n+1: b[i]=0)  b[0]=0 V ( V i | 0 < i < n+1: b[i]=0) 0 ≤ i < n+1 = 0 ≤ i  i < n+1 = (0=i V 0<i)  i < n+1 = (0 = i  i<n+1) V (0 < i  i<n+1) = (0 = i  i<n+1) V (0 < i<n+1) = (0 = i  0<n+1) V (0 < i<n+1) 0 = i V (0 < i<n+1)

13 8.6(c) without using 8.23 ( V i | 0 ≤ i < n+1: b[i]=0)  b[0]=0 V ( V i | 0 < i < n+1: b[i]=0) ( V i | 0 ≤ i < n+1: b[i]=0) = ( V i | 0 = i V 0 < i < n+1: b[i]=0) = ( V i |0 = i: b[i]=0) V ( V i | 0 < i < n+1: b[i]=0) = b[0]=0 V ( V i |0 < i < n+1: b[i]=0)

14 A Note about ranges For example: 2, …, 15 (a) 2 ≤ i ≤ 15 (b) 2 ≤ i < 16 (c) 1 < i ≤ 15 (d) 1 < i < 16 Number of elements in range is equal to upperBound - lowerBound in (b) & (c). Xerox Parc study, said fewest errors with (b).

Similar presentations