CSC165 Discrete Structure

Discrete StructureUnit 312 min read

Set Theory & Fuzzy Sets: Definitions, Operations, and Applications

Unit 3 of Discrete Structure covers fundamental concepts of set theory (operations, relations, power sets) and fuzzy sets (membership functions, operations, and real-world applications), with emphasis on problem-solving techniques and proofs.

TAKEAWAYS:

  • Understand set operations (union, intersection, complement, Cartesian product) and their Venn diagram representations for visualizing relationships.
  • Master subset, power set, and universal set definitions, including proper subsets and cardinality calculations.
  • Learn fuzzy set theory (Lozzi’s membership functions, operations like union/intersection with min/max, and complement rules).
  • Apply set theory to solve real-world problems (e.g., database queries, network routing, and algorithm correctness).
  • Recognize equivalence relations and partitions derived from sets, crucial for graph theory and number theory.
  • Prepare for exam questions on proofs, recursive definitions, and problem-solving using set theory concepts.

1. Introduction to Set Theory

1.1 Basic Definitions

A set is a well-defined collection of distinct objects, called elements or members.

  • Notation: or (read as "x belongs to A").
  • Empty set: or (contains no elements).
  • Singleton set: (contains one element).
  • Finite vs. Infinite Sets:
    • Finite: (countable elements).
    • Infinite: (uncountable elements).

1.2 Subsets and Power Sets

  • Subset (): Every element of is in .
    • if .
    • Proper subset (): if but .
  • Power Set (): The set of all subsets of .
    • If , then .
    • Example:
      • .

1.3 Universal Set and Complement

  • Universal Set (): Contains all elements under consideration.
  • Complement ( or ): Elements in but not in .
    • .

2. Set Operations

2.1 Union ()

  • Combines all elements from and .
  • .
  • Example:
    • ,
    • .

2.2 Intersection ()

  • Contains only elements common to both and .
  • .
  • Example:
    • ,
    • .

2.3 Difference ()

  • Elements in but not in .
  • .
  • Example:
    • ,
    • .

2.4 Symmetric Difference ()

  • Elements in either or but not in both.
  • .
  • Example:
    • ,
    • .

2.5 Cartesian Product ()

  • Ordered pairs where the first element is from and the second from .
  • .
  • Example:
    • ,
    • .

3. Venn Diagrams and Set Identities

3.1 Venn Diagram Representation

Venn diagrams visually represent set operations:

       __________
      /           \
     /             \
____/               \____
|       A           |
|       \           /
|        \         /
|________ \_______/
      \     /
       \   /
        \ /
         B
  • Union (): Entire area covered by both circles.
  • Intersection (): Overlapping area.
  • Complement (): Area outside circle .

3.2 Important Set Identities

Identity Description
Idempotent law
Idempotent law
Identity law
Identity law
Complement law
Complement law
De Morgan’s law
De Morgan’s law
Difference as intersection with complement

4. Applications of Set Theory

4.1 Database Queries

  • SQL WHERE clauses use set operations:
    SELECT * FROM Students WHERE age > 20 AND grade = 'A';
    
    • This retrieves students in .

4.2 Network Routing

  • Subnet masking uses set operations to determine IP addresses in a subnet.

4.3 Algorithm Correctness

  • Recursive algorithms (e.g., factorial) rely on set theory for termination proofs.
    • Example: Prove is correct for all using mathematical induction.

5. Fuzzy Set Theory

5.1 Introduction to Fuzzy Sets

  • Crisp Sets: Elements are either fully in () or fully out ().
  • Fuzzy Sets: Elements have degrees of membership ().
    • Defined by a membership function .

5.2 Membership Function

  • Example: Let and define a fuzzy set .
    • , , , , .
    • Represented as .

5.3 Fuzzy Set Operations

Operation Definition Example
Union ()
Intersection ()
Complement ()

5.4 Applications of Fuzzy Sets

  • Medical Diagnosis: "High fever" can be a fuzzy set with degrees of membership.
  • Control Systems: Fuzzy logic in washing machines (e.g., "dirty" vs. "clean").
  • Decision Making: Ranking candidates based on fuzzy criteria (e.g., "qualified").

