# 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="https://393762053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFqoUXVrYie7Ht7Fi4JrU%2Fuploads%2FMskyay5Nz9TqCZveguDc%2FScreenshot%20K4jccwjF%402x.png?alt=media&#x26;token=ddb79f63-39a0-47d0-b9f7-be75505f0d83" 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>
