DS1 Prelim
DS1 Prelim
1
➢ Discrete data in math is quantitative data that can
Each language will have some aspect of number theory,
10
be counted, but not measured
➢ Discrete data is data that can be counted, but it algorithms, and data structures embedded in the context of
can not be divided. The number of people in a the language.
room is an example of discrete data.
➢ Continuous data is data that can be measured, and Databases will also apply set theory, number theory,
CS
it can be divided. The height of a person is an Boolean algebra, and other aspects in the context of
example of continuous data. databases.
● Discrete mathematics is the study of science and perform tasks such as sorting, searching, and
mathematical structures that are countable or optimization.
otherwise distinct and separable.
Examples of structures that are discrete are Discrete mathematics is used to study the complexity of
Pe
combinations, graphs, and logical statements. algorithms, which measures how long an algorithm takes
➢ Concerns itself mainly with finite collections of to run as a function of the input size. This is important
discrete objects. because algorithms with good complexity are more
➢ With the growth of digital devices, especially efficient and can run faster on larger inputs.
computers, discrete mathematics has become
a
more and more important. Discrete mathematics is also used in the design and
➢ Discrete structures can be counted, arranged, analysis of data structures, which are ways of organizing
ni
placed into sets, and put into ratios with one and storing data in a computer.
another. Although discrete mathematics is a wide
and varied field, there are certain rules that carry Data structures are used to store and manipulate data in a
Ze
over into many topics. way that is efficient and effective, and they are an
important aspect of computer science.
The concept of independent events and the rules
of product, sum, and PIE are shared among Discrete mathematics is used to design and analyze data
combinatorics, set theory, and probability. structures and to study the complexity of algorithms that
➢ The Principle of Inclusion and Exclusion manipulate data structures.
(PIE) is a counting technique that
computes the number of elements that Discrete Mathematics plays a significant role in big data
satisfy at least one of several properties analytics.
while guaranteeing that elements
satisfying more than one property are not Some examples that use concepts such as Graph theory are
counted twice. Google Maps.
Encryption and decryption in cryptography that are used
for masking data as part of cybersecurity are derived from SETS
number theory
➢ Mathematical logic is a science that studies A⊂B The set A is a proper subset of the set B
mathematical proofs.
U The universal set
Subjects of mathematical logic are mathematical proofs,
methods and means for their construction ∅ The empty set
The simplest division of mathematical logic is A∪B The union of the sets A and B
1
propositional logic.
A∩B The intersection of the sets A and B
10
Proposition is a statement that has a value of truth; i.e., it
can be true or false. The respective values of truth will be A\B The complement of the set B with respect to
denoted by T or F. the set A, or the difference of the sets A and B
CS
propositions using logical operations and brackets. ➢ A set is a well defined collection of distinct objects.
➢ The objects in a set are called the elements or
➢ The most common logical operations are: members of the set.
○ and (conjunction or logical multiplication), ➢ Capital letters A,B,C,… usually denote sets.
○ or (disjunction or logical addition), ➢ Lowercase letters a,b,c ,… denote the elements of
○ if …then (logical consequence or a set.
implication, this operation is also
denoted as “ “⇒”), not (negation). -
Examples:
The collection of the vowels in the word
“probability”.
da
Conjunction, disjunction, and implication are assigned to
The collection of real numbers that satisfy the
binary operations, since they use two operands; negation is 2
assigned to unary operation, since it requires one operand equation 𝑥 − 9 = 10
The collection of two digit positive integers
Two compound propositions are called logically divisible by 5.
ru
equivalent, if they take the same values of truth for any set The collection of great football players in the
of values of the component parts. National Football League.
➢ A compound proposition that takes true values for The collection of intelligent members of the
any of its components is referred to as tautology United States Congress.
Pe
For justification of the logical equivalence, a truth table is - A finite set is one which can be counted.
used, which enumerates the true values of logical Example: The set of two digit positive integers has
ni
2
● Set Builder Notation ● The Membership Relation
- Defined as a representation or a notation that can - Let A be a set and let x be some object.
be used to describe a set that is defined by a Notation:
logical formula that simplifies to be true for every Meaning: x is a member of A, or x is an element of A, or x
element of the set. belongs to A.
- It includes one or more than one variable. - Negated by writing
- It also defines a rule about the elements which Example:
belong to the set.
● Equality of Sets
There are two methods that can be used to represent a set: - Two sets A and B are equal, denoted A = B,
a. Roster form and if they have the same elements.
b. Set builder form. - Otherwise, A ≠ B
- The roster form or listing the individual elements Example: The set A of odd positive integers is not equal to
of the sets, and the set builder form of the set B of prime numbers.
1
representing the elements with a statement or an
equation or an inequality. Example: The set of odd integers between 4 and 8 is equal
10
to the set of prime numbers between 4 and 8.
Roster Form (Listing the Elements) ● Subsets
- In this method, we list down all the elements of a - A is a subset of B if every element of A is an
set, and they are represented inside curly element of B.
brackets. Each of the elements is written only Notation: A ⊆ B
CS
once and is separated by commas. ● Unions
- The union of two sets A and B is
For example, the set of letters in the word, "California" is A ∪ B = {x | x ∈ A or x ∈ B}
written as A = {c, a, l, i , f, o, r, n} - The word “or” is inclusive
● Intersections
Set Builder Form (Defining a Rule For the Elements) - The intersection of A and B is
- Set builder form uses a statement or a math
equation to represent all the elements of a set. In
this method, we do not list the elements; instead,
- A ∩ B = {x | x ∈ A and x ∈ B}
Example: Let A be set of even positive integers and B the
set of prime positive integers. Then
da
we will write the representative element using a A ∩ B ={2}
variable followed by a vertical line or colon and Definition: A and B are disjoint if
write the general property of the same A∩B=∅
representative element. For example, the same set ● Complement
above (that denotes the set of letters in the word, - If A is a subset of the universal set U, then the
ru
𝐴 ∩ 𝐴 = ∅ , 𝐴 ∪𝐴 = 𝑈
"set A is the set of all ‘x’ such that ‘x’ is a letter of the word
● Venn Diagrams
California”
Example 1:
Set A is represented as a disk
A = { x | x ∈ ℕ , 5 < x < 10 } and is read as "set A is the set of
inside a rectangular region
all ‘x’ such that ‘x’ is a natural number between 5 and 10." The
a
representing U.
symbol ∈ ("belongs to") means “is an element of” and
denotes membership of an element in a set.
ni
Example 2:
B = { x | x is a two digit odd number from 11 to 20 } which
means set B contains all the odd numbers from 11 to 20. By
using the roster method, set B can be written as B = {11, 13,
Ze