6. Problem-Solving with Set Theory

6.1 Example 1: Computer Representation of Sets

Question: Given , represent the set of numbers multiple of 3 not exceeding 6. Solution:

  • Multiples of 3 in : .
  • Numbers not exceeding 6: .
  • Computer representation (using bitmask for ):
    • has 10 elements → 10-bit string.
    • corresponds to bits at positions 3 and 6 (1-based index):
      0100100000 (binary) = 136 (decimal)
      
    • Answer: The set is represented as 136 in binary.

6.2 Example 2: Proving Correctness of Recursive Algorithms

Question: Prove the correctness of the recursive factorial function using induction. Solution:

  • Base Case ():
    • (by definition).
    • Recursive call: . ✔️
  • Inductive Step:
    • Assume holds for some .
    • Show :
      fact(k+1) = (k+1) * fact(k) [by definition]
                = (k+1) * k! [by inductive hypothesis]
                = (k+1)! ✔️
      
  • Conclusion: By induction, for all .

6.3 Example 3: Symmetric Closure

Question: Find the symmetric closure of on . Solution:

  • Symmetric closure adds the reverse of every pair in .
  • Original has but not . Add .
  • Similarly, add (since exists).
  • Final symmetric closure: .

7. Common Mistakes and Clarifications

  1. Confusing and :
    • allows .
    • requires .
  2. Fuzzy Set Operations:
    • Union uses max, not OR.
    • Intersection uses min, not AND.
  3. Cartesian Product Order:
    • unless .
  4. Empty Set in Operations:
    • .
    • .

8. Exam Tips

8.1 What to Expect in Exams

  • Short Questions (2-5 marks):
    • Define subset, power set, fuzzy set, symmetric closure.
    • Draw Venn diagrams for given operations.
    • Compute Cartesian products or set differences.
  • Long Questions (10-15 marks):
    • Prove a recursive algorithm using induction (e.g., factorial, Fibonacci).
    • Find closures (reflexive, symmetric, transitive).
    • Solve real-world problems (e.g., database queries, network routing).
    • Compare crisp vs. fuzzy sets with examples.
  • Problem-Solving (15-20 marks):
    • Set theory in combinatorics (e.g., counting subsets).
    • Fuzzy set applications (e.g., membership functions in decision-making).

8.2 Key Formulas to Remember

Concept Formula
Power set cardinality
Union cardinality
Fuzzy union
Fuzzy intersection
Fuzzy complement

8.3 Common Exam Pitfalls

  • Forgetting to include all elements in union/intersection.
  • Misapplying De Morgan’s laws (e.g., confusing and ).
  • Incorrectly computing symmetric/transitive closures.
  • Not verifying base cases in induction proofs.
  • Assuming fuzzy sets are binary (remember ).
  1. Solve past exam questions (focus on proofs, closures, and fuzzy operations).
  2. Draw Venn diagrams for all operations to visualize relationships.
  3. Practice recursive proofs (factorial, Fibonacci, sum of first integers).
  4. Apply set theory to real-world scenarios (e.g., database queries, network routing).
  5. Memorize key identities (De Morgan’s, distributive laws).

9. Summary Table: Crisp vs. Fuzzy Sets

Feature Crisp Set Fuzzy Set
Membership Binary ( or ) Continuous ()
Union
Intersection
Complement
Example Application Database records (yes/no) Medical diagnosis (degree of fever)
Advantage Simple, exact Handles uncertainty, real-world ambiguity

10. Final Notes

  • Set theory is foundational for computer science (databases, algorithms, logic).
  • Fuzzy sets extend classical sets to model uncertainty, widely used in AI and control systems.
  • Always verify your answers with examples (e.g., small finite sets).
  • For exams, prioritize proofs, definitions, and problem-solving over rote memorization.

End of Notes

Based on the TU BSc CSIT syllabus for Discrete Structure (CSC165), unit 3.

Discussion

Loading…