<a id="ch-13"></a>

## Chapter 13 — An empty MISSING loop still ran

<!-- open-cyber-academy:lesson-figures:start ch-13 -->
### Lesson map

Lesson 13. Map, example, EX059.

```mermaid
flowchart TD
  B["baseline minus today"] --> E["Empty set"]
  E --> L["The MISSING loop runs"]
  L --> Z["Zero lines"]
  Z --> Q{"Were OneDrive, AudioService, PrinterHelper removed?"}
  Q -->|No| K["They are still in today"]
```

No MISSING line is a result. It is not a loop that was skipped.

### Logical drawing

```text
still in both sets
  OneDrive
  AudioService
  PrinterHelper
baseline minus today
  empty
printed under MISSING
  nothing
```
<!-- open-cyber-academy:lesson-figures:end ch-13 -->

### Learning outcomes

After this chapter, you should be able to:

1. Name the three baseline programs that remain.
2. Explain an empty difference.
3. Refuse an invented MISSING line.

### 13.1 The second loop prints once per leftover name. There are none.

After the NEW lines, the script walks `sorted(baseline - today)` and prints `MISSING:` plus the name. `baseline - today` holds names that were in the saved set and are absent from `today`. OneDrive, AudioService, and PrinterHelper are members of both sets, so that difference is empty. `sorted` of an empty set is an empty sequence. The loop body never runs, and the page shows no MISSING line.

An empty result is still information. Some harmful programs disable or replace a normal startup name. Priya's note records that none of the three baseline names was removed. She gets that from the absence, not from a sentence the script failed to emit. Adding a fake MISSING line "for completeness" would claim a removal that the sets contradict.

The length line agrees. Baseline length 3 and today length 5, with two names added and zero names removed, is 3 + 2 - 0 = 5. That check uses only the sets. It does not require a clock, and it does not require opening either new program.

| Set fact | Print |
|---|---|
| Name in both sets | No MISSING line |
| Name only in `today` | A NEW line |
| Name only in `baseline` | A MISSING line, and this run has none |
| An invented removal | Not supported |

### 13.2 Worked example

| Offered reading | What the sets support | Decision |
|---|---|---|
| Three baseline names remain | They are members of `today` | Keep |
| The MISSING loop printed nothing | The difference is empty | Keep |
| "PrinterHelper was replaced." | It is still in `today` | Refuse |
| "Add MISSING: none so the page looks finished." | That word is not a member | Refuse |

> **Synthetic case.** The baseline three are still present.

### Errors and limits

Do not fill an empty difference with a comforting extra line.

### Apply

- **EX059 — Empty difference.** Why is there no MISSING line, and which baseline names remain? *Rubric:* 3 = OneDrive, AudioService, and PrinterHelper are still in `today`; the difference is empty; the loop ran and printed nothing;; 2 = the three names remain and nothing was missing;; 1 = one name;; 0 = none.

<!-- open-cyber-academy:chapter-navigation:start ch-13 -->
### Continue studying — lesson 13 (chapter 13 of 20)

[← Chapter 12](#ch-12) · [Course chapter index](../SUBJECTS.md) · [Chapter 14 →](#ch-14)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex059"></a>
**EX059.** OneDrive, AudioService, and PrinterHelper are still in `today`. The difference is empty, so the MISSING loop prints nothing.
