Integral Solutions Revisited: Advanced Constraints
Master complex bounded variable problems with inclusion-exclusion, generating functions, and advanced constraint handling.
Beyond Basic Integral Solutions
While $x_1 + x_2 + \cdots + x_r = n$ with $x_i \geq 0$ is straightforward, JEE Advanced introduces complex constraints like:
- Lower bounds: $x_i \geq a_i$ (minimum values)
- Upper bounds: $x_i \leq b_i$ (maximum values)
- Mixed constraints: Different bounds for different variables
- Non-homogeneous bounds: $a \leq x_i \leq b$ with $a \neq 0$
🎯 JEE Advanced Focus
These problems test your understanding of inclusion-exclusion principle, generating functions, and complementary counting. Mastery can earn you 8-12 marks in every JEE Advanced paper.
🔍 Technique Navigation
Lower Bounds Only: The Substitution Method
Problem Type
Find number of integral solutions to $x_1 + x_2 + \cdots + x_r = n$ with $x_i \geq a_i$
Solution Approach
Step 1: Substitute $y_i = x_i - a_i$ for each variable
Step 2: This transforms the equation to:
Step 3: With $y_i \geq 0$
Step 4: Number of solutions = $\binom{n - \sum a_i + r - 1}{r - 1}$
Example
Find number of solutions to $x_1 + x_2 + x_3 = 15$ with $x_1 \geq 2, x_2 \geq 3, x_3 \geq 4$
Substitute: $y_1 = x_1 - 2, y_2 = x_2 - 3, y_3 = x_3 - 4$
New equation: $y_1 + y_2 + y_3 = 15 - (2+3+4) = 6$
Solutions: $\binom{6 + 3 - 1}{3 - 1} = \binom{8}{2} = 28$
Upper Bounds Only: Complementary Counting
Problem Type
Find number of integral solutions to $x_1 + x_2 + \cdots + x_r = n$ with $x_i \leq b_i$
Solution Approach
Step 1: Start with total solutions without upper bounds
Step 2: Subtract solutions where at least one $x_i > b_i$
Step 3: Use inclusion-exclusion principle
Step 4: For each $x_i > b_i$, substitute $y_i = x_i - (b_i + 1)$
Example
Find number of solutions to $x_1 + x_2 + x_3 = 10$ with $x_i \geq 0$ and $x_1 \leq 3, x_2 \leq 4, x_3 \leq 5$
Total solutions: $\binom{10 + 3 - 1}{3 - 1} = \binom{12}{2} = 66$
Case A1: $x_1 \geq 4$, let $y_1 = x_1 - 4$
Equation: $y_1 + x_2 + x_3 = 6$ → $\binom{8}{2} = 28$
Case A2: $x_2 \geq 5$, let $y_2 = x_2 - 5$
Equation: $x_1 + y_2 + x_3 = 5$ → $\binom{7}{2} = 21$
Case A3: $x_3 \geq 6$, let $y_3 = x_3 - 6$
Equation: $x_1 + x_2 + y_3 = 4$ → $\binom{6}{2} = 15$
Intersections: Subtract double counts, add triple counts
Final: $66 - (28 + 21 + 15) + (\text{intersections}) = 6$
Both Lower and Upper Bounds
Problem Type
Find number of integral solutions to $x_1 + x_2 + \cdots + x_r = n$ with $a_i \leq x_i \leq b_i$
Solution Approach
Step 1: First handle lower bounds using substitution
Step 2: Then apply upper bounds using inclusion-exclusion
Step 3: Combine both techniques systematically
Example
Find number of solutions to $x_1 + x_2 + x_3 = 20$ with $2 \leq x_1 \leq 6, 3 \leq x_2 \leq 7, 4 \leq x_3 \leq 8$
Handle lower bounds: $y_1 = x_1 - 2, y_2 = x_2 - 3, y_3 = x_3 - 4$
New equation: $y_1 + y_2 + y_3 = 20 - 9 = 11$ with $y_i \geq 0$
Upper bounds become: $y_1 \leq 4, y_2 \leq 4, y_3 \leq 4$
Now apply inclusion-exclusion for upper bounds...
Inclusion-Exclusion Principle Mastery
The General Formula
For $x_1 + x_2 + \cdots + x_r = n$ with $0 \leq x_i \leq b_i$:
Step-by-Step Application
Step 1: Start with total solutions: $\binom{n + r - 1}{r - 1}$
Step 2: Subtract solutions where each $x_i > b_i$
Step 3: Add back solutions where two variables exceed bounds
Step 4: Continue alternating signs
Step 5: Stop when the binomial coefficient becomes invalid (negative top)
Example
Find number of solutions to $x_1 + x_2 + x_3 + x_4 = 18$ with $0 \leq x_i \leq 6$
Total: $\binom{18 + 4 - 1}{3} = \binom{21}{3} = 1330$
Single exceed: $x_i \geq 7$, 4 cases × $\binom{18-7+4-1}{3} = 4 × \binom{14}{3} = 4 × 364 = 1456$
Double exceed: $\binom{4}{2} × \binom{18-14+4-1}{3} = 6 × \binom{7}{3} = 6 × 35 = 210$
Triple exceed: $\binom{4}{3} × \binom{18-21+4-1}{3} = 4 × \binom{0}{3} = 0$
Final: $1330 - 1456 + 210 - 0 = 84$
📋 Quick Reference Table
| Constraint Type | Method | Formula/Approach | When to Use |
|---|---|---|---|
| $x_i \geq a_i$ | Substitution | $\binom{n - \sum a_i + r - 1}{r - 1}$ | Only lower bounds |
| $x_i \leq b_i$ | Inclusion-Exclusion | Alternating sum formula | Only upper bounds |
| $a_i \leq x_i \leq b_i$ | Combination | Substitution + Inclusion-Exclusion | Both bounds present |
| Large $n$, small $b_i$ | Generating Functions | Coefficient of $x^n$ in $\prod (1+x+\cdots+x^{b_i})$ | Complex bounds |
Generating Functions Approach
The Power of GFs
For $x_1 + x_2 + \cdots + x_r = n$ with $a_i \leq x_i \leq b_i$:
Number of solutions = Coefficient of $x^n$ in $G(x)$
Simplification Tricks
Geometric series: $x^a + x^{a+1} + \cdots + x^b = x^a \cdot \frac{1 - x^{b-a+1}}{1 - x}$
Product form: $G(x) = \frac{\prod_{i=1}^r (x^{a_i} - x^{b_i+1})}{(1 - x)^r}$
Binomial expansion: Use $(1-x)^{-r} = \sum_{k=0}^\infty \binom{r+k-1}{k} x^k$
Example
Find number of solutions to $x_1 + x_2 = 8$ with $1 \leq x_1 \leq 5, 2 \leq x_2 \leq 6$
Generating function: $(x + x^2 + x^3 + x^4 + x^5)(x^2 + x^3 + x^4 + x^5 + x^6)$
Simplify: $x(1+x+x^2+x^3+x^4) \cdot x^2(1+x+x^2+x^3+x^4) = x^3 (1+x+x^2+x^3+x^4)^2$
Coefficient of $x^8$: Coefficient of $x^5$ in $(1+x+x^2+x^3+x^4)^2$
Ways to get $x^5$: $(x,x^4), (x^2,x^3), (x^3,x^2), (x^4,x)$ → 4 solutions
Complementary Counting for Bounded Variables
When to Use This
When upper bounds are small and it's easier to count violations than valid solutions
Strategy
Step 1: Count total solutions without upper bounds
Step 2: Count solutions where at least one bound is violated
Step 3: Subtract using inclusion-exclusion
Step 4: This is often easier than direct counting
⚠️ Common Pitfall
Students forget that when a variable exceeds its upper bound, we need to count all such cases, not just exactly at the bound.
🎯 JEE Advanced Practice Problems
1. Find number of solutions to $x_1 + x_2 + x_3 + x_4 = 15$ with $0 \leq x_i \leq 6$
2. Find number of solutions to $x_1 + x_2 + x_3 = 12$ with $x_1 \geq 2, x_2 \geq 3, x_3 \geq 4$ and $x_1 \leq 5, x_2 \leq 6, x_3 \leq 7$
3. Using generating functions, find number of solutions to $x_1 + x_2 + x_3 = 10$ with $1 \leq x_i \leq 4$
🚀 JEE Exam Strategy
Time Management
- Simple bounds: 2-3 minutes max
- Medium complexity: 4-5 minutes
- Advanced bounds: 6-8 minutes
- If stuck after 3 minutes, move on and return
Method Selection
- Only lower bounds: Always use substitution
- Only upper bounds: Inclusion-exclusion
- Small n, simple bounds: Direct enumeration
- Complex bounds: Generating functions
Master These 6 Techniques for JEE Success!
Integral solutions with constraints appear in every JEE Advanced paper. Complete mastery can earn you 8-12 guaranteed marks.