53.8 KB · commit a9602da
| title | ECE 2213 · Class Test Answers, Explained |
|---|
RUET · ECE Dept · B.Sc. Engineering 2nd Year
The same 19 answers as CT_answers_exam_style.md, with the reasoning shown.
This layer may address you directly, explain at length, and say why a step is
hard. Every number is identical to the exam-style file, character for character,
and the exam-style file is where each one is authored.
Modeling, truncation and round-off errors · bisection and regula falsi
[Marks: not printed in source]
Let us start from the actual engineering problem, because "develop a model" sounds like a formality and is not. The company cannot put thermocouples inside a running reactor, so it wants software that predicts T(t) from what it can measure. The first question is therefore not which formula but what is being approximated, and the honest answer has two halves: the software approximates a model, and the model approximates the reactor. Those are two separate approximations with two separate error budgets, and a question that asks for both a model and its assumptions is asking you to keep them apart.
Step 1: the balance. Energy in minus energy out equals energy stored. For a well-mixed reactor of mass m and specific heat C:
CdtdT=Q(t)−hA(T−Ta(t))
Four terms, and each one is a modelling decision rather than a fact:
Step 2: what the software actually computes. The question says the software evaluates the exponential with the first four non-zero Taylor terms. For z=(T−Ta)/Ta,
ez≈1+z+2!z2+3!z3
with remainder 4!z4eξ for some ξ between 0 and z.
Step 3: check the model before trusting the software. Set dT/dt=0:
Tss=Ta+hAQ
and read off the time constant τ=C/hA. The model therefore predicts one exponential approach, no overshoot, no second stage. That is a testable prediction, and it is the most useful thing on this page: if the real reactor overshoots or responds in two stages, a model is wrong, and no amount of precision in the exponential will fix it.
The six assumptions, each with what breaks it:
| # | Assumption | If it is wrong |
|---|---|---|
| 1 | Well mixed, one state variable | A measurable internal gradient appears; a distributed model is needed |
| 2 | C, h, A constant | For a gas C varies with T; a fouled surface loses h over time |
| 3 | Q(t) known | A changing composition makes the heat release uncertain, and it feeds the model directly |
| 4 | Linear heat loss, hA(T−Ta) | Radiation scales as T4 and is omitted entirely |
| 5 | Ambient measured, not predicted | No weather term, so no weather error in the model |
| 6 | Sensors and stirring negligible | Safe only for a large, slowly driven vessel |
Assumption 4 is the one that bites here, and it is worth understanding why. We kept a term linear in T and discarded one proportional to T4. At T=300 those are comparable in order of magnitude; at T=600 the discarded term is many times the kept one. So the model is not slightly wrong at high temperature, it is qualitatively wrong, and the software is being asked to be accurate about a quantity that is itself inaccurate. This is the deepest point in the question and the one most answers miss.
[Marks: not printed in source]
The machine stores 5 significant decimal digits. Every error below is live in that regime.
The framing that makes this a good answer. "At least three sources" invites a list, and a list is what most answers give. The stronger answer classifies them, because the classification tells you which ones you can fix. Two of the four kinds below are reduced by working harder and two are made worse by it, and a candidate who knows that can say something a list cannot.
1. Truncation error from the Taylor series. Discarding terms past z3/3! leaves 4!z4eξ. This is a systematic error: one sign, the same on every cycle, and it does not average away over repeated runs. It grows like z4, so for a reactor running well above ambient it dominates. Because it truncates from above, the software reads slightly low.
2. Round-off error from 5-digit storage. Every operation is performed to five figures and the rest discarded. This is random in sign, so over many simulations it partly cancels; accumulated size grows like n for n independent roundings, and like n in the worst case where every rounding is biased the same way. Magnitude is about 10−5 relative per operation.
3. Catastrophic cancellation. This is the one that is specifically a function of the problem, not the method, and it deserves more than a line. When z is small, ez is close to 1, so computing it as 1+z+z2/2+z3/6 subtracts almost as much as it adds. Watch the partial sums at z=0.1:
| partial sum | value | digits gained | digits already lost |
|---|---|---|---|
| 1 | 1.000000 | 0 | 0 |
| 1+0.1 | 1.100000 | 0 | 0 |
| +0.005 | 1.105000 | 1 | 1 |
| +0.0001667 | 1.105167 | 3 | 3 |
The answer is 1.105170, correct to six figures, but the leading digit was destroyed in the first addition and never recovered. The relative error is amplified by roughly 1/(1−e−z) times machine epsilon, which at z=0.1 is about a factor of ten. The general rule: cancellation is dangerous exactly when the answer is small compared to the intermediate quantities, and ez≈1 is the standard example.
4. Truncation error from the time-stepping. Whatever scheme advances T in time replaces an integral by a finite sum, with error ∝hp for order p. The subtle part: with h too large, the discrete solution settles at a different steady state from the continuous one. That is a modelling error wearing a numerical disguise, and it is why the step size is not a free parameter.
5. Input and measurement error. Q, h, A, Ta all carry error, and the sensitivity to hA is the sharpest: an error ϵ in h shifts the steady state by roughly ϵQ/(hA)2.
6. Accumulation across repeated simulations. If each cycle starts from the previous cycle's rounded output, errors compound rather than resetting. One computation at 5 digits is fine; ten thousand chained ones are not.
Lagrange and Newton's forward/backward interpolation
[Marks: not printed in source]
| Distance (km) | 2 | 4 | 7 | 10 |
|---|---|---|---|---|
| Concentration (mg/L) | 18 | 26 | 43 | 60 |
Why Lagrange is the right tool here, before any arithmetic. Look at the node spacing: 2,4,7,10, with gaps of 2,3,3. They are not an arithmetic progression. Newton's forward and backward formulas in their standard forms both require equal spacing, because they are built on a difference table whose first column is constant. Lagrange needs no such thing. The method choice is forced by the data, and saying so is part of the answer.
The formula.
P(x)=i=0∑nyiLi(x),Li(x)=j=i∏xi−xjx−xj
Each Li is 1 at its own node and 0 at every other, which is exactly why the interpolant passes through all four points.
The four basis values at x=5.
L0(5)=(2−4)(2−7)(2−10)(5−4)(5−7)(5−10)=(−2)(−5)(−8)(1)(−2)(−5)=−8010=−81
L1(5)=(4−2)(4−7)(4−10)(5−2)(5−7)(5−10)=(2)(−3)(−6)(3)(−2)(−5)=3630=65
L2(5)=(7−2)(7−4)(7−10)(5−2)(5−4)(5−10)=(5)(3)(−3)(3)(1)(−5)=−45−15=31
L3(5)=(10−2)(10−4)(10−7)(5−2)(5−4)(5−7)=(8)(6)(3)(3)(1)(−2)=144−6=−241
The estimate.
P(5)=18(−81)+26(65)+43(31)+60(−241)
=−2.25+21.6667+14.3333−2.5
C(5)=31.25 mg/L
Second route, and it is worth doing in an exam. Newton's divided-difference form uses the same four points through a completely different algorithm:
| order | divided differences |
|---|---|
| 0 | 18,26,43,60 |
| 1 | 4,317,317 |
| 2 | 31,0 |
| 3 | −241 |
so P(x)=18+4(x−2)+31(x−2)(x−4)−241(x−2)(x−4)(x−7), and at x=5:
P(5)=18+4(3)+31(3)(1)−241(3)(1)(−2)=18+12+1+0.25=31.25
Same value by a different arrangement, so neither route's arithmetic is responsible for it. Note also that the order-3 coefficient −241 is L3's numerator-independent constant, which is a good sign the two agree structurally and not just numerically.
What the polynomial actually is. Expanding:
P(x)=−241x3+87x2−121x+15
Two observations that belong in a good answer. First, x=5 lies inside [2,10], so this is interpolation, not extrapolation, and the value carries the data's own reliability rather than an extrapolation risk. Second, the cubic is mild: the concentration curve is concave, and a cubic tracks a concave curve without the wild oscillation that high-degree interpolation produces on unevenly spaced nodes. Unequal spacing is exactly where high-degree Lagrange turns dangerous, and at degree 3 there is no room for trouble.
[Marks: not printed in source]
| Time (hours) | 0 | 2 | 4 | 6 | 8 |
|---|---|---|---|---|---|
| Temperature (°C) | 24 | 27 | 31 | 36 | 42 |
The difference table, with h=2:
| order | values |
|---|---|
| y | 24, 27, 31, 36, 42 |
| Δy | 3, 4, 5, 6 |
| Δ2y | 1, 1, 1 |
| Δ3y | 0, 0 |
| Δ4y | 0 |
At 1.5 hours, Newton's forward formula. 1.5 is near the start of the table, so measure forward from x0=0:
p=hx−x0=21.5=0.75
y=y0+pΔy0+2!p(p−1)Δ2y0+3!p(p−1)(p−2)Δ3y0
=24+(0.75)(3)+2(0.75)(−0.25)(1)+0
=24+2.25−0.09375
T(1.5)=26.15625≈26.16 ∘C
Note the middle term is negative, because 0<p<1 makes (p−1) negative. That is correct and it surprises people: the curve is concave up, but at p between 0 and 1 the forward series subtracts to place the point below the linear interpolation of the endpoints. Linear interpolation would give 24+0.75(3)=26.25; the true value is slightly lower.
At 7 hours, Newton's backward formula. 7 is near the end, so measure backward from xn=8:
p=hx−xn=27−8=−0.5
y=yn+p∇yn+2!p(p+1)∇2yn+3!p(p+1)(p+2)∇3yn
=42+(−0.5)(6)+2(−0.5)(0.5)(1)+0
=42−3−0.125
T(7)=38.875≈38.88 ∘C
Third route: the exact quadratic. Since the third differences vanish, fit the quadratic directly. With y=a+bx+cx2 and h=2, Δ2y=2ch2 so c=81; then y(2)=27 gives b=45, and y(0)=24 gives a=24:
P(x)=8x2+45x+24
P(1.5)=82.25+1.875+24=0.28125+1.875+24=32837=26.15625✓
P(7)=849+435+24=6.125+8.75+24=8311=38.875✓
Three routes, all exact, all agreeing.
Gauss-Seidel iteration and Runge-Kutta methods
[Marks: not printed in source]
4x+y+z=7,x+5y+2z=−8,2x+y+6z=6
The rearrangement. Solve each equation for its own diagonal unknown:
x=47−y−z,y=5−8−x−2z,z=66−2x−y
That is the mechanical step. The interesting step is the check that follows.
Check that the system suits the method. Compare each diagonal entry against the sum of the off-diagonal entries in its own row:
∣4∣>1+1=2,∣5∣>1+2=3,∣6∣>2+1=3
Every row is strictly diagonally dominant. Strict dominance in every row is the sufficient condition for Gauss-Seidel to converge from any starting vector, so this system is set up for the method and no reordering can improve it. Also detA=101=0, so the solution is unique and iteration has something to converge to.
The Gauss-Seidel form, written so the ordering is visible.
x(k+1)=47−y(k)−z(k)
y(k+1)=5−8−x(k+1)−2z(k)
z(k+1)=66−2x(k+1)−y(k+1)
The superscripts are the entire content of the method. x uses the old y and z; y uses the new x and the old z; z uses the new x and the new y. The two (k+1) superscripts on the right of the second and third equations are precisely the difference from Jacobi, where every right-hand side would read (k).
[Marks: not printed in source]
Iteration 1, from (0,0,0):
x1=47−0−0=1.75
y1=5−8−1.75−2(0)=5−9.75=−1.95
z1=66−2(1.75)−(−1.95)=66−3.5+1.95=64.45=0.741667
Iteration 2:
x2=47−(−1.95)−0.741667=47+1.95−0.741667=48.208333=2.052083
y2=5−8−2.052083−2(0.741667)=5−8−2.052083−1.483333=5−11.535417=−2.307083
z2=66−2(2.052083)−(−2.307083)=66−4.104167+2.307083=64.202917=0.700486
Iteration 3:
x3=47−(−2.307083)−0.700486=47+2.307083−0.700486=48.606597=2.151649
y3=5−8−2.151649−2(0.700486)=5−8−2.151649−1.400972=5−11.552621=−2.310524
z3=66−2(2.151649)−(−2.310524)=66−4.303299+2.310524=64.007225=0.667871
Iteration 4:
x4=47−(−2.310524)−0.667871=47+2.310524−0.667871=48.642653=2.160663
y4=5−8−2.160663−2(0.667871)=5−8−2.160663−1.335742=5−11.496405=−2.299281
z4=66−2(2.160663)−(−2.299281)=66−4.321326+2.299281=63.977955=0.662992
The four iterations.
| k | x | y | z |
|---|---|---|---|
| 1 | 1.750000 | -1.950000 | 0.741667 |
| 2 | 2.052083 | -2.307083 | 0.700486 |
| 3 | 2.151649 | -2.310524 | 0.667871 |
| 4 | 2.160663 | -2.299281 | 0.662992 |
(x4,y4,z4)=(2.160663, −2.299281, 0.662992)
[Marks: not printed in source]
The absolute errors are the differences between consecutive iterates:
∣x4−x3∣=∣2.160663−2.151649∣=0.009014
∣y4−y3∣=∣−2.299281−(−2.310524)∣=0.011243
∣z4−z3∣=∣0.662992−0.667871∣=0.004879
∣Δx∣=0.009014,∣Δy∣=0.011243,∣Δz∣=0.004879
Why the question says between iterations. This is a precise phrase and it is asking for the approximate error, which is the difference of consecutive iterates. That is not the error in the answer:
| x | y | z | |
|---|---|---|---|
| approximate, ∣x4−x3∣ | 0.009014 | 0.011243 | 0.004879 |
| true, ∣x4−xexact∣ | 0.002247 | 0.002251 | 0.000374 |
| relative approximate | 0.42% | 0.49% | 0.74% |
Both numbers are legitimate. The question asks for the first, and answering with the second is a real and common error, so it is worth being able to state which is which without hesitating. The approximate error bounds nothing; it only describes the progress of the last sweep. On a slowly converging system the two can differ by an order of magnitude.
[Marks: not printed in source]
dxdy=x2−y,y(0)=1,f(x,y)=x2−y
Which RK2, and why this one. "RK2" names a family, not a method. The convention in this course, taken from the past papers, is Heun's method: a slope at the start of the step, a slope at the predicted end point, averaged.
k1=f(xn,yn),k2=f(xn+h, yn+hk1)
yn+1=yn+2h(k1+k2)
The three arrangements and what they give on this problem are tabulated below. Naming which one you used is part of a correct answer.
Step 1: x0=0 to x1=0.2, with y0=1.
Predictor slope:
k1=02−1=−1
Predicted value at the end of the step:
y1∗=y0+hk1=1+0.2(−1)=0.8
Corrector slope, evaluated at the predicted end point:
k2=(0+0.2)2−(1+0.2(−1))=0.04−0.8=−0.76
Update:
y1=1+20.2(−1+(−0.76))=1+0.1(−1.76)=1−0.176
y(0.2)≈0.8240
Step 2: x1=0.2 to x2=0.4, with y1=0.824.
k1=(0.2)2−0.824=0.04−0.824=−0.784
y2∗=0.824+0.2(−0.784)=0.824−0.1568=0.6672
k2=(0.2+0.2)2−0.6672=0.16−0.6672=−0.5072
y2=0.824+20.2(−0.784+(−0.5072))=0.824+0.1(−1.2912)=0.824−0.12912
y(0.4)≈0.6949
The results.
| x | y |
|---|---|
| 0.0 | 1.0000 |
| 0.2 | 0.8240 |
| 0.4 | 0.6949 |
Two different error behaviours, and keeping them apart is the point.
| effect | how to test it | result here |
|---|---|---|
| truncation grows as x advances along the interval | compare e(0.2) with e(0.4) | 0.002731→0.005200 |
| truncation falls as h shrinks | halve h and compare at the same x | ratios 4.15 and 4.16 |
The second row is the convergence-order test, and it must be done at a fixed x. Halving to h=0.1 gives y(0.2)=0.821928 and y(0.4)=0.690931, with errors 0.000658 and 0.001251, so
0.0006580.002731=4.15,0.0012510.005200=4.16
4≈22 is the second-order signature. The ratios are 4.15 rather than exactly 4 because a third-order term still survives at the coarser step: at h=0.2 it is roughly a quarter of the second-order contribution. That is a feature, not an error, and it tells you the asymptotic regime has not quite been reached.
The three arrangements side by side, since "RK2" is a family and the constants genuinely differ:
| arrangement | y(0.2) | y(0.4) | error at 0.2 |
|---|---|---|---|
| Heun | 0.824000 | 0.694880 | +0.002731 |
| midpoint | 0.822000 | 0.691240 | +0.000731 |
| Ralston | 0.820148 | 0.687469 | −0.001121 |
The midpoint method takes k2=f(xn+2h, yn+2hk1) and yn+1=yn+hk2, with no averaging; Ralston weights 1/3 and 2/3. All three are second order, so all three converge at the same rate, and their constants differ. Heun is the course convention and the most accurate of the three on this problem, which is an observation about this problem and not a general claim.
[Marks: not printed in source]
dxdy=x2−y,y(0)=1,h=0.2
The four-stage formula.
k1=f(xn,yn),k2=f(xn+2h, yn+2hk1)
k3=f(xn+2h, yn+2hk2),k4=f(xn+h,yn+hk3)
yn+1=yn+6h(k1+2k2+2k3+k4)
Step 1: x0=0, y0=1, h=0.2.
k1=02−1=−1
k2=(0.1)2−(1+0.1(−1))=0.01−0.9=−0.89
k3=(0.1)2−(1+0.1(−0.89))=0.01−0.911=−0.901
k4=(0.2)2−(1+0.2(−0.901))=0.04−0.8198=−0.7798
y1=1+60.2(−1+2(−0.89)+2(−0.901)+(−0.7798))
=1+60.2(−1−1.78−1.802−0.7798)=1+60.2(−5.3618)
=1−0.178727
y(0.2)≈0.8213(RK4)
The comparison.
| method | y(0.2) | absolute error against 0.821269 |
|---|---|---|
| exact | 0.821269 | 0 (reference) |
| RK4, h=0.2 | 0.821273 | 0.000004 |
| RK2 Heun, h=0.2 | 0.824000 | 0.002731 |
| Euler, h=0.2 | 0.800000 | 0.021269 |
RK4 error≈4×10−6,RK2 error≈2.73×10−3
Euler's row is included for a reason: 0.800000 is the predictor RK2 discards, and the gap from the exact solution, 0.021269, is about eight times RK2's own error. That ratio is the share of the work the corrector is doing, which is a useful way to say why a two-stage method beats Euler by an order of magnitude rather than a small percentage.
Propositional logic, tautology, equivalence and requirements
[Marks: not printed in source]
Write the antecedent and conclusion separately first. This one line of notation is what makes the table readable:
A=(p→q)∧(q→r),C=p→r,E=A→C
And reduce it, so the table is a formality rather than a struggle. Using P→Q≡¬P∨Q:
E=¬[(p→q)∧(q→r)]∨(p→r)=¬(p→q)∨¬(q→r)∨(p→r)
which expands to ¬(¬p∨q)∨¬(¬q∨r)∨(¬p∨r) and then to
E=(p∧¬q)∨(q∧¬r)∨(¬p∨r)
For E to be false, all three disjuncts must be false. That requires p∧¬q, which needs q false, and q∧¬r, which needs q true. A contradiction. So E can never be false, which is exactly what the table below then shows row by row.
The complete truth table.
| p | q | r | p→q | q→r | A=(p→q)∧(q→r) | p→r | E=A→C |
|---|---|---|---|---|---|---|---|
| T | T | T | T | T | T | T | T |
| T | T | F | T | F | F | F | T |
| T | F | T | F | T | F | T | T |
| T | F | F | F | T | F | F | T |
| F | T | T | T | T | T | T | T |
| F | T | F | T | F | F | T | T |
| F | F | T | T | T | T | T | T |
| F | F | F | T | T | T | T | T |
E is true in all 8 rows, so [(p→q)∧(q→r)]→(p→r) is a tautology
What the table is actually showing. The interesting column is A. It is false in rows 2, 3, 4 and 6, and in each of those the implication A→C is vacuously true regardless of C.
That observation collapses the work. The only rows where E could fail are those with A true and C false, and A is true in just four of the eight: rows 1, 5, 7 and 8. In all four, p→q and q→r both hold, and those together force p→r. So the table settles the question in four rows rather than eight, and the reduction is visible rather than assumed.
[Marks: not printed in source]
"A student can start the examination if and only if the student is authenticated and the examination server is available."
Let p: authenticated, q: server available, r: can start the examination.
r↔(p∧q)
The connective is fixed by one word. "if and only if" is a biconditional, ↔, and p∧q is its whole right-hand side. So the requirement says both:
(p∧q)→randr→(p∧q)
Reading it as the one-way implication (p∧q)→r states only half the requirement, and permits a student to start the examination who is not authenticated. That is precisely what the sentence forbids, so the half-reading is not a simplification, it is a different and weaker specification.
The complete truth table.
| p | q | r | p∧q | r↔(p∧q) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | F |
| T | F | T | F | F |
| T | F | F | F | T |
| F | T | T | F | F |
| F | T | F | F | T |
| F | F | T | F | F |
| F | F | F | F | T |
r↔(p∧q) is true in 4 of 8 rows, so it is contingent
It is not a tautology: rows 2, 3 and 5 are false. Nor is it a contradiction: rows 1, 4, 6 and 8 are true. A statement permitting four assignments is contingent, and that is the honest classification. Contingent is the right answer here, and the classification matters more than the table: a requirement that is a tautology constrains nothing, and one that is a contradiction is unsatisfiable, so only "contingent" describes a specification that is both restrictive and implementable.
[Marks: not printed in source]
Start from r↔(p∧q) and replace the biconditional by its two implications:
r↔(p∧q)≡[(p∧q)→r]∧[r→(p∧q)]
Replace each implication by P→Q≡¬P∨Q:
≡[¬(p∧q)∨r]∧[¬r∨(p∧q)]
Apply De Morgan's law ¬(p∧q)≡¬p∨¬q to the first bracket:
[(¬p∨¬q)∨r]∧[¬r∨(p∧q)]
≡(¬p∨¬q∨r)∧(¬r∨p∧q)
which uses only ¬, ∨ and ∧, as required.
Every step with the law named at it, which is what earns the marks:
r↔(p∧q)≡[(p∧q)→r]∧[r→(p∧q)]≡[¬(p∧q)∨r]∧[¬r∨(p∧q)]≡[(¬p∨¬q)∨r]∧[¬r∨(p∧q)]≡(¬p∨¬q∨r)∧(¬r∨p∧q)biconditional as two implicationsP→Q≡¬P∨QDe Morganassociativity of ∨[Marks: not printed in source]
The resulting expression is F=(¬p∨¬q∨r)∧(¬r∨p∧q). Build it one column at a time, which is the only way to be sure each row is right.
| p | q | r | ¬p | ¬q | ¬r | p∧q | ¬p∨¬q∨r | ¬r∨p∧q | F |
|---|---|---|---|---|---|---|---|---|---|
| T | T | T | F | F | F | T | T | T | T |
| T | T | F | F | F | T | T | F | T | F |
| T | F | T | F | T | F | F | T | F | F |
| T | F | F | F | T | T | F | T | T | T |
| F | T | T | T | F | F | F | T | F | F |
| F | T | F | T | F | T | F | T | T | T |
| F | F | T | T | T | F | F | T | F | F |
| F | F | F | T | T | T | F | T | T | T |
F is true in rows 1, 4, 6, 8 and false in rows 2, 3, 5, 7
F is contingent: it is not a tautology and not a contradiction
[Marks: not printed in source]
Let p: the sensor is active, q: the controller receives data.
Statement 1. "If the sensor is active, then the controller receives data."
S1=p→q
Statement 2. "The controller does not receive data unless the sensor is active."
This is the hard one, and it is where this part is actually tested.
The word "unless" has a precise reading. "B unless A" means if not A, then B, which is ¬A→B, and equivalently A∨B. Here A = the sensor is active, p; B = the controller receives data, q. So
S2=¬p→q≡p∨q≡q→p
Statement 3. "The sensor is active if and only if the controller receives data."
S3=p↔q
[Marks: not printed in source]
C=S1∧S2∧S3=(p→q)∧(q→p)∧(p↔q)
Replace the biconditional by its two implications:
C=(p→q)∧(q→p)∧(p→q)∧(q→p)
and since the first pair already contains both directions,
C=(p→q)∧(q→p)
C=(¬p∨q)∧(¬q∨p)
C=(¬p∨q)∧(¬q∨p)≡(p∧q)∨(¬p∧¬q)
The last line is the distributive form, and it is the useful one: the conjunction is false in every row where exactly one of p,q is true, and true only where they agree.
[Marks: not printed in source]
| p | q | p→q | q→p | S3=p↔q | C=S1∧S2∧S3 |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | F | F | T | F | F |
| F | T | T | F | F | F |
| F | F | T | T | T | T |
C is true in rows 1 and 4, so it is contingent
C is equivalent to p↔q
The two true rows are the two consistent states.
Row 1: the sensor is active and the controller receives data. The system is working as intended.
Row 4: the sensor is inactive and the controller receives nothing. The sensor is off, so nothing should arrive, and nothing does.
Rows 2 and 3 are the failure modes: an active sensor with no data, which is a dead or disconnected sensor, and an inactive sensor with data, which means data is arriving from a sensor the system believes is off. The second is the dangerous one, since the controller would then be acting on data it should treat as impossible.
[Marks: not printed in source]
Reading the C column, the conjunction is true in rows 1 and 4 only:
| assignment | p | q | meaning | satisfies all three |
|---|---|---|---|---|
| 1 | T | T | sensor active, controller receives data | yes |
| 4 | F | F | sensor inactive, controller receives nothing | yes |
The specification is satisfiable, and the satisfying assignments are exactly (p,q)=(T,T) and (F,F)
Equivalently: the requirements hold if and only if p=q
That no other assignment works. Row 2, p=T,q=F, fails statement 2, since data does arrive while the sensor is inactive. Row 3, p=F,q=T, fails statement 1, since data arrives with no active sensor. Those are the only rows excluded, and they are excluded by different statements, which is what makes the exclusion complete.
Every figure here is character identical to the one in CT_answers_exam_style.md,
and was derived twice by independent routes. Where the routes disagreed, the
disagreement was settled before the answer was written: CT-02B Q.2(a)'s
y(0.2) was wrong in an early draft, with a boxed value that contradicted the
line above it, and was corrected against the closed form
y=x2−2x+2−e−x. See ANSWER_BUILD_PLAN.md §32.2.*