Discrete Structures ยท Unit 1 ยท 7 hrs
Basic Discrete Structures
Exam-focused notes for Basic Discrete Structures (Discrete Structures, CSC165): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.
Basic Discrete Structures in short
This chapter builds the vocabulary that the rest of discrete structures is written in: sets and the operations on them, functions and how they classify mappings between sets, the fuzzy generalisation of a set, and sequences with the summation notation used to add up their terms.
What this unit covers
- Sets
- Sets and Subsets
- Power Set
- Cartesian Product
- Set Operations
- Venn Diagram
- Inclusion-Exclusion Principle
- Computer Representation of Sets
- Functions
- Basic Concept
- Injective and Bijective Functions
- Inverse and Composite Functions
- Graph of Functions
- Functions for Computer Science (Ceiling Function, Floor Function, Boolean Function, Exponential Function)
- Fuzzy Sets and Membership Functions
- Fuzzy Set Operations
- Sequences and Summations
- Basic Concept of Sequences
- Geometric and Arithmetic Progression
- Single and Double Summation
Injective and Bijective Functions
2081 ยท 10 marks
Determine whether the function f(x) = x-1 from set of integers to the set of integers is injective, surjective or bijective. Write the type of Fuzzy set operations with their definition. Give the floor and ceiling value of 1.2 and -1.2.[10]
2079 ยท 10 marks
How do you plot the function on graph? Determine whether the function $f(x) = x^2$ is injective, surjective or bijective with reasons. Solve the recurrence relation $a_n = 6a_{n-1} + 9a_{n-2}$ with initial conditions $a_0 = 1, a_1 = 6$. [10]
Inclusion-Exclusion Principle
2080 ยท 5 marks
Explain the principle of inclusion and exclusion. How many integers from 1 to 30 are multiples of 2 or 3? [5]
Show solved answerHide answer
Principle of Inclusion and Exclusion
Given Data
- Range of integers: 1 to 30
- Divisibility conditions: multiples of 2 or multiples of 3
Statement of the Principle
The Principle of Inclusion and Exclusion is a counting technique for finding the number of elements in the union of finite sets. When we add the sizes of individual sets, elements common to more than one set get counted multiple times. The principle corrects this overcounting by systematically including individual set sizes, excluding pairwise intersections, including triple intersections, and so on.
For Two Sets:
$$n(A \cup B) = n(A) + n(B) - n(A \cap B)$$
For Three Sets:
$$n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(A \cap C) - n(B \cap C) + n(A \cap B \cap C)$$
The alternating signs (add odd-order intersections, subtract even-order... precisely: single sets +, pairs -, triples +) ensure each element is counted exactly once.
Application: Multiples of 2 or 3 from 1 to 30
Step 1: Define sets
- $A$ = multiples of 2 in $[1,30]$
- $B$ = multiples of 3 in $[1,30]$
We need $n(A \cup B)$.
Step 2: Multiples of 2 $$n(A) = \left\lfloor \frac{30}{2} \right\rfloor = 15$$
Step 3: Multiples of 3 $$n(B) = \left\lfloor \frac{30}{3} \right\rfloor = 10$$
Step 4: Multiples of both 2 and 3 (i.e. multiples of $\text{lcm}(2,3)=6$) $$n(A \cap B) = \left\lfloor \frac{30}{6} \right\rfloor = 5$$
Step 5: Apply the principle $$n(A \cup B) = n(A) + n(B) - n(A \cap B) = 15 + 10 - 5 = 20$$
$$\boxed{n(A \cup B) = 20}$$
Verification list: $${2,3,4,6,8,9,10,12,14,15,16,18,20,21,22,24,26,27,28,30}$$ Counting these gives exactly 20 integers. โ
Conclusion
There are 20 integers between 1 and 30 that are multiples of 2 or 3.
2076 ยท 5 marks
Define ceiling and floor function. Why do we need Inclusion - Exclusion principle? Make it clear with suitable example. [5]
Show solved answerHide answer
Floor and Ceiling Functions, and Inclusion-Exclusion Principle
1. Floor Function
The floor function for any real number x is defined as the greatest integer less than or equal to x.
It is denoted by โxโ.
Examples:
- โ3.5โ = 3
- โ-2.4โ = -3 (since -3 is the greatest integer less than or equal to -2.4)
- โ3.143โ = 3
2. Ceiling Function
The ceiling function for any real number x is defined as the smallest integer greater than or equal to x.
It is denoted by โxโ.
Examples:
- โ3.5โ = 4
- โ-2.4โ = -2 (since -2 is the smallest integer greater than or equal to -2.4)
- โ3.143โ = 4
3. Inclusion-Exclusion Principle
Why Do We Need It?
When counting elements in the union of two or more sets, simply adding the sizes of individual sets overcounts the elements that appear in more than one set. The Inclusion-Exclusion Principle corrects this overcounting by systematically including and excluding overlapping regions.
Without this principle, we would either overcount (by counting shared elements multiple times) or undercount (by ignoring them). It gives us an exact count of elements in the union of finite sets.
Statement
For any two finite sets A and B:
$$n(A \cup B) = n(A) + n(B) - n(A \cap B)$$
For three finite sets A, B, and C:
$$n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(A \cap C) - n(B \cap C) + n(A \cap B \cap C)$$
Here we include individual set sizes, exclude pairwise intersections, and include the triple intersection back.
Suitable Example
Problem: In a town of 10,000 families:
- 40% buy newspaper A โ n(A) = 4000
- 20% buy newspaper B โ n(B) = 2000
- 10% buy newspaper C โ n(C) = 1000
- 5% buy A and B โ n(A โฉ B) = 500
- 3% buy B and C โ n(B โฉ C) = 300
- 4% buy A and C โ n(A โฉ C) = 400
- 2% buy all three โ n(A โฉ B โฉ C) = 200
Find: Number of families that buy at least one newspaper.
Solution using Inclusion-Exclusion:
$$n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(A \cap C) - n(B \cap C) + n(A \cap B \cap C)$$
$$= 4000 + 2000 + 1000 - 500 - 400 - 300 + 200$$
$$= 7000 - 1200 + 200 = \mathbf{6000}$$
Number of families buying none of the newspapers:
$$= 10000 - 6000 = \mathbf{4000}$$
Conclusion
The Inclusion-Exclusion Principle is essential in combinatorics and set theory to accurately count elements in unions of overlapping sets, avoiding both overcounting and undercounting of shared elements.
Functions for Computer Science
2080 ยท 5 marks
Give the example of ceiling, floor and boolean function. How do you plot the graph of the function? [5]
Venn Diagram
2078 ยท 5 marks
Represent any three set operations using Venn-diagram. Give a recursive defined function to find the factorial of any given positive integer. [5]
Computer Representation of Sets
2075 ยท 10 marks
Consider a set U = {1,2,3,4,5,6,7,8,9,10}. What will be the computer representation for set containing the numbers which are multiple of 3 not exceeding 6? Describe injective, surjective and bijective function with examples.[10]
Basic Concept
2080.1 ยท 5 marks
Define function. Let $f_1$ and $f_2$ be function from $\mathbb{R}$ to $\mathbb{R}$ such that $f_1(x) = x^2$ and $f_2(x) = x - x^2$. What are the functions $f_1 + f_2$ and $f_1 \cdot f_2$? [5]
Fuzzy Sets and Membership Functions
2080.1 ยท 5 marks
Explain fuzzy set with example. How do you find complement of a fuzzy set? [5]
Make Unit 1 stick
Practice CSC165 with flashcards & quizzes