A treatment simulation starts at concentration C0=128 mg/LC_0=128\ \text{mg/L}C0=128 mg/L. Its supplied discrete model is
Each update represents 10.0 min10.0\ \text{min}10.0 min. The algorithm checks the initial state, then checks after every update, and returns the first sampling time at which concentration is at most 60.0 mg/L60.0\ \text{mg/L}60.0 mg/L. It allows at most five updates. What elapsed time does it return? Answer in minutes, to one decimal place. Do not interpolate between sampling times.
Unlock full course notes by signing up
Classifying a loop exit correctly
A cooling algorithm initializes T=92 ∘CT=92\ ^\circ\text{C}T=92 ∘C and k=0k=0k=0. It allows at most three updates, each representing 5.0 min5.0\ \text{min}5.0 min, using the supplied model
with temperatures expressed in degrees Celsius. While both T>29 ∘CT>29\ ^\circ\text{C}T>29 ∘C and k<3k<3k<3 hold, it updates TTT and then increases kkk by one. On leaving the loop, it currently reports SUCCESS if k<3k<3k<3 and LIMIT otherwise.
Building expected results for batch tests
An engineering laboratory is developing an algorithm that summarizes a batch of temperature readings. Its specification requires it to:
Accept readings from −10 to 50 °C, inclusive, and ignore readings outside that interval.
Report the arithmetic mean of the accepted readings when at least one reading is accepted.
Developing a constrained selection procedure
An engineering selection tool receives a finite list of operating modes. Each mode has a unique positive integer identifier, airflow, electrical power, and predicted motor temperature. Treat all supplied values as exact model outputs. The input rows may arrive in any order.
A mode is feasible when airflow is at least 0.050 m3/s0.050\ \text{m}^3/\text{s}0.050 m3/s and motor temperature is at most 70 ∘C70\ ^\circ\text{C}70 ∘C. Among feasible modes, select the one with the smallest electrical power. If powers tie, select the smaller identifier. Return NONE if no mode is feasible.
Describe a procedure that works for any permitted input list, apply it to this table, and explain why it terminates and returns the required mode. Give one additional test for inclusive boundaries and one additional test for the NONE outcome. No programming language is required.
Designing within an arithmetic-operation budget
A temperature logger must report a rolling mean of its latest eight readings. It produces its first result after reading eight and another result after every subsequent reading. All readings are valid.
Two algorithm designs produce the same results:
Recompute: for each result, start a total at zero and add all eight readings in the current group.