1 / 10

Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007

Understand the concepts of recursively defined sets in Mathematics and Computer Science, including changes in the recursive step and the definition of different sets over alphabets. Explore data structures and counting techniques using product rule, sum rule, and inclusion-exclusion principle.

rconnolly
Download Presentation

Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Math/CSE 1019N:Discrete Mathematics for Computer ScienceWinter 2007 Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/1019

  2. Recursively defined sets • Basis step: 2  S • Recursive step: If x  S and y  S then x+ y  S Defines the set {2k|k=1,2,3,…} What happens if we change the recursive step to: If x  S and y  S then x+y  S, x-y  S ?

  3. Recursively defined sets - 2 All possible strings (*) over alphabet  • Basis step:  * • Recursive step: If x  and w * then wx * Length of a string l() = 0 l(wx) = l(w) + 1 if x  and w *

  4. Recursively defined sets - 3 What is this set A definedover  = {0,1}? • Basis step:  A • Recursive step: If x A then 0x1 A What is this set B definedover  = {0,1}? • Basis step:  B • Recursive step: If x B then 0x1 B and 1x0 B

  5. Recursively defined sets - 4 Data structures – full binary trees • Basis step: single vertex • Recursive step: If S, T are full binary trees then the following is a full binary tree r T S

  6. Next: counting • Basic tool in Computer Science, Discrete Mathematics, Probability

  7. Product rule • Two tasks, n1 ways of doing first, and for each of those n1 ways, n2 ways of doing the second. • Generalizes to n tasks E.g.: • 2 dice rolls • # of binary strings of length k • Cardinality of the power set of a finite set • #of postal address codes

  8. Sum rule • If a task can be done in one of n1 ways or one of n2 ways and the sets of n1 and n2 ways are disjoint, then it can be done in n1 + n2 ways. E.g.: • Choosing an elective • Number of offices in CSEB • Number of CS majors at York • Number of binary strings of length 4 containing exactly one 1.

  9. More complex counting • Maximum possible number of (land) phone numbers in Toronto. • Number of binary strings starting with 1 and having at most 4 digits. • Number of positive integers with 4 digits and exactly one 1 (allow leading zeroes). • Number of alphanumeric strings with at least one digit.

  10. Inclusion- exclusion principle • Two dice – first toss is a 1 or last toss is a 6 A = 1* B = *6 A B |A  B| = |A| + |B| - |A  B|

More Related