DiscreteBank

Discrete

Sets

EQUIVALENT SETS

OVERLAPPING SETS

Two sets A and B are said to be overlapping if they contain at least one element in common.

DISJOINT SETS

Two sets A and B are said to be disjoint, if theydo not have any element in common.

EQUAL SETS

PROPER SUBSET

POWER SET

The collection of all subsets of set A is called the power set of A. It is denoted by P(A). In P(A), every element is a set.

Formula for power set

n[P(A)] = 2^m
where m is the number of elements in set A.

OPERATIONS ON SETS

Difference : The difference of two sets A and B is a set of all those elements which belong to A but do not belong to B and is denoted by A - B or A/B

SYMMETRIC DIFFERENCE : The symmetric difference of two sets A and B is the set containing all the elements that are in A or in B but not in both and is denoted by AΘB.

i.e., A ⊕ B = (A ∪ B)\(A ∩ B) or
A ⊕ B = (A\B) ∪ (B\A)
Eg. A={1,2,3,4,5} B={4,5,6,7,8}
(A u B)= { 1,2,3,4,5,6,7,8}
(A n B)= {4,5}
A ⊕ B = (A u B) - (A n B) = { 1,2,3,6,7,8}

Laws of set theory

laws

INCLUSION–EXCLUSION PRINCIPLE

Suppose A and B are finite sets and they are not disjoint. Then

n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

Also suppose A, B, C are finite sets. Then A ∪ B ∪ C is finite and

n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) −n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)

Relations

Properties of relations

Types of relations

Composition of relations

Closure properties of relations

Equivalence relations

A relation R on S is an equivalence relation if R is reflexive, symmetric, and transitive.

Compatibility relations

Partial order relations

A relation R on a set S is called a partial ordering or a partial order of S if R is reflexive, antisymmetric, and transitive.

Function

Let A and B be two finite sets having m and n elements respectively. Then total number of functions from A to B is n ^m.

image is Range
pre-image is domain

Types of functions

For ONE-ONE we folow Horizontal Line Test.
For ONTO we folow Vertical Line Test.

Composition of functions

Consider functions f: A → B and g: B → C; that is, where the codomain of f is the domain of g. Then we may define a new function from A to C, called the composition of f and g and written g◦f, as follows:

(g◦f)(a) ≡ g(f(a))

here we use the functional notation g◦f for the composition of f and g instead of the notation f◦g which was used for relations.

Invertible function

Hashing functions

What is meant by Good Hash Function?

A good hash function should have the following properties:

  1. Efficiently computable. (Easy and quick to complete).
  2. Should uniformly distribute the keys (Each table position equally likely for each key.

3 Methods of Hashing

  1. Division (MOD) Method
  2. Mid-square Method
  3. Universal or Folding Method

Division (MOD) Method MOD

Mid Square
In this method firstly key is squared and then mid part of the result is taken as the index. For example: consider that if we want to place a record of 3101 and the size of table is 1000. So 3101*3101=9616201
i.e. h (3101) = 162 (middle 3 digit)

Folding Method

Recursively defined functions

PREPOSITIONAL AND PREDICATE LOGIC

Propositional logic

Applications are

1) Translating English Sentences into logical statements 2) System Specifications 3) Logical Puzzles 4) Boolean Searches 5) Logic/Computer Circuits 6) Inference and Decision Making 7) Artificial Intelligence – Fuzzy Logic

Operator Precedence OP

TAUTOLOGIES : Some propositions P(p, q, . . .) contain only T (True) in the last column of their truth tables or, in other words, they are true for any truth values of their variables

CONTRADICTIONS : if propositions P(p q, . . .) contains only F in the last column of its truth table or, in other words, if it is false for any truth values of its variables.

Important

“If you do your homework, you will not be
punished.”

Here, "you do your homework" is the hypothesis,p, and "you will not be punished" is the conclusion, q.

Inverse − An inverse of the conditional statement is the negation of both the hypothesis and the conclusion.

Example − The inverse of “If you do your
homework, you will not be punished” is
“If you do not do your homework, you will be
punished.”

Converse − The converse of the conditional statement is computed by interchanging the hypothesis and the conclusion.

Example − The converse of "If you do your
homework, you will not be punished" is
"If you will not be punished, you do your
homework”.

Contra-positive − The contra-positive of the conditional is computed by interchanging the hypothesis and the conclusion of the inverse statement.

Example − The Contra-positive of " If you do
your homework, you will not be punished” is
"If you are punished, you did not do your
homework”.
NOTES
The proposition ¬ q → ¬ p is called the
Contrapositive of the proposition p → q.

They are logically equivalent. p → q ≡ ¬ q → ¬ p

Trute table for implication and double implication

tti ttdi

Logical Eqivalence

Normal forms (conjunctive and disjunctive)

Validity of well-formed formula

Algebra of Propositions

aop

Predicate logic

Universal and existential quantifiers

Combinatorial Mathematics

Basic counting principles

Permutations and combinations

Pigeonhole principle

Recurrence relations

Solving homogeneous and non-homogeneous recurrence relations

Generating function