Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Mathematics for data science 1

Natural Numbers: N={0,1,2,....}


Integers: Z={......-3,-2,-1,0,1,2,3……}

m x n=m+m+m+m+m+m….n times(multiplication is repeated addition)

m^k=m x m x m x m….k times(exponentiation is repeated multiplication)

a | b means b is a multiple of a.

Factor n pairs:-
Factors of 12 are
{1,12}, {2,6}, {3,4} (6 factors - even)

Factors of 36 are
{1,36},{2,18},{3,12},{4,9},{6} (9 factors- odd)

So we can conclude factors of perfect square are always odd and factors of non-perfect square
are even.

Prime numbers must have 2 factors only. Since 1 has only 1 factor that is itself therefore 1 is not
a prime. The smallest prime number is 2 {1,2}.

2-{1,2}
3-{1,3}
5-{1,5}

An efficient way to find out the primes are the sieve of Eratosthenes we have to basically
choose the first few prime numbers from a given set of numbers arranged in grid form and has
to cut it multiples as show below and ultimately the set will only have prime numbers.
Sieve of Eratosthenes

Prime factorisation:-
It says that we can basically breakdown every non-prime natural number into multiples of prime
numbers.
Eg 12-2.2.3
16-2.2.2.2
35-5.7
69-3.23

Prime number theorem says that the frequency of prime number below x is x/log(x) for large
values of x.
Rational numbers (comes from the word ratio):

Rational numbers - Q

Eg: ½, ¾ etc

In rational number we can write the same number is many ways


Eg 3/5 = 6/10 = 30/50 …..

This property can be used in addition.

We can find the greatest common divisor through prime factorization as shown below.

We have to find the common prime factors to both the numbers.


Its not the most efficient.

We can always have another rational number between two rational numbers by taking out their
average.
Eg rational number between m/n and p/q is (m/n+p/q)/2 so theres nothing as next or previous
rational numbers.
Note: integers are basically a special case of rational number where the denominator is always
1. Eg 6 an integer is 6/1.
Rational number does not cover the entire number line. Number line consists of rational and
irrational number. For ex 2^½ or square root of 2 cannot be written in rational form and hence is
an irrational number. Any number which is not a perfect square then its square root is an
irrational number. There are extra irrational numbers too like pie=3.1415… and e=2.7182...

Real Number
Real number covers the entire number line and consists of rational as well as irrational number.
Like rational number we can find a real number between any 2 real number with the same
method i.e. average of the 2 numbers. So there is nothing like next real number or previous real
number.

Complex number(out of course)


Square root of any negative numbers.

Set Theory:
A set is a collection of items.
Sets can have mixed members like rational and integers.
Sets are unordered.
Sets can be finite and infinite

Cardinality is the number of items in a set.


Cardinality of infinite sets can be measured through a special process.

Russell’s Paradox says that not every collection of items is a set for example collection of all
sets is not a set.

X is a subset of Y if every element of X is also an element of Y


Every set is a subset of itself. Eg X={a,b} then {a,b} is a subset of X.
X=Y if and only if X is a subset of Y and Y is a subset of X.

Sometimes, Proper subset is used to denote when X is not equal to Y


X is a proper subset of Y if every element of X is also an element of Y and Y has some extra
elements too.

Proper notations

An empty set has no elements. Empty set is subset of itself and the proper subset of every other
sets.(here denoted by @)
{@} is different from @. (denotion rules no concept)
The first denotes a set consisting of only one element in i.e. a set consisting of only empty set.
The second denotes the empty set alone that means set with no element.

Powerset- Set of all subsets of a set.

Eg. X={a,b}
Powerset of X={ @, {a}, {b}, {a,b}}

Eg. @
powerset of @= {@}

Set with n elements has 2^n subsets.

The above statement can be proved through binary numbers.

For example 3 bits has a 8 combinations of 0s and 1s. (2^3=8)


X={a,b,c}
000 is @
111 is {a,b,c}
001 is {c}
010 is {b}
011 is {b,c}
100 is {a}
101 is {a,c}
110 is {a,b}

How to write a set in set builder form:-


X={a^2 | a E N, a>5}
The first part before ‘|’ is the element we want, the second part before ‘,’ is the range of that
element and the last part defines the condition so that the element can be a part.
DIfferent type of sets:-
Identity relation: I={(a,b) | (a,b) E A x A,a=b) i.e it contains only the reflexive elements or the
doublets.

Reflexive relation: it must contain the reflexive elements of all the present elements or the
doublets of the present element but unlike identity relation it can contain more than just the
doublets.

Symmetric relation: it must contain the opposite pair of every original pair,
For eg
1) {(1,2),(1,5),(1,3),(2,1),(5,1),(3,1)}
2) ((1,2),(2,3),(3,2)}

1 is symmetric and 2 is not. It can contain other pairs too but the opposite pairs are must to be
symmetric.

Transitive relation: if a set has (a,b) and (b,c) then there must be a (a,c). There can be another
pairs but this condition is a must for tranisitivity.

Antisymmetric relations: no opposite pair of original pair must be present. Ie if (a,b) is there then
there must not be (b,a). There can be other pair but this condition is a must for assymmetricty.

Equivalence relation: Must be transitive, symmetric and reflexive. It partitions the set into small
disjoints and the union of all disjoint gives the original set.
How to form the cartesian products.

Use of RELATIONS IN SET IN REAL WORLD


Functions:

Relation of element in domain to relation in codamain such that every element in the domain
has only 1 relation with the codomain. The element in codomain which has relation with the
domain are called range.

Types of functions:-

Injective: different input produces different output ie one to one

Surjective: range is equal to the codomain. Ie onto

Bijective: if its injective and surjective.

Bijective is the only to compare the cardinality of two infinite sets. It can also be used to
compare the cardinality of two finite sets.
The green line is g(x) and the red line is f(x).

The above image compares f(x) and g(x). It also shows the real world application of comparing
functions.

You might also like