Beginner to intermediate

Aptitude and Reasoning for Campus Placements

Thirteen chapters of quantitative aptitude, data interpretation, logical reasoning and verbal ability with worked problems, shortcuts, common traps and answer-checked practice sets.

Chapter 8 of 13Quantitative aptitude · Algebra, Equations, Series and Indices

Algebra, Equations, Sequences and Indices

Algebra turns word problems into equations. The placement-test versions are small: linear and quadratic equations, simultaneous equations, inequalities, arithmetic and geometric progressions, indices, surds and logarithms. The skill is setting up the equation correctly and choosing between solving and substituting the options. Every worked answer is verified by computation.

1. Linear equations and word problems

Define a variable for the unknown, write what the text says as an equation, solve, and check the result against the wording.

Example 1. A number is multiplied by 5 and then 12 is subtracted; the result equals 3 times the number plus 6. Find the number. , so and .

Example 2. A pen costs Rs 8 more than a pencil. Five pens and three pencils cost Rs 94. Price of each? Let the pencil cost : , so and . A pen costs Rs 14.75. (Answers need not be whole numbers.)

Example 3. The sum of three consecutive even numbers is 78. Find them. , so and : the numbers are 24, 26, 28.

from fractions import Fraction

x = Fraction(18, 2)
assert 5 * x - 12 == 3 * x + 6 and x == 9
p = Fraction(94 - 40, 8)
assert 5 * (p + 8) + 3 * p == 94 and (p, p + 8) == (Fraction(27, 4), Fraction(59, 4))
assert sum([24, 26, 28]) == 78

2. Simultaneous equations

Two unknowns need two equations. Eliminate one variable by adding or subtracting multiples of the equations, or substitute.

Example 4. and . Find and . From the second, . Then , so , and .

Example 5. Five years ago a father was three times as old as his son. Five years from now he will be twice as old. Find their present ages. Let the father be and the son : and . Subtract: , which gives and .

Example 6. For which value of do and have infinitely many solutions? The second must be a multiple of the first: multiplying by 2 gives , so . If with the same right-hand side there is exactly one solution; with but a different constant there would be none.

assert 3 * 4 + 2 * 2 == 16 and 4 - 2 == 2
f, s = 35, 15
assert f - 5 == 3 * (s - 5) and f + 5 == 2 * (s + 5)
assert all(2 * x + 3 * y == 7 and 4 * x + 6 * y == 14 for x, y in [(2, 1), (Fraction(1, 2), 2), (-1, 3)])

3. Quadratic equations

A quadratic has roots

  • Discriminant : two distinct real roots, equal roots, no real roots.
  • Sum of roots ; product of roots .
  • If the roots are , the equation is .

Example 7. Solve . It factors as , so or .

Example 8. If the roots of are and , find . and , so (the roots are 3 and 4).

Example 9. For which values of does have equal roots? , so .

Example 10. The product of two consecutive positive integers is 342. Find them. , so , giving and the numbers 18 and 19.

import math

def roots(a, b, c):
    d = b * b - 4 * a * c
    if d < 0:
        return ()
    r = math.sqrt(d)
    return tuple(sorted({(-b - r) / (2 * a), (-b + r) / (2 * a)}))

assert roots(1, -5, 6) == (2.0, 3.0)
r = roots(1, -7, 12)
assert r == (3.0, 4.0) and r[0] ** 2 + r[1] ** 2 == 7 ** 2 - 2 * 12 == 25
assert roots(1, 6, 9) == (-3.0,) and roots(1, -6, 9) == (3.0,) and roots(1, 1, 9) == ()
assert roots(1, 1, -342) == (-19.0, 18.0) and 18 * 19 == 342

Word problems that become quadratics

Example 11. The length of a rectangle exceeds its breadth by 5 m, and its area is 150 m². Find the dimensions. , so , giving and length 15.

Example 12. A boat goes 30 km upstream and 30 km downstream in 8 hours in total. The stream flows at 2 km/h. Find the boat's speed in still water. gives , which simplifies to . The positive root is km/h (the other root, , is rejected).

