Math for - Nested Control Constructs

  1. A 3D printer builds an object in layers. Each layer consists of a rectangular grid of material. The object has 8 layers. Each layer is a grid of $15 \times 20$ deposition points. How many total deposition points are there in the entire object?

  2. A sensor system monitors environmental conditions for a sensitive experiment. An alarm triggers if:
    (Condition A: Temperature is outside the range $20^\circ C$ to $25^\circ C$ inclusive)
    OR
    (Condition B: Humidity is above $60\%$ AND Pressure is below $950 \text{ hPa}$).
    Determine if the alarm triggers for the following readings (True for alarm, False for no alarm):

    1. Reading 1: Temp = $22^\circ C$, Humidity = $55\%$, Pressure = $1000 \text{ hPa}$

    2. Reading 2: Temp = $18^\circ C$, Humidity = $50\%$, Pressure = $980 \text{ hPa}$

    3. Reading 3: Temp = $24^\circ C$, Humidity = $65\%$, Pressure = $940 \text{ hPa}$

    4. Reading 4: Temp = $26^\circ C$, Humidity = $62\%$, Pressure = $960 \text{ hPa}$

  3. Calculate the value of the sum $S = \sum_{m=1}^{3} \left( \sum_{n=1}^{2} (m \cdot n + m) \right)$.

  4. A manufacturing process creates pairs of gears $(G_A, G_B)$. Gear $G_A$ can have $a$ teeth, where $a \in \{10, 20, 30\}$. Gear $G_B$ can have $b$ teeth, where $b \in \{15, 25, 35, 45\}$. A pair is considered compatible if the sum of teeth $a+b < 55$.

  5. A robot follows a path-finding algorithm. It generates sequential coordinate pairs $(x, y)$. The process starts with $x=1$. For each $x$, $y$ increments from $1$ up to $x$. The robot generates a point $(x,y)$ and then checks a condition: if $x \times y > 10$, the process stops immediately, and that point $(x,y)$ is NOT counted. The overall process for $x$ considers integer values $x=1, 2, 3, 4$.