Trial and error
Trial and error is an iterative problem-solving or learning process that tests alternatives, observes their outcomes, and uses feedback to guide subsequent actions.
Grokking AI Algorithms, Second Edition
Trial and error is a problem-solving technique that tests alternative attempts and uses their outcomes to identify a successful solution.
- How it is used
- Frames learning and search as repeated attempts guided by observed outcomes.
- How deep it goes
- Defines the technique through behavioral examples and a maze comparison, but stops short of implementing a search algorithm.
- Examples
- Uses chicks identifying food, chimpanzees choosing sticks, dog training, and competing paths through a maze.
- What you can do after
- Evaluate alternative actions by observing rewards, penalties, success, failure, and effort.
Read how Grokking AI Algorithms, Second Edition explains trial and error →
Evolutionary Deep Learning: Genetic algorithms and neural networks
Trial-and-error learning is a strategy that discovers effective actions by repeatedly testing alternatives and retaining those that produce favorable outcomes.
- How it is used
- Uses repeated environment interaction to solve reinforcement-learning problems when correct actions are discovered through rewards.
- How deep it goes
- Explains states, actions, rewards, exploration, Q-values, and training loops, but stops short of advanced planning mechanisms.
- Examples
- Demonstrates a Frozen Lake grid, Q-table, epsilon-greedy action selection, training episodes, and agent exercises.
- What you can do after
- Apply it via OpenAI Gym by building, training, and exercising a Q-learning agent in a discrete environment.
Also covered in
- Robotics for ProgrammersIn early access (MEAP)
- Reinforcement Learning from Human Feedback
- Writing for Developers: Blogs that get read
What to know first
- machine learningMachine learning is a field of computational methods in which systems learn patterns or relationships from data to make predictions, decisions, or other outputs.
Related concepts
- reinforcement learningused by · Reinforcement learning is a machine-learning paradigm in which an agent learns behavior or a decision policy through interaction with an environment and evaluative feedback, such as rewards.
- model architectureuses · Model architecture is the structural organization of a computational model's components, connections, and operations that determines how it processes inputs and produces outputs.
- robot system lifecycleused by · A robot system lifecycle is the sequence of phases through which a robot solution is designed, developed, deployed, operated, maintained, and evaluated.
- natural selectionused by · Natural selection is the evolutionary process by which heritable traits affecting survival or reproduction influence which variants become more common in a population.
Questions about trial and error
What is trial and error?
Trial and error is an iterative problem-solving or learning process that tests alternatives, observes their outcomes, and uses feedback to guide subsequent actions.
Which Manning books explain trial and error?
Grokking AI Algorithms, Second Edition and Evolutionary Deep Learning: Genetic algorithms and neural networks.
What should I know before learning trial and error?
Manning books that teach trial and error usually introduce machine learning first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