assert roots(1, 5, -150) == (-15.0, 10.0) and 10 * 15 == 150
v = 8
assert Fraction(30, v - 2) + Fraction(30, v + 2) == 8 and 2 * v ** 2 - 15 * v - 8 == 0
assert roots(2, -15, -8) == (-0.5, 8.0)

4. Inequalities

Treat them like equations with one change: multiplying or dividing by a negative number reverses the inequality.

Example 13. Solve : , so .

Example 14. Solve : , so (the sign reverses).

Example 15. Solve . The roots are 2 and 3 and the parabola opens upward, so it is negative between the roots: .

assert [n for n in range(-5, 15) if 3 * n - 7 > 11] == list(range(7, 15))
assert [n for n in range(-5, 15) if -2 * n + 5 <= 1] == list(range(2, 15))
assert all(v * v - 5 * v + 6 < 0 for v in (2.1, 2.5, 2.9))                      # negative between the roots
assert all(v * v - 5 * v + 6 >= 0 for v in (1.9, 2, 3, 3.1))                     # and not outside them

5. Arithmetic progression (AP)

Each term differs from the previous by a common difference .

  • th term: .
  • Sum of terms: where is the last term.
  • Number of terms between and : .
  • Three numbers in AP can be written .

Example 16. Find the 20th term and the sum of the first 20 terms of 7, 11, 15, ... , : ; .

Example 17. How many terms are there in 5, 9, 13, ..., 101? .

Example 18. The sum of the first terms of an AP is . Find the 10th term. (so ).

Example 19. Three numbers in AP have sum 33 and product 1,287. Find them. Write : sum , ; product , so , : 9, 11, 13.

a, d = 7, 4
terms = [a + k * d for k in range(20)]
assert terms[-1] == 83 and sum(terms) == 900 == 20 * (7 + 83) // 2
assert len(range(5, 102, 4)) == 25
S = lambda n: 3 * n ** 2 + 2 * n
assert S(10) - S(9) == 59 == 6 * 10 - 1
assert 9 + 11 + 13 == 33 and 9 * 11 * 13 == 1287

6. Geometric progression (GP)

Each term is the previous times a common ratio .

  • th term: .
  • Sum of terms: for .
  • Sum to infinity (when ): .
  • Three numbers in GP: .

Example 20. Find the 8th term and the sum of the first 8 terms of 3, 6, 12, ... , .

Example 21. Sum of to infinity: .

Example 22. Express as a fraction. is a GP with , : .

assert 3 * 2 ** 7 == 384 and sum(3 * 2 ** k for k in range(8)) == 765 == 3 * (2 ** 8 - 1)
assert abs(sum(0.5 ** k for k in range(60)) - 2) < 1e-12
assert Fraction(36, 99) == Fraction(4, 11) and abs(4 / 11 - 0.363636363636) < 1e-9

Compound interest and population growth are GPs, and so is a ball that rebounds to a fixed fraction of its height.

Example 23. A ball dropped from 80 m rebounds to of its previous height each time. Total vertical distance travelled before it stops? Down 80, then each rebound goes up and down: m.

total = 80 + 2 * sum(80 * Fraction(3, 4) ** k for k in range(1, 200))
assert abs(float(total) - 560) < 1e-9

7. Other series worth knowing

  • ; ; .
  • Telescoping: , so .
  • Fibonacci-like and difference series: look at the differences, then the differences of the differences.
n = 99
assert sum(Fraction(1, k * (k + 1)) for k in range(1, n + 1)) == 1 - Fraction(1, n + 1) == Fraction(99, 100)
seq = [2, 6, 12, 20, 30]
assert [b - a for a, b in zip(seq, seq[1:])] == [4, 6, 8, 10] and seq == [k * (k + 1) for k in range(1, 6)]

8. Indices and surds

Laws of indices: ; ; ; ; ; ; .

Example 24. Simplify . Numerator ; denominator ; ratio .

Example 25. If and , find : , , so .

Example 26. Rationalise : multiply by to get .

for n in range(1, 8):
    assert Fraction(2 ** (n + 4) - 2 * 2 ** n, 2 * 2 ** (n + 3)) == Fraction(7, 8)
assert 2 ** 3 == 8 and 3 ** 4 == 81
assert abs(1 / (5 ** 0.5 - 3 ** 0.5) - (5 ** 0.5 + 3 ** 0.5) / 2) < 1e-12

