Basic Math for Computer Science Students
1. Sets and Logic
A set is a collection of distinct objects. Example: A = {1, 2, 3}.
Basic operations: Union (A U B), Intersection (A n B), Difference (A - B).
Logic: Propositions are statements that are either True or False.
Examples: 'P: It is raining', 'Q: I have an umbrella'.
Truth table for AND (P and Q), OR (P or Q), NOT (not P).
2. Functions and Relations
A function f from set A to B maps every element of A to one in B.
Notation: f: A -> B. Example: f(x) = x + 2.
A relation is a set of ordered pairs. Example: R = {(1,2), (2,3)}.
Properties: reflexive, symmetric, transitive.
3. Combinatorics
Combinatorics is the study of counting.
n! (n factorial) = n x (n-1) x ... x 1
Permutations: P(n, r) = n! / (n-r)!
Combinations: C(n, r) = n! / [r!(n-r)!]
4. Basic Probability
Probability is the measure of how likely an event is to occur.
P(E) = Number of favorable outcomes / Total outcomes
Example: Tossing a coin, P(Head) = 1/2
Rules: P(A or B) = P(A) + P(B) - P(A and B)
5. Graph Theory
Graphs have vertices (nodes) and edges (connections).
Types: Directed, Undirected, Weighted, Unweighted.
Common concepts: Degree, Path, Cycle, Connected components.
Applications: Networking, Social networks, Maps.