> For the complete documentation index, see [llms.txt](https://primer.ought.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://primer.ought.org/chapters/action-selection/iterative-action-selection.md).

# Iterative action selection

For non-trivial questions it’s generally not enough to take a single cognitive action. For example, consider:

```
What is the log10 of the number of people living in the US vs China?
```

Ideally we’d first look up the populations, then compute the logarithms.

Alas, this chapter hasn’t been written yet.

## Exercise

Implement iterative action selection. If you need inspiration, take a look at this execution trace:

<figure><img src="/files/hRf1eQX3hH5HmBVJSyhR" alt=""><figcaption><p>Execution trace (<a href="https://ice.ought.org/traces/01GE0XYTCPNZN5MKQ23TNJV53B">view online</a>)</p></figcaption></figure>

For even more inspiration, take a look at [sequential\_action.py](https://github.com/oughtinc/ice/blob/main/ice/recipes/primer/sequential_action.py) in the ICE repository.

<details>

<summary>Get feedback on exercise solutions</summary>

If you want feedback on your exercise solutions, submit them through [this form](https://docs.google.com/forms/d/e/1FAIpQLSdNNHeQAT7GIzn4tdsVYCkrVEPMNaZmBFkZCAJdvTvLzUAnzQ/viewform). We—the team at Ought—are happy to give our quick take on whether you missed any interesting ideas.

</details>
