MATHEMATICS FOR DATA SCIENCE 1 - Sets and Functions
Here is a simplified and emoji-enhanced summary of the key study material from the PDF “MATHEMATICS FOR DATA SCIENCE 1: Sets and Functions” along with practice questions and detailed solutions to help you learn effectively. ๐โจ
1. Set Theory & Numbers ๐ข
Natural Numbers & Integers
- Natural numbers (N): {0, 1, 2, 3, …} โ counting numbers including zero.
- Integers (Z): {…, -3, -2, -1, 0, 1, 2, 3, …} โ whole numbers including negatives.
Arithmetic Operations โโโ๏ธโ
- Addition (+), Subtraction (-), Multiplication (ร), Division (รท), Modulo (mod).
- Example: 10 mod 3 = 1 (remainder when 10 is divided by 3).
Rational Numbers (Q) & Greatest Common Divisor (gcd)
- Rational numbers: numbers expressed as p/q, where p,q โ integers.
- gcd is the largest positive integer dividing two numbers.
- Example: gcd(9,12) = 3.
Real & Irrational Numbers
- Real numbers include rationals and irrationals (cannot be expressed as p/q).
- Examples of irrationals: โ2, ฯ.
Sets & Subsets
- A set is a collection of distinct elements.
- Subset (X โ Y): every element of X is in Y.
- Proper subset (X โ Y): X is a subset but not equal to Y.
Relations & Functions
- Relation: subset of Cartesian product X ร Y.
- Function: each element in X maps to exactly one element in Y.
- Types of functions:
- Injective (one-to-one)
- Surjective (onto)
- Bijective (both)
1. Set Theory & Numbers ๐ง
Q1. Which of the following sets is a subset of Z (integers)?
A) {2, 4, 6}
B) {1/2, 3/2, 5/2}
C) {ฯ, โ2, 2}
D) {โ3, 0, 7}
Solution: A subset must have all its elements in the parent set. Z is the set of all integers.
- A: All elements are integers. โ
- B: Contains fractions, not all integers. โ
- C: Contains irrationals, not all integers. โ
- D: All elements are integers. โ
Answer: Both A and D are subsets of Z.
Key Concepts
- Natural Numbers (N): {0, 1, 2, 3, …} ๐ง
- Integers (Z): {…, -3, -2, -1, 0, 1, 2, …} ๐ข
- Arithmetic Operations: +, โ, ร, รท, mod โโโ๏ธโ
- Factors: a is a factor of b if b mod a = 0
- Rational Numbers (Q): Numbers of the form p/q, p, q โ Z, q โ 0 ๐งฎ
- Greatest Common Divisor (gcd): Largest integer dividing two numbers
- Irrational Numbers: Cannot be written as p/q (e.g., โ2, ฯ) ๐
- Real Numbers (R): All rationals + irrationals ๐
- Sets: Collection of well-defined items (e.g., {1, 2, 3}) ๐๏ธ
- Subsets: X โ Y if every element of X is in Y
- Set Comprehension: Building subsets using rules
- Relations: Subsets of Cartesian products (ordered pairs) ๐
- Properties of Relations: Reflexive, symmetric, transitive, equivalence
- Functions: Special relations where each input has one output
- Injective (one-to-one), Surjective (onto), Bijective (both)
2. Straight Lines ๐
Cartesian Coordinates & Distance
- Distance between points (x1,y1) and (x2,y2):
- Section formula for dividing a segment in ratio m:n:
Slope of a Line
- Slope $m = \frac{y_2 - y_1}{x_2 - x_1}$.
- Parallel lines: equal slopes.
- Perpendicular lines: product of slopes = -1.
Equation Forms
- Slope-intercept: $y = mx + c$.
- Point-slope: $y - y_1 = m(x - x_1)$.
- Two-point form: $y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1)$.
Distance from Point to Line
$$ d = \frac{|ax_1 + by_1 + c|}{\sqrt{a^2 + b^2}} $$2. Straight Lines ๐ง
Key Concepts
- Cartesian Coordinates: Points as (x, y) ๐
- Distance Formula: $ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $ ๐
- Section Formula: Dividing a line segment in ratio m:n
- Area of Triangle: $ \Delta = \frac{1}{2} |x_1(y_2-y_3) + x_2(y_3-y_1) + x_3(y_1-y_2)| $ ๐บ
- Slope (m): $ m = \frac{y_2 - y_1}{x_2 - x_1} $
- Equation Forms:
- Slope-intercept: $ y = mx + c $
- Point-slope: $ y - y_1 = m(x - x_1) $
- Two-point: $ y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}(x - x_1) $
- Parallel/Perpendicular:
- Parallel: Equal slopes
- Perpendicular: Product of slopes = โ1
- Distance from Point to Line: $ d = \frac{|ax_1 + by_1 + c|}{\sqrt{a^2 + b^2}} $
- Sum Squared Error (SSE): $ SSE = \sum (y_i - (mx_i + c))^2 $
3. Quadratic Functions & Equations ๐
- Quadratic function: $f(x) = ax^2 + bx + c$, $a \neq 0$.
- Vertex: $\left(-\frac{b}{2a}, f\left(-\frac{b}{2a}\right)\right)$.
- Axis of symmetry: $x = -\frac{b}{2a}$.
- Parabolas open up if $a > 0$, down if $a < 0$.
Solving Quadratic Equations
- By factoring
- By completing the square
- By quadratic formula:
Practice Questions ๐ง
Key Concepts
- Quadratic Function: $ f(x) = ax^2 + bx + c $, $ a \neq 0 $ ๐
- Parabola: Graph of quadratic function
- Axis of Symmetry: $ x = -\frac{b}{2a} $
- Vertex: $ \left(-\frac{b}{2a}, f(-\frac{b}{2a})\right) $ ๐
- Roots/Solutions: Where $ f(x) = 0 $
- Solving Methods: Factoring, completing the square, quadratic formula: $ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $
4. Polynomial Functions โ๏ธ
- Polynomial: sum of terms $a_n x^n + \cdots + a_0$.
- Degree: highest exponent.
- Types: monomial, binomial, trinomial.
- Operations: addition, subtraction, multiplication, division (long division).
Practice Questions ๐ง
Q8. Divide $ x^3 - 2x^2 + 4x - 8 $ by $ x - 2 $. โ
Solution: Use synthetic division or the remainder theorem:
- Substitute $ x = 2 $: $ (2)^3 - 2(2)^2 + 4(2) - 8 = 8 - 8 + 8 - 8 = 0 $ So, $ x - 2 $ is a factor. Divide:
Answer: Quotient is $ x^2 + 4 $, remainder is 0.
Key Concepts
- Polynomial: Expression with terms $ a_nx^n + … + a_0 $ โ๏ธ
- Degree: Highest exponent
- Types: Monomial (1 term), binomial (2), trinomial (3)
- Operations: Addition, subtraction, multiplication, division
- Zeroes: Values where $ f(x) = 0 $
5. Exponential Functions & Composition ๐ฅ
- Exponential function: $f(x) = a^x$, $a > 0, a \neq 1$.
- Vertical Line Test: checks if a relation is a function.
- Horizontal Line Test: checks if a function is one-to-one.
- Composition: $(f \circ g)(x) = f(g(x))$.
Q12. Solve $ \log_5(x - 1) + \log_5(x + 1) = 1 $. ๐
Solution: Use the product rule: $ \log_5((x - 1)(x + 1)) = 1 \implies \log_5(x^2 - 1) = 1 \implies x^2 - 1 = 5^1 = 5 \implies x^2 = 6 \implies x = \pm \sqrt{6} $ But for log to be defined, $ x > 1 $. So, $ x = \sqrt{6} $ (approx 2.45)
Answer: $ x = \sqrt{6} $
Key Concepts
- Exponential Function: $ f(x) = a^x $, $ a > 0, a \neq 1 $ ๐
- Laws of Exponents:
- $ a^m \times a^n = a^{m+n} $
- $ (a^m)^n = a^{mn} $
- Graph: Always positive, increasing if $ a > 1 $, decreasing if $ 0 < a < 1 $
- Composition: $ (f \circ g)(x) = f(g(x)) $
- Inverse Function: Exists if function is one-to-one
6. Logarithmic Functions ๐
- Logarithm is inverse of exponential: $y = \log_a x \iff x = a^y$.
- Domain: $x > 0$, Range: all real numbers.
- Properties:
- $\log_a (MN) = \log_a M + \log_a N$
- $\log_a \frac{M}{N} = \log_a M - \log_a N$
- $\log_a M^r = r \log_a M$
Practice Questions ๐ง
7. Challenge Problem ๐
Q15. Solve: $ \log_2(x^2 - 4) = 3 $. ๐
Solution: $ x^2 - 4 = 2^3 = 8 \implies x^2 = 12 \implies x = \pm 2\sqrt{3} $ But $ x^2 - 4 > 0 \implies x > 2 $ or $ x < -2 $. So, both $ x = 2\sqrt{3} $ and $ x = -2\sqrt{3} $ are valid.
Answer: $ x = 2\sqrt{3} $ or $ x = -2\sqrt{3} $
Key Concepts
- Logarithm: Inverse of exponential, $ y = \log_a x \iff x = a^y $ ๐
- Domain: $ x > 0 $, Range: all real numbers
- Laws:
- $ \log_a(MN) = \log_a M + \log_a N $
- $ \log_a(M/N) = \log_a M - \log_a N $
- $ \log_a(M^r) = r \log_a M $
- Natural Logarithm: $ \ln x = \log_e x $
- Common Logarithm: $ \log_{10} x $
Practice Questions with Solutions ๐โจ
Q1: Find the distance between points (2,4) and (-4,12). ๐
Solution:
$$ \sqrt{(-4 - 2)^2 + (12 - 4)^2} = \sqrt{(-6)^2 + 8^2} = \sqrt{36 + 64} = \sqrt{100} = 10 $$Q2: Solve quadratic equation $x^2 + 2x = 24$ by factoring. ๐งฎ
Solution:
$$ x^2 + 2x - 24 = 0 $$Factor:
$$ (x + 6)(x - 4) = 0 $$Roots:
$$ x = -6, \quad x = 4 $$Q3: Add polynomials $p(x) = x^3 + 3x^2 + 5x - 10$ and $q(x) = 3x^3 + 5x^2 - 6x - 20$. โ
Solution:
$$ p(x) + q(x) = (1+3)x^3 + (3+5)x^2 + (5 - 6)x + (-10 - 20) = 4x^3 + 8x^2 - x - 30 $$Q4: Find the inverse of $f(x) = 4x$ and verify if $g(x) = \frac{x}{4}$ is the inverse. ๐
Solution: Check compositions:
$$ (g \circ f)(x) = g(4x) = \frac{4x}{4} = x $$$$ (f \circ g)(x) = f\left(\frac{x}{4}\right) = 4 \times \frac{x}{4} = x $$Hence, $g$ is inverse of $f$.
Q5: Solve $\log_8 (x+1) + \log_8 (x-1) = 1$. ๐
Solution:
$$ \log_8 ((x+1)(x-1)) = 1 \implies \log_8 (x^2 - 1) = 1 $$$$ x^2 - 1 = 8^1 = 8 \implies x^2 = 9 \implies x = \pm 3 $$Check domain: $x > 1$, so $x = 3$ only.
Q6: If $f(x) = 3x - 4$ and $g(x) = x^2$, find $(f \circ g)(x)$. ๐ฏ
Solution:
$$ (f \circ g)(x) = f(g(x)) = f(x^2) = 3x^2 - 4 $$Q7: Calculate sum squared error (SSE) for points (1,5), (2,6), (4,9), (9,18) with line $y=2x+2$. ๐
Solution:
$$ SSE = \sum (y_i - (2x_i + 2))^2 = (5-4)^2 + (6-6)^2 + (9-10)^2 + (18-20)^2 = 1 + 0 + 1 + 4 = 6 $$This summary covers essential concepts with emojis for easy understanding and practice questions with detailed solutions to reinforce learning. For more exercises and deeper understanding, refer to the full PDF. ๐โจ
If you want, I can prepare more practice questions or detailed explanations on any specific topic! ๐