RUET · ECE Dept · B.Sc. Engineering 2nd Year Even Semester Examination, 2022
This file explains the same questions as
the 2022 answer script, written to be read
rather than copied. Every step is named, the reason a formula is chosen is
stated, and the traps that catch people are called out.
SECTION A
Question 1
(a) What is the difference between open and bracketing method of root finding?
[Marks: 02, CO: 1]
Bracketing. You start with an interval [a,b] in which f changes sign.
f(a)⋅f(b)<0
Continuity then guarantees at least one root inside. Each iteration throws away
the half of the interval that does not contain the sign change, so the interval
can never lose the root. That guarantee is the whole point.
Open. No interval. You start from a single guess x0 and generate the next
point from a formula. Nothing keeps the iterates near the root, so a bad start
can send them off to infinity.
Property
Bracketing
Open
Initial data
an interval with a sign change
one estimate x0
Needs
f and its sign
fandf′
Convergence
always, from any valid bracket
only if x0 is close enough
Rate
linear, O(h)
superlinear, or quadratic
Examples
bisection, regula falsi
Newton-Raphson, secant, fixed point
bracketing encloses the root and always converges; open methods start free and may not
(b) Evaluate f(1) using Taylor's series for f(x), where f(x)=x3−3x2+5x−10.
Step 2. Differentiate and evaluate at zero. All four rows are needed, because
a cubic is exactly the case where the fourth derivative decides whether the
series terminates.
f(x)
f′(x)
f′′(x)
f′′′(x)
f(4)(x)
x3−3x2+5x−10
3x2−6x+5
6x−6
6
0
f(0)=−10,f′(0)=5,f′′(0)=−6,f′′′(0)=6,f(4)=0
Step 3. The series terminates. The fourth derivative is identically zero, so
there is nothing after the cubic term:
f(x)=−10+5x+2−6x2+66x3=−10+5x−3x2+x3
Step 4. Put x=1.
f(1)=−10+5(1)−3(1)2+(1)3=−10+5−3+1
f(1)=−7
(c) Explain a real life application of curve-fitting. For what type of data points will you use Lagrange's interpolation formula?
[Marks: 04, CO: 2]
A real application. Calibrating a thermocouple, or any sensor, against
certified reference temperatures.
A calibration certificate lists reference points:
Reference temperature (∘C)
Indicated reading (mV)
0
0.00
100
4.09
200
7.33
400
12.45
Each reading carries thermal drift and instrument noise, so no curve passes
exactly through all four points. Least squares finds the one that comes closest,
and the fitted curve then calibrates the instrument: a raw reading of
9.20 mV is converted to a temperature through it. The calibration curve is not
an interpolation of the data, it is a fit, because the data are measurements.
A second application: a load-extension test, where the raw data scatter
because the specimen is not perfectly uniform, and the fitted curve is what
gives the engineering stress and stiffness.
When to reach for Lagrange. Use it when all of these hold.
The data are exact. Interpolation forces the curve through every point, so
any error in a data point is copied straight into the answer.
The points are few. Two give a line, three a parabola; the degree rises by
one with each extra point. Many exact points make the expression unwieldy.
The spacing is uneven. Lagrange needs no common difference h. Newton
forward and backward both require equal spacing.
The target is inside the data range. Outside it, Lagrange oscillates badly
and a fitted curve is the right tool instead.
Situation
Method
Few, exact, irregularly spaced
Lagrange
Many, equally spaced, exact, near the start
Newton forward
Many, equally spaced, exact, near the end
Newton backward
Noisy data, any spacing
Least squares
Target outside the data
Least squares, not interpolation
Question 2
(a) Find the polynomial which fits the following data: (−1,7), (1,5), (2,15).
[Marks: 04, CO: 1]
With three points the lowest-degree polynomial that can pass through all three
is a quadraticy=a0+a1x+a2x2. A linear fit would need the
points to be collinear, and they are not, so the degree is forced.
Method: simultaneous equations. Substitute each point:
a0−a1+a2=7a0+a1+a2=5a0+2a1+4a2=15
Subtract the first from the second to kill a0 and a2 at once:
2a1=−2⇒a1=−1
With a1=−1 the first equation gives a0+a2=6, and the third gives
a0+4a2=17. Subtract: 3a2=11, so a2=311, and
a0=6−311=37.
y=311x2−x+37
Check every point, which takes one line each and settles the answer.
Step 4. Normal equations. Sum v=au+b over the four points, and sum
uv=au2+bu:
{nb+a∑u=∑v(∑u)b+a∑u2=∑uv
Note which coefficient multiplies which sum: the slope a multiplies
∑u and ∑u2, while the intercept b multiplies n and
∑u. Writing 4a+0.741667b=0.372516 puts them the wrong way round, and
it is the single most common error in this question.
The series returns r3 exactly, as it must, since r3 is itself a cubic. The
Δ4 row of zeros confirms it: a degree-k polynomial has a constant
k-th forward difference and a zero (k+1)-th.
Step 3. Sum from u=0 to u=n−1.
Sn=u=0∑n−1[1+7u+6u(u−1)+u(u−1)(u−2)]
Now use the standard sums, each of which is a hockey-stick identity in disguise:
Step 3. Richardson extrapolation. The trapezoid rule has O(h2) error, so
halving h cuts the error by 4, and each extrapolation removes a factor of
4j−1:
(b) A cubic function y=f(x) satisfies the data x=0,1,3,4,2 with f(x)=1,4,40,85,17. Determine the value of f′(4).
[Marks: 04, CO: 2]
Step 1. Newton's divided difference form, on the sorted nodes.
Order
Values
How each entry is computed
y
1, 4, 17, 40, 85
given
1st
3, 13, 23, 45
(4−1)/1, (17−4)/1, (40−17)/1, (85−40)/1
2nd
5, 5, 11
(13−3)/2=5, (23−13)/2=5, (45−23)/2=11
3rd
0, 2
(5−5)/3=0, (11−5)/3=2
4th
21
(2−0)/4=21
The fourth divided difference is 21, not zero. For any cubic in x
the third divided difference is constant and the fourth is zero, so this table is
the proof that the data lie on a quartic, not a cubic.
Definition. In Gaussian elimination, pivoting is interchanging rows, or
columns, so that the element chosen as the pivot, which is the next divisor,
is as large as possible in magnitude, or at least not negligibly small.
Why it is needed. Every elimination step divides by the pivot. If the pivot is
0 the step is impossible. If it is merely tiny, say 10−9, the multiplier
aik/akk becomes enormous, and the elimination floods the remaining rows
with round off.
Three forms.
Partial pivoting, the usual choice. At step k, find the largest
∣aik∣ in column k below the diagonal and swap that row up. Cost is one
comparison per candidate, no extra arithmetic, and it is stable in practice.
Scaled partial pivoting. Divide each candidate by its own row's largest
magnitude first, then compare, choosing k to maximise
maxj∣aij∣∣aik∣.
This stops a row with large entries but a small pivot from being unfairly
penalised.
Complete pivoting. Search the whole remaining submatrix and permute both
rows and columns. The most stable, but it scrambles the variable order, so it
is confined largely to research codes.
Pivoting reorders rows or columns so the divisor is as large as possible, avoiding a tiny pivot and its round off
Question 4
(a) Solve the system using Jacobi method: 6x+y+z=20, x+4y−z=6, x−y+5z=7.
[Marks: 04, CO: 1]
Step 1. Rearrange each equation to isolate its own variable. Do this one
equation at a time and move every other term to the right, changing its sign.
x=620−y−z,y=46−x+z,z=57−x+y
Step 2. Check the convergence condition. Jacobi converges when the matrix is
strictly diagonally dominant, that is when each diagonal entry exceeds the sum
of the off-diagonal entries in its own row.
Row
Diagonal
Off-diagonal sum
1
6
1 + 1 = 2
6>2 ✓
2
4
1 + 1 = 2
4>2 ✓
3
5
1 + 1 = 2
5>2 ✓
Convergence is guaranteed. This check costs one line and decides whether the
iteration is worth running at all.
Step 3. The Jacobi rule. Use only values from the previous iteration,
never a value just computed:
(b) Solve the system using Gauss elimination: 2x1+x2−x3=−1, x1−2x2+3x3=9, 3x1−x2+5x3=14. Check your answer by substituting into the original equations.
[Marks: 04, CO: 2]
Step 1. The augmented matrix.
2131−2−1−135−1914
Step 2. Eliminate x1 from rows 2 and 3. The multipliers are 21
and 23, taken as row entry over pivot.
Definition. A system of linear equations is ill-conditioned when a small
change in the input produces a disproportionately large change in the solution.
Measure. The condition numberκ of the coefficient matrix is the
ratio of the largest to the smallest relative error:
∥b∥∥δb∥∥x∥∥δx∥≤κ(A)
So a relative error of ϵ in the data may become up to κϵ in
the answer.
κ
Behaviour
κ=1
Perfectly conditioned, error passes through unchanged
κ≈10
Mild amplification
κ≈106
Loss of about six significant digits
κ>1016
All precision lost, the matrix is numerically singular
Causes.
A matrix that is nearly singular, with an eigenvalue very close to zero
or rows that are almost linearly dependent. Two nearly parallel equations
constrain the solution very weakly.
Rows or columns of wildly different magnitudes. The small ones are
effectively ignored.
A bad choice of variables. Two variables measuring nearly the same
physical quantity make the corresponding columns almost equal.
ill-conditioned means small input errors produce large output errors; measured by κ
SECTION B
Question 5
(a) Explain how proposition differs from traditional sentence. Give some examples.
[Marks: 03, CO: 2]
Proposition. A declarative sentence that is unambiguously either true or
false, with exactly one truth value. Nothing more is required. It need not be
meaningful, need not be verifiable today, and carries no quantifier.
Traditional sentence. Any statement of natural language. The category is
much wider, admitting sentences with no truth value at all.
Sentence
Proposition?
Reason
The transistor conducts
Yes
true or false
2+2=4
Yes
Water boils at 100∘C at sea level
Yes
a fact, though it needs a reference condition
Close the window
No
imperative, a command
Is the door open
No
interrogative, a question
Please hand me the tool
No
a request
x+1>0
No
depends on the unknown x
The present king of France is bald
No
presupposes a non-existent referent, so no truth value
1/0=3
No
meaningless, division by zero
The four tests.
Declarative. It asserts rather than commands, asks or requests.
Not interrogative. No question in intent.
Has a truth value. Exactly one of true or false, with nothing in between.
Meaningful. Every symbol is defined, so the sentence can be evaluated.
(b) The truth value of the conjunction of two propositions in fuzzy logic is the minimum of the truth values of the statements "Fred and John are happy" and "Neither Fred nor John is happy". Prove the statement.
[Marks: 03, CO: 1]
Setup. Fuzzy logic assigns each proposition a truth value in [0,1], where
0 is false and 1 is true. Fuzzy conjunction is defined by
T(A∧B)=min(T(A),T(B))
Let h=T(Fred is happy) and j=T(John is happy), with
0≤h,j≤1.
Statement A, "Fred and John are happy." A conjunction of two, so
T(A)=min(h,j)
Statement B, "Neither Fred nor John is happy." "Neither A nor B" expands to
¬A∧¬B, and fuzzy negation is T(¬P)=1−T(P), so
T(B)=min(1−h,1−j)=1−max(h,j)
Statement C, the conjunction A∧B. Applying the defining rule:
T(C)=min(T(A),T(B))=min(min(h,j),1−max(h,j))
Written out in full, that is T(C)=min(h,j,1−h,1−j), which is
exactly the assertion to be proved. The claim holds by the defining rule.
(c) Show that ¬ and ∧ form a functionally complete collection of logical operators.
[Marks: 02, CO: 2]
Definition. A collection of operators is functionally complete if every
other Boolean operator can be expressed using only those operators.
Goal. Build ∨ and → from ¬ and ∧ alone.
Step 1. Disjunction, by De Morgan. Since ¬(p∧q)=¬p∨¬q,
p∨q=¬(¬p∧¬q)
Step 2. Implication. Since p→q≡¬p∨q,
p→q=¬p∨q=¬(¬(¬p)∧¬q)
Step 3. Biconditional. Since p↔q≡(p→q)∧(q→p),
substituting step 2 in both places expresses it in terms of ¬ and ∧
too.
Step 4. Verify against the truth tables. Rows run p outer, q inner, each
taking T then F.
p
q
¬p
¬q
p∨q
¬(¬p∧¬q)
p→q
¬(¬(¬p)∧¬q)
F
F
T
T
F
¬(T∧T)=F ✓
T
¬(F∧T)=T ✓
F
T
T
F
T
¬(T∧F)=T ✓
T
¬(F∧F)=T ✓
T
F
F
T
T
¬(F∧T)=T ✓
F
¬(T∧T)=F ✓
T
T
F
F
T
¬(F∧F)=T ✓
T
¬(T∧F)=T ✓
Every constructed column matches its target in all four rows.
Step 5. Conclusion. The operators ¬ and ∧ generate ∨, →,
↔ and everything built from them, so the collection is
functionally complete.
p∨q=¬(¬p∧¬q),p→q=¬(¬(¬p)∧¬q)
(d) Consider these statements, of which the first three are premises and the fourth is a valid conclusion. "All humming are richly colored." "No large birds live on honey." "Birds that do not live on honey are dull in order." Conclusion: "Humming birds are small."
[Marks: 02, CO: 3]
Step 1. Formalise using Predicate Logic.
In Lewis Carroll's logic puzzles and Rosen's formulation, natural-language antonyms are treated as logical complements:
"dull in colour" is the exact complement of "richly coloured" (¬S(x)).
"small" is the exact complement of "large" (¬Q(x)).
Let the universe of discourse U be the set of all birds:
P(x): x is a hummingbird
Q(x): x is large ⟹¬Q(x): x is small
R(x): x lives on honey ⟹¬R(x): x does not live on honey
S(x): x is richly coloured ⟹¬S(x): x is dull in colour
Step 2. Express premises and the conclusion.
Premise 1 (P1): "All hummingbirds are richly colored"
∀x(P(x)→S(x))
Premise 2 (P2): "No large birds live on honey" (if large, then does not live on honey)
∀x(Q(x)→¬R(x))
Premise 3 (P3): "Birds that do not live on honey are dull in colour"
∀x(¬R(x)→¬S(x))
Conclusion (C): "Hummingbirds are small"
∀x(P(x)→¬Q(x))
Step 3. Rigorous proof using Rules of Inference.
Let c be an arbitrary bird in U:
Step
Proposition
Justification
1
P(c)→S(c)
Premise 1 by Universal Instantiation
2
¬R(c)→¬S(c)
Premise 3 by Universal Instantiation
3
S(c)→R(c)
Contrapositive of Step 2 (¬B→¬A≡A→B)
4
P(c)→R(c)
Hypothetical Syllogism from Steps 1 and 3
5
Q(c)→¬R(c)
Premise 2 by Universal Instantiation
6
R(c)→¬Q(c)
Contrapositive of Step 5
7
P(c)→¬Q(c)
Hypothetical Syllogism from Steps 4 and 6
8
∀x(P(x)→¬Q(x))
Universal Generalization from Step 7
Since ¬Q(x) means "x is small", the deduction is complete and valid.
The argument is VALID via Universal Instantiation, Contraposition, and Hypothetical Syllogism
Question 6
(a) Knights always tell the truth, Knaves always lie, Spies can either. Three people A, B and C, one of each type, each knows the types of the other two. (i) A says "C is the Knave", B says "A is the Knight", C says "I am the spy". (ii) A says "I am the Knave", B says "I am the Knave", C says "I am the Knave". Determine whether there is a unique solution.
[Marks: 06, CO: 3]
Method. A knight's every statement is true. A knave's every statement is
false. A spy is unconstrained. Each of A, B and C may be any of the three types
and the three types are all different, so there are only 3!=6 assignments to
test. Testing all six is exhaustive and cheap.
Rule stated first, because it settles part (ii) outright. Nobody can
truthfully say "I am the knave", because a knave is by definition not a knave.
Nobody can falsely say it either, because the statement would be true for a knave.
Therefore only a spy can say "I am the knave", and a knight or knave saying
it is an immediate contradiction.
(i) A says "C is the Knave." B says "A is the Knight." C says "I am the spy."
The three statements are true when, respectively, C is the knave, A is the
knight, and C is the spy.
Assignment
A's statement
B's statement
C's statement
Verdict
A=K, B=N, C=S
false (C is a spy, not a knave)
true
true
A is a knight but lies. Out.
A=K, B=S, C=N
true
true
false
Consistent.
A=N, B=K, C=S
false
false
true
B is a knight but lies. Out.
A=N, B=S, C=K
false
false
false
C is a knight but lies. Out.
A=S, B=K, C=N
true
false
false
B is a knight but lies. Out.
A=S, B=N, C=K
false
true
false
C is a knight but lies. Out.
Exactly one row survives, so the solution is unique:
(i) A = Knight, B = Spy, C = Knave
Verification. A, a knight, says C is the knave: true, since C is the
knave. B, a spy, says A is the knight: true, and a spy may tell the truth. C, a
knave, says "I am the spy": false, since C is the knave. All consistent.
(ii) A says "I am the Knave." B says "I am the Knave." C says "I am the Knave."
Assignment
A's statement
B's statement
C's statement
Verdict
A=K, B=N, C=S
false
true
false
A is a knight but lies. Out.
A=K, B=S, C=N
false
false
true
A is a knight but lies. Out.
A=N, B=K, C=S
true
false
false
A is a knave but tells the truth. Out.
A=N, B=S, C=K
true
false
false
A is a knave but tells the truth. Out.
A=S, B=K, C=N
false
false
true
B is a knight but lies. Out.
A=S, B=N, C=K
false
true
true
B is a knave but tells the truth. Out.
Every row is eliminated.
(ii) There is NO solution
Reason, without the table. From the rule above, "I am the knave" can only be
said by a spy. All three of A, B and C say it. Since exactly one of the three is
a spy, at least two are knights or knaves, and each of those contradicts what
they said.
(b) Determine whether the biconditionals are true or false: (i) 2+2=4 if and only if 1+1=2, (ii) 1+1=2 if and only if 2+3=4, (iii) 1+1=3 if and only if monkeys can fly, (iv) 0>1 if and only if 2>1.
[Marks: 04, CO: 1]
The biconditional P↔Q is true when P and Q have the
same truth value, that is when both are true or both are false.
P↔Q≡(P→Q)∧(Q→P)
(i) 2+2=4 if and only if 1+1=2
2+2=4 is true. 1+1=2 is true. Same value, so the biconditional holds.
(i) TRUE
(ii) 1+1=2 if and only if 2+3=4
1+1=2 is true. 2+3=5, not 4, so 2+3=4 is false. The values disagree.
(ii) FALSE
(iii) 1+1=3 if and only if monkeys can fly
1+1=3 is false. Monkeys cannot fly, so that is false as well. Both false, so
they match.
(iii) TRUE
(iv) 0>1 if and only if 2>1
0>1 is false. 2>1 is true. The values disagree.
(iv) FALSE
Question 7
(a) Suppose that a and b are integers, a≡11(mod19) and b≡3(mod19). Find the integer c with 0≤c≤18 such that (i) c≡7a+3b(mod19), (ii) c≡a3+4b3(mod19).
[Marks: 03, CO: 2]
Congruence behaves like equality under addition, subtraction and
multiplication, so every part is computed by substituting the residues and
reducing at the end.
(i) c≡7a+3b(mod19)
7a+3b≡7(11)+3(3)=77+9=86(mod19)
Divide: 86=19(4)+10.
c=10
(ii) c≡a3+4b3(mod19)
Reduce the powers first, which keeps the numbers small:
(b) Solve 3644mod645 using a well-known algorithm.
[Marks: 03, CO: 3]
The well-known algorithm is repeated squaring, also called the
square-and-multiply method. It exploits x2k=(xk)2, so each squaring
roughly doubles the exponent covered while the numbers stay small.
Step 1. Binary expansion of the exponent.
644=512+128+4=(1010000100)2
Step 2. Square repeatedly, reducing modulo 645 at every step.
The last nonzero remainder is 2, so gcd(414,662)=2.
Step 2. Extended part, back-substituting to find integers s,t with
414s+662t=2.
From the last division, 2=166−2×82. Substitute 82=248−166:
2=166−2(248−166)=3×166−2×248
Substitute 166=414−248:
2=3(414−248)−2×248=3×414−5×248
Substitute 248=662−414:
2=3×414−5(662−414)=8×414−5×662
Check.
8(414)−5(662)=3312−3310=2✓
gcd(414,662)=2,8(414)−5(662)=2
(d) Show that if a and b are positive integers then (2a−1)mod(2b−1)≡2amodb−1.
[Marks: 02, CO: 2]
Step 1. Write a=qb+r with q=⌊a/b⌋≥0 and
r=amodb, so 0≤r<b.
Step 2. Reduce the power.
2a−1=2qb+r−1=2r(2qb)−1
Step 3. Show 2b≡1(mod2b−1). This is immediate:
2b−1≡0(mod2b−1)⟹2b≡1(mod2b−1)
Hence any positive power of 2b is also congruent to 1:
2qb=(2b)q≡1q=1(mod2b−1)
Step 4. Substitute.
2a−1≡2r×1−1=2r−1(mod2b−1)
Since r=amodb:
(2a−1)mod(2b−1)≡2amodb−1
Step 5. The residue really is the least one. Since 0≤r<b we have
0≤2r−1<2b−1, so 2r−1 is the actual remainder and not merely a
congruent value. This is what makes the statement an equality of remainders rather
than only a congruence.
Question 8
(a) Define Fermat's little theorem. Use the construction in the proof of the Chinese remainder theorem to find all solutions to x≡2(mod3), x≡1(mod4), x≡3(mod5).
[Marks: 04, CO: 2]
Fermat's little theorem. If p is prime and gcd(a,p)=1, then
ap−1≡1(modp)
Equivalently ap≡a(modp) for every integer a, with no coprimality
condition needed. Worked cases: 22=4≡1(mod3), and
44=256≡1(mod5).
The CRT construction. For moduli n1,n2,…,nk that are pairwise
coprime, put N=n1n2⋯nk and
Mi=niN,ui=Mi−1(modni)
Then the solution to x≡ai(modni) for all i is
x=i=1∑kaiuiMi(modN)
Direct evaluation using the CRT construction formula.
Here a1=2,n1=3; a2=1,n2=4; a3=3,n3=5.
The moduli are pairwise coprime, with N=3×4×5=60.
M1=360=20.
We need u1≡M1−1(modn1), so 20u1≡1(mod3).
Since 20≡2(mod3), 2u1≡1⟹u1=2.
M2=460=15.
We need u2≡M2−1(modn2), so 15u2≡1(mod4).
Since 15≡3(mod4), 3u2≡1⟹u2=3.
M3=560=12.
We need u3≡M3−1(modn3), so 12u3≡1(mod5).
Since 12≡2(mod5), 2u3≡1⟹u3=3.
Alternative verification: combining two congruences at a time. Combine the first two,
x≡2(mod3) and x≡1(mod4). Write x=2+3k and substitute
into the second:
2+3k≡1(mod4)⟹3k≡−1≡3(mod4)
Since 3−1≡3(mod4), k≡3×3=9≡1(mod4). Hence
k=1+4m and
x=2+3(1+4m)=5+12m
Check:5mod3=2 ✓ and 5mod4=1 ✓.
Now impose the third, x≡3(mod5):
5+12m≡3(mod5)⟹12m≡−2≡3(mod5)
Since 12≡2(mod5) and 2−1≡3(mod5),
m≡3×3=9≡4(mod5)
Take m=4:
x=5+12(4)=53
x≡53(mod60)
Verify all three.
53mod3=2✓53mod4=1✓53mod5=3✓
Since N=3⋅4⋅5=60, the complete solution set is x=53+60k
for every integer k.
(b) There are four major auto routes from Boston to Detroit and six from Detroit to Los Angeles. How many major auto routes are there from Boston to Los Angeles via Detroit?
[Marks: 02, CO: 3]
Setting up. A route via Detroit is fully described by one choice from
Boston to Detroit and one choice from Detroit to Los Angeles. There is no
other freedom, and the order is fixed by the geography: Boston first, Detroit
second, Los Angeles third.
This is the product rule, also called the multiplication principle:
number of routes=4×6
24 routes
(c) Give a real-world example of generalized pigeonhole principle.
[Marks: 02, CO: 3]
The principle. If N objects are placed into k boxes and N>k, then at
least one box holds at least two objects. The generalized form: if
N>mk, then some box holds at least m+1 objects.
Real-world examples.
Birth months in a class. With 12 months, a class of 25 students guarantees
that at least 3 share a birth month, since 25>2×12=24. Here
m=2, k=12, and N=25 is the smallest class that forces a triple.
Socks from a drawer. A drawer holds only black and white socks. Drawing 5
socks guarantees at least 3 of one colour, since 5>2×2=4.
Hash tables. Storing n keys in m buckets forces a collision once
n>m. Keeping the load factor below 1, typically near 0.75, is what
guarantees headroom before collisions become frequent.
Servers. A cluster with r racks and 2r+1 machines must place at least
3 machines in one rack, since 2r+1>2×r.
More than mk objects in k boxes forces some box to hold m+1
(d) Let d be a positive integer. Show that among any group of d+1 (not necessarily consecutive) integers there are two with exactly the same remainder when they are divided by d.
[Marks: 02, CO: 3]
Proof.
Step 1. Count the possible remainders. For any integer a, the division
algorithm gives
a=qd+r,0≤r<d
Every integer therefore has exactly one of the residues 0,1,2,…,d−1.
There are exactly d possible remainders.
Step 2. Identify the boxes. Take the d+1 integers and let each box be one of
the d possible remainders, 0 through d−1. Place each integer in the box
named by its remainder.
Step 3. Apply the pigeonhole principle. There are d+1 integers placed into
d boxes, and d+1>d. By the pigeonhole principle, at least one box contains
two or more integers.
Step 4. Conclude. Two integers a1,a2 share a box, so they share a
remainder. Writing a1=q1d+r and a2=q2d+r and subtracting gives
a1−a2=(q1−q2)d
hence d divides a1−a2, which is exactly the statement that the two have the
same remainder on division by d.