Maths Boot Camp: Session 1

The Basics, Functions, and Logarithms

Your Instructor

Hi!

  • Dr. Marta Antonetti: m.antonetti@lse.ac.uk
  • DPhil in Politics (Oxford)
  • LSE Fellow (Dept. Government)
    • Research Methodology
  • Research Interests: Political Campaigns, Marginalisation and Equality, Epistemic Autonomy and Manipulation
  • Experiments and Methods of Causal Inference

Setting Expectations

  • Boot Camp is designed to be accessible
    • From the basics to more challenging concepts
    • Gives you an overview of what is to come
    • No test
    • Don’t feel frustrated by the volume of material!
  • These sessions:
    • 3 blocks (breaks)
    • Group tasks
    • Sessions 1 and 2 are preparatory
  • I am also in charge of the pre-sessions on R programming

Support Textbooks

  • Maths:
    • Gill, J. (2006). Essential Mathematics for Political and Social Research.
    • Moore, W. H., & Siegel, D. A. (2013). A mathematics course for political and social research.
  • R:
    • Llaudet, E., & Imai, K. (2022). Data analysis for social science.
    • Imai, K. (2018). Quantitative Social Science.
    • Package: swirl
  • LSE Methodology Department: Methods surgeries available on Moodle

Session 1 Topics

  • Numbers, Intervals, Sets
  • Operators, Expressions, Equations, Inequalities
  • Functions (Introduction, Inverse, Roots)

Block 1

Numbers, Intervals and Sets

Numbers

  • Some Typology:
    • N: Natural numbers \{1, 2, 3, \dots\}
    • W: Whole numbers \{0, 1, 2, 3, \dots\}
    • Z: Integers \{\dots, -2, -1, 0, 1, 2, \dots\}
    • Q: Rational numbers \left(\frac{3}{5}\right)
    • R: Real numbers, including irrational numbers \left(\pi, \sqrt{2}\right)
    • C: Complex numbers z = 3 + 4i — real part 3, imaginary part 4, i the imaginary unit

Intervals

  • \equiv “is equivalent to”; \in “belongs to”; : “such that”
  • Open interval: (a,b) \equiv \{x \in \mathbb{R} : a < x < b\}
  • Closed interval: [a,b] \equiv \{x \in \mathbb{R} : a \leq x \leq b\}
  • Half open, half closed: (a,b] \equiv \{x \in \mathbb{R} : a < x \leq b\}

Sets

  • Definition: a set is a collection of distinct objects
  • Example: Set A = \{a, b, c\}, Set B = \{l, m, n, o\}
  • Intersection: A \cap B = \varnothing
  • Union: A \cup B = \{a, b, c, l, m, n, o\}

Sets

  • Some Typology:
    • Empty set: \varnothing or \{\}
    • Universal set: The set of all elements in context.
    • Complement: All elements not in the set A^c.
    • Proper Subset: A \subset B
    • Improper Subset: A \subseteq B
    • Open set: \{x : -1 < x < 3, x \in \mathbb{R}\}
    • Closed set: \{x : -1 \leq x \leq 3, x \in \mathbb{R}\}

Sets

  • Boundary: A group of points that touch the complement of a set
  • Interior Point: A point inside the boundary of a set
  • Bounded Set: All points are within a certain finite space
  • Unbounded Set: Points are not within a finite space, the set extends infinitely
  • Compact Set: A set that is both closed and bounded

Sets — Your Turn

  • Is it an open or a closed set?
  • The set \{(x,y) \in \mathbb{R}^2 : |x+y| < 1 \}
  • The set \{(x,y) \in \mathbb{R}^2 : x \leq 0, y \leq 0 \}
  • Set of the faces of a dice (can you also tell me if it is bounded or unbounded?)
  • The set \{(x,y) \in \mathbb{R}^2 : |x+y| < 1 \}: open
  • The set \{(x,y) \in \mathbb{R}^2 : x \leq 0, y \leq 0 \}: closed
  • Set of the number of a dice: bounded and closed, thus compact

Applied Example — Gill (2006)

Exploratory Study of Social Networks Using Sets

  • 18 community members, 14 social events (A–N) — an “X” means that person attended that event
  • Each event is a set of the people who attended it
  • The more events two people share, the closer they are in the social network

Applied Example — Gill (2006)

Applied Example — Gill (2006)

  • M = N: identical sets, both \{12, 13, 14\}
  • Several disjoint pairs exist, e.g. \{A,J\}, \{B,L\}, \{D,M\}
  • But the full collection A–N does not form a partition — too many overlapping intersections
  • No subset of events forms a partition either — individuals 15–18 are the reason why

Quick Check — Numbers & Sets

  1. Classify each number as natural, integer, rational, and/or real: \left\{-3,\ \frac{5}{2},\ 4,\ \sqrt{2},\ 0\right\}
  2. Given A = \{1, 2, 3\} and B = \{3, 4, 5\}, find A \cup B, A \cap B, and A - B.
  • -3: integer, rational, real  |  \frac{5}{2}: rational, real  |  4: natural, integer, rational, real  |  \sqrt{2}: real (irrational)  |  0: integer, rational, real
  • A \cup B = \{1,2,3,4,5\},   A \cap B = \{3\},   A - B = \{1, 2\}
    • A-B keeps only elements of A that are not in B — it doesn’t also add back what’s left of B, so it isn’t \{1,2,4,5\}; that combined set would be the symmetric difference, A \triangle B, a different operation

Towards the End of Block 1

Practice Time!

Block 2

Operators, Expressions, Equations and Inequalities

Common Operators

  • Addition + and Subtraction -: total, and difference, of numbers
  • Multiplication \times: repeated addition
  • Division : or /: splits a number into equal parts

Common Operators

  • Power: a^b = c — multiplies a by itself b times to get c
  • Root: \sqrt[b]{c} = a — what do you think this undoes? (c is exactly the power’s result — the number placed under the root)
  • Finds the number a that, raised to the bth power, gives c
  • Logarithm: \log_a c = b — what question is this secretly asking?
  • Finds the exponent b to which a must be raised to produce c
  • Summation: \sum_{i=1}^{n} a_i — any guesses?
  • Adds a sequence of numbers
  • Factorial: n! — and this one?
  • Product of all positive integers up to n, e.g., n! = n \times (n-1) \times \dots \times 1

Properties of Powers

  • Product of Powers: a^m \times a^n = a^{m+n}
  • Quotient of Powers: \frac{a^m}{a^n} = a^{m-n}
  • Power of a Power: (a^m)^n = a^{m \times n}
  • Power of a Product: (a \times b)^n = a^n \times b^n
  • Power of a Quotient: \left(\frac{a}{b}\right)^n = \frac{a^n}{b^n}

Properties of Powers — Quick Check

  • Is (x \times y)^3 = x^3 \times y^3?
  • Is a^3 \times a^3 = a^9?
  • (x \times y)^3 = x^3 \times y^3? YES — power of a product
  • a^3 \times a^3 = a^6, not a^9 — exponents add (3+3), they don’t multiply

Properties of Logarithms

  • Product Rule: \log_a (b \cdot c) = \log_a b + \log_a c
  • Quotient Rule: \log_a \left(\frac{b}{c}\right) = \log_a b - \log_a c
  • Power Rule: \log_a (b^c) = c \cdot \log_a b
  • Change of Base Formula: \log_a b = \frac{\log_c b}{\log_c a}

Properties of Logarithms — Quick Check

  • Is \log_2 \left(\frac{3}{7}\right) = \log_2 3 - \log_2 7?
  • Is \log_2 3 = \frac{\log_{10} 3}{\log_{10} 2}?
  • \log_2 \left(\frac{3}{7}\right) = \log_2 3 - \log_2 7? YES — quotient rule
  • \log_2 3 = \frac{\log_{10} 3}{\log_{10} 2}? YES — change of base formula

Order of Operations (PEMDAS)

  • Parentheses: Operations inside parentheses first
  • Exponents: Evaluate exponents next
  • Multiplication and Division: Left to right
  • Addition and Subtraction: Left to right

Expressions

  • Combination of numbers, variables, and operators
  • They denote a mathematical quantity (not an equality)
    • Example: 3 + 4 \times 2 = ?
  • According to PEMDAS: first the multiplication, 4 \times 2 = 8; then the addition, 3 + 8 = 11
  • Thus, 3 + 4 \times 2 = 11

Expressions

  • Example: Simplify the expression (2 + 3)^2
  • According to PEMDAS: first evaluate inside the parentheses, 2 + 3 = 5; then the exponent, 5^2 = 25
  • Thus, (2 + 3)^2 = 25

Equations

  • Equation: states that two expressions are equal
  • Solving means finding the x that makes it true
    • Example: Solve 5x - 7 = 18
  • Add 7 to both sides: 5x = 25
  • Divide both sides by 5: x = 5

Equations

  • Factorisation: express a polynomial as a product of factors
    • Example: Factorise x^2 + 5x + 6
  • Find two numbers multiplying to 6, summing to 5: 2 and 3
  • x^2 + 5x + 6 = (x+2)(x+3), so x = -2 and x = -3

Equations

The quadratic formula is used to find the roots of a quadratic equation ax^2 + bx + c = 0. The formula is:

x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

  • a, b, and c are coefficients of the quadratic equation

Equations — Worked Example

Example: Solve 2x^2 - 4x - 6 = 0 using the quadratic formula

  • Identify coefficients: a = 2, b = -4, c = -6
  • Compute the discriminant: b^2 - 4ac = (-4)^2 - 4(2)(-6) = 16 + 48 = 64
  • Substitute: x = \frac{-(-4) \pm \sqrt{64}}{2(2)} = \frac{4 \pm 8}{4}
  • Solve: x = \frac{4+8}{4} = 3 and x = \frac{4-8}{4} = -1
  • Thus, the solutions are x = 3 and x = -1

Inequalities

  • Inequalities compare expressions: >, \geq, <, \leq
    • Example: Solve 2x + 3 < 7
  • Subtract 3: 2x < 4
  • Divide by 2: x < 2

Inequalities — One More Rule

  • Dividing by a negative number means you have to reverse the inequality sign
    • Example: Solve -3x \geq 9
  • Divide both sides by -3, remembering to reverse the inequality sign: \frac{-3x}{-3} \leq \frac{9}{-3}
  • Simplify to x \leq -3
  • Thus, the solution to -3x \geq 9 is x \leq -3

Quick Check — Logs & Equations

  1. Evaluate \log_2 8.
  2. Solve \log_5(x - 2) = 3.
  3. Solve x^2 - 4x - 5 = 0 by factoring.
  • \log_2 8 = 3, since 2^3 = 8
  • \log_5(x-2)=3 \Rightarrow x-2 = 5^3 = 125 \Rightarrow x = 127
  • x^2-4x-5=(x-5)(x+1)=0 \Rightarrow x = 5 and x = -1

Towards the End of Block 2

Practice Time!

Block 3

Functions

Applied Example — Policy Preferences as Functions

  • Before whole elections, start with something simpler: how much does one individual want a given policy?
  • Picture a policy with a single intensity dial — e.g. how large a carbon tax should be, or how strict a sentencing guideline should be
  • Each voter i has one preferred point on that dial, x_i — that’s already a function:

f(i) = x_i

  • Voter in, preferred intensity out — one output per input

Functions

  • Function: a “black-box” mapping, f(x): A \rightarrow B — domain A to co-domain B
  • One output per input — the defining rule
  • Different x can share the same y; one x with two y’s is a relation, not a function

Functions — Types

  • Monomials: f(x) = ax^k; e.g. y = x^2
  • Polynomials: sums of monomials; e.g. y = 3x + 5
  • Rational: ratio of two polynomials; e.g. y = \frac{x^2+1}{2x^2-2x+1}
  • Exponential: e.g. y = 2^x    Trigonometric: e.g. y = \cos(x)
  • Linear: polynomial of degree 1, e.g. y = mx+b    Nonlinear: anything else

Roots of a Function

  • A root of a function is a value x such that f(x) = 0
    • Example: Find the root of the function f(x) = 2x^2 - 4x - 6

Roots of a Function

To find the roots of f(x) = 2x^2 - 4x - 6, solve 2x^2 - 4x - 6 = 0:

Step 1 — Identify the coefficients: a = 2, \quad b = -4, \quad c = -6

Step 2 — Use the quadratic formula: x = \frac{-(-4) \pm \sqrt{(-4)^2 - 4(2)(-6)}}{2(2)}

Step 3 — Simplify: b^2 - 4ac = 16 + 48 = 64, so x = \frac{4 \pm \sqrt{64}}{4}

Step 4 — Solve: \sqrt{64}=8, so x_1 = \frac{4+8}{4} = 3 and x_2 = \frac{4-8}{4} = -1

Solution: the roots of f(x) = 2x^2 - 4x - 6 are x = 3 and x = -1.

Composite Functions

  • Composite functions are when the output of one function is used as the input of another, e.g. fg(x) or f[g(x)]
  • Note that h[f(x)] is different from f[h(x)]
    • Example: Given h(x) = x^2 and f(x) = x - 5: find h(f(2))
    • Example: Given f(x) = 2x and g(x) = x+4: find f(g(x))

Composite Functions

  • Given h(x) = x^2 and f(x) = x - 5:
    • f(2) = 2 - 5 = -3
    • h(f(2)) = h(-3) = (-3)^2 = 9
  • Given f(x) = 2x and g(x) = x+4:
    • f(g(x)) = 2(x+4) = 2x + 8

Quick Check — Functions

  1. Given f(x) = 2x^2 - 3x + 5, evaluate f(2).
  2. Find the roots of f(x) = x^2 - 5x + 6.
  • f(2) = 2(2)^2 - 3(2) + 5 = 8 - 6 + 5 = 7
  • x^2-5x+6=(x-2)(x-3)=0 \Rightarrow x = 2 and x = 3

Towards the End of Block 3

Practice Time!

End of Session

  • Next session:
    1. Scalars, Vectors
    2. Matrices
    3. Neighbourhoods, and Limits