Comparing surds and powers. To compare and , raise both to the common power 6: against , so .

assert 4 ** (1 / 3) > 2 ** 0.5 and 4 ** 2 == 16 and 2 ** 3 == 8

9. Logarithms

means .

  • ; ; .
  • Change of base: . , .
  • .

Example 27. If , find the number of digits in : , so has 16 digits.

Example 28. Evaluate : .

import math
assert len(str(2 ** 50)) == 16 and math.floor(50 * 0.3010) + 1 == 16
assert math.log2(64) + math.log(81, 3) - math.log(125, 5) - 7 < 1e-9
assert round(math.log10(2) + math.log10(5), 10) == 1.0

10. Functions and quick algebraic identities

  • ; ; .
  • ; .
  • .
  • If , then and .

Example 29. If , find : .

Example 30. If and , find and : ; .

x = (5 + 21 ** 0.5) / 2
assert abs(x + 1 / x - 5) < 1e-12 and abs(x ** 2 + 1 / x ** 2 - 23) < 1e-9 and abs(x ** 3 + 1 / x ** 3 - (125 - 15)) < 1e-9
a, b = 7, 3
assert a + b == 10 and a * b == 21 and a ** 2 + b ** 2 == 58 and a ** 3 + b ** 3 == 370

11. Substituting the options

When the algebra is long and the options are numbers, test them. Check the condition in the question, not a partial one, and use the last digit or the size of the answer to discard options quickly.

Example 31. The sum of a number greater than 1 and its reciprocal is . The number is: (a) (b) (c) 2 (d) 3. Test (b): . Options (c) and (d) give and , and (a) is below 1. So (b).

options = {"a": Fraction(1, 2), "b": Fraction(3, 2), "c": Fraction(2), "d": Fraction(3)}
assert [k for k, v in options.items() if v > 1 and v + 1 / v == Fraction(13, 6)] == ["b"]

12. Common traps

  • Forgetting to reverse an inequality when multiplying by a negative.
  • Dividing both sides by an expression that could be zero, losing a root.
  • Discarding a root without checking the context (a negative length, or a number that is not an integer).
  • Applying the AP sum formula with the wrong number of terms (off by one).
  • Treating as .
  • Misreading "consecutive" (consecutive odd numbers differ by 2, not 1).
  • Percentages of percentages in algebraic word problems.

13. Practice set with answers

  1. Solve .
  2. A two-digit number is 7 times the sum of its digits, and it exceeds the number formed by reversing its digits by 36. Find it.
  3. Find if the roots of differ by 2.
  4. Find the sum of all multiples of 7 between 100 and 300.
  5. The 5th term of a GP is 48 and the 2nd term is 6. Find the 8th term.
  6. If and , find .
  7. Solve .
  8. How many digits does have? (Use .)
assert [Fraction(n) for n in range(-50, 51) if Fraction(n + 3, 4) - Fraction(n - 1, 3) == 1] == [1]
assert [n for n in range(10, 100) if n == 7 * (n // 10 + n % 10) and n - int(str(n)[::-1]) == 36] == [84]
assert [k for k in range(-20, 21) if roots(1, -6, k) and abs(roots(1, -6, k)[-1] - roots(1, -6, k)[0]) == 2] == [8]
multiples = [m for m in range(101, 300) if m % 7 == 0]
assert (multiples[0], multiples[-1], len(multiples), sum(multiples)) == (105, 294, 28, 5586)
assert 3 * 2 ** 1 == 6 and 3 * 2 ** 4 == 48 and 3 * 2 ** 7 == 384
a, b = 3, 5                                                                     # the numbers with sum 8 and product 15
assert a + b == 8 and a * b == 15 and a ** 3 + b ** 3 == 152 == 8 ** 3 - 3 * 15 * 8
assert roots(2, -9, 4) == (0.5, 4.0)
assert len(str(5 ** 20)) == 14 and math.floor(20 * 0.6990) + 1 == 14

Answers: 1) ; 2) 84; 3) (roots 2 and 4); 4) 5,586 (28 terms from 105 to 294); 5) 384 (first term 3, ratio 2); 6) 152; 7) or ; 8) 14 digits.

Header Logo