9 Evolutionary And Reinforcement Learning

Artificial Intelligence · Unit 9

Evolutionary and Reinforcement Learning

Exam-focused notes for Evolutionary and Reinforcement Learning (Artificial Intelligence, BIT252): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

Evolutionary and Reinforcement Learning in short

Some learning methods copy nature or experience instead of fitting a formula. This chapter covers genetic algorithms, reinforcement learning with rewards, and learning by analogy.

Evolutionary and Reinforcement Learning: notes

Genetic algorithm operators

A genetic algorithm (GA) is a search method inspired by natural selection. It keeps a population of candidate solutions. Each solution is a chromosome, often a string of bits. A fitness function scores how good each chromosome is.

The main operators are:

  • Selection (reproduction): picks fitter chromosomes as parents. Methods are roulette wheel, tournament, and rank selection.
  • Crossover: swaps parts of two parents to make children. In single-point crossover, a cut point is chosen and the tails are exchanged.
  • Mutation: flips a bit at random with a small probability. It brings new material and avoids getting stuck.

Crossover example. Parents 01101 and 11000, cut after the fourth bit:

Parent 1: 0110 | 1      Child 1: 0110 | 0
Parent 2: 1100 | 0      Child 2: 1100 | 1

Mutation example. Flip the third bit of 01100 to get 01000.

Other crossovers are two-point and uniform crossover. Elitism copies the best chromosomes unchanged into the next generation.

What this unit covers

  • Genetic algorithm operators
  • Genetic algorithm learning process
  • Reinforcement learning
  • Rewards and punishment in learning
  • Learning by analogy

Genetic algorithm learning process

2082 · 5 marks

How learning by genetic algorithm is performed? [5]

A Genetic Algorithm (GA) is a search and optimization technique inspired by the process of natural selection and biological evolution. In machine learning, GAs are used to evolve solutions (hypotheses) over generations to find the best-fit model for a given problem. --- Component Description ----...

Open this answer on its own page →

Genetic algorithm operators

2080 · 5 marks

How does Genetic algorithm work? Explain. [5]

A Genetic Algorithm (GA) is a search and optimization technique inspired by the process of natural selection and biological evolution. It works by evolving a population of candidate solutions over successive generations to find an optimal or near-optimal solution. --- Term Meaning ---------------...

Open this answer on its own page →

0 · 5 marks

Describe the different operators used in genetic algorithm. [5]

--- Genetic Algorithms use three primary operators to evolve a population of candidate solutions toward an optimal solution. These operators mimic the process of natural evolution. --- Purpose: Selects individuals (chromosomes) from the current population to act as parents for the next generation...

Open this answer on its own page →

Learning by analogy

2079 · 5 marks

Describe the concept of learning by analogy with an example. [5]

Learning by analogy is a type of machine learning in which a system acquires new knowledge or skills by recognizing structural or functional similarities between a new, unfamiliar problem (target domain) and a previously known problem (source domain). The system transfers and adapts existing know...

Open this answer on its own page →

Rewards and punishment in learning

2080.2 · 5 marks

What is the role of rewards and punishment in reinforcement learning? Describe with an example. [5]

Show solved answer

Role of Rewards and Punishment in Reinforcement Learning

What is Reinforcement Learning?

Reinforcement Learning (RL) is a type of machine learning where an agent learns to make decisions by interacting with an environment. The agent learns through trial and error, guided by feedback in the form of rewards and punishments.


Role of Rewards

A reward is a positive numerical signal given to the agent when it performs a desirable action. It tells the agent: "This was a good move, do more of this."

Role of rewards:

  • Encourages the agent to repeat beneficial actions
  • Guides the agent toward the goal state
  • Increases the probability of selecting the same action in similar future states
  • Helps the agent learn an optimal policy (best strategy)

Role of Punishment (Negative Reward / Penalty)

A punishment is a negative numerical signal given when the agent performs an undesirable action. It tells the agent: "This was a bad move, avoid this."

Role of punishment:

  • Discourages the agent from repeating harmful or incorrect actions
  • Helps the agent avoid dangerous or unproductive states
  • Speeds up learning by narrowing down the action space

Core Objective

The agent's goal is to maximize the cumulative reward (total reward over time), formally expressed as:

$$G_t = r_{t+1} + \gamma r_{t+2} + \gamma^2 r_{t+3} + \cdots$$

Where:

  • $G_t$ = total cumulative reward from time step $t$
  • $r$ = reward at each step
  • $\gamma$ = discount factor (0 to 1), which reduces the weight of future rewards

Example: Training a Robot to Navigate a Maze

Consider a robot agent placed in a maze that must find the exit.

SituationActionFeedback
Robot moves toward the exitCorrect step+10 reward
Robot hits a wallWrong move-5 punishment
Robot falls into a pitDangerous move-20 punishment
Robot reaches the exitGoal achieved+100 reward

Learning Process:

  1. Initially, the robot moves randomly.
  2. When it hits a wall, it receives -5, so it learns to avoid walls.
  3. When it moves toward the exit, it receives +10, so it repeats that direction.
  4. Over many episodes, the robot learns the optimal path to the exit by maximizing total reward.

Summary

ConceptSignalEffect on Agent
RewardPositive (+)Reinforces good behavior
PunishmentNegative (-)Discourages bad behavior
GoalMaximize cumulative rewardLearns optimal policy

In essence, rewards and punishments together act as a feedback mechanism that shapes the agent's behavior over time, enabling it to learn complex tasks without explicit programming.

Open this answer on its own page →