PYQ Vault

CDS Mathematics · Linear Equations

Whole-Number Solutions

An equation like 7a + 10b = 200 has only a few whole-number solutions; find one, then step to the others by the coefficients.

Why this matters

Five PYQs, three of them HARD — the densest HARD page in the chapter, because it needs counting as well as algebra. Most come down to divisibility (7a + 10b = 200 forces a to be a multiple of 10) or to factorising into a product that equals a small number.

Concept 1 of 1: Stepping through the solutions

If ax+by=cax + by = c has one whole-number solution, the next is found by adding bb to xx and taking aa from yy (for coprime a,ba, b). So the solutions march in equal steps, and counting them is counting steps.

Definition

  • ax+by=cax + by = c with gcd⁡(a,b)=1\gcd(a, b) = 1: from one solution (x0,y0)(x_0, y_0), all are x=x0+btx = x_0 + bt, y=y0−aty = y_0 - at.
  • Divisibility first: in 5a+7o=5005a + 7o = 500, 7o7o is a multiple of 55, so oo is.
  • 'Positive' excludes 00; 'buys both' excludes 00 too.
  • Positive solutions of x+y+z=nx + y + z = n: (n−12)\binom{n - 1}{2}.
  • Products: rearrange into (px−q)(py−r)=N(px - q)(py - r) = N and list the factor pairs of NN.

All solutions

x=x0+bt,y=y0−atx = x_0 + bt, \quad y = y_0 - at

Worked example

How many ways can Rs. 100100 be spent exactly on pens at Rs. 33 and notebooks at Rs. 88, buying at least one of each?
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

CDS · 2017 · CDS (I) 2017 — Elementary Mathematics · Q40Moderate

Example 1 · Linear Equations · Integral Solutions and Diophantine Equations

Sunil wants to spend Rs. 200 on two types of sweets, costing Rs. 7 and Rs. 10 respectively. What is the maximum number of sweets he can get so that no money is left over ?

Does zero count?

'Buy both apples and oranges' rules out zero of either; 'non-negative' allows it. The count changes by one or two at each end, which is exactly the spread of the options.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (1)

Watch out for (1)

Test yourself on Linear Equations

15 past CDS questions from this chapter, timed at 18 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.