Nepedia
Back to Discover
Independent Reader
💻

Deterministic algorithm

technology Maturity 11-13 Next article →

A deterministic algorithm is a set of steps for a computer. If you give it the same input, it always gives the same output. It follows a set path. The machine goes through the same states every time. A state is what a machine does at one moment. In this type of algorithm, each state tells the machine its next step. This makes the whole path easy to plan.

Sometimes, programs are not deterministic. This is called non-deterministic. This can happen if a person types something new. It can also happen if a timer goes off. If a machine has many parts working at once, the order might change. This can change the final result. Even a tiny error in the hardware can change things.

Most computer programs try to be deterministic. This makes them easier for people to understand. But some programs must be different. A card game needs to be unpredictable. If the steps are always the same, players could guess the cards. This would let them cheat. In those cases, computers use random tools to keep things a surprise.

183 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.