Case Study
Case Study
Answer: b) The total penalty for all queens threatening each other
8. What is added to negative fitness values during selection to avoid zero probabilities?
a) A random number
b) The most negative value + 1
c) The maximum fitness value
d) A fixed threshold
Answer: c) Crossover
Answer: c) 70%
Answer: a) Diversity
Answer: a) 1%
16. What is the total penalty for a solution where no queens threaten each other?
a) 0
b) 8
c) 16
d) -8
Answer: a) 0
Answer: d) In pairs
True/False Questions
21. The 8 Queens Problem requires that no two queens threaten each other.
True
22. Fitness values are always positive in GAs.
False
27. In the 8 Queens Problem, fitness is maximized when the penalty is minimized.
True
33. The algorithm stops when the maximum number of generations is reached.
True
34. The penalty of a solution is calculated by summing the penalties for all queens.
True
36. The fitness function determines which individuals are most likely to survive.
True
37. Mutation can occur multiple times within the same individual.
True
39. The 8 Queens Problem can be solved by a single generation in some cases.
True
44. In GAs, solutions with lower fitness have a higher chance of selection.
False
47. The 8 Queens Problem requires exactly 8 rows and 8 columns for the board.
True
50. Optimal solutions in GAs have a fitness value of 0 in the 8 Queens Problem.
True
Multiple-Choice Questions
21. What does the fitness function aim to achieve in the 8 Queens Problem?
a) Maximize the penalty
b) Minimize the penalty
c) Randomize queen positions
d) Ensure all queens are in the same row
23. Which value of fitness indicates an optimal solution in the 8 Queens Problem?
a) -1
b) 0
c) 8
d) 64
Answer: b) 0
24. What is the role of probabilities in the selection process?
a) To evaluate penalties
b) To determine mutation rate
c) To ensure fitter solutions are more likely to be selected
d) To decide the crossover point
Answer: b) Ensuring the best solutions are retained in the next generation
28. How many parents are typically needed for a single crossover?
a) 1
b) 2
c) 3
d) 4
Answer: b) 2
29. Which of the following is NOT a step in the Genetic Algorithm process?
a) Initialization
b) Fitness calculation
c) Backpropagation
d) Mutation
Answer: c) Backpropagation
30. How does the GA handle negative fitness values during selection?
a) It ignores them
b) It multiplies them by -1
c) It adds a constant to make them positive
d) It uses their absolute values
33. What is the output of the calc_fitness() function in the 8 Queens Problem?
a) A list of penalties for each queen
b) The optimal solution
c) Fitness values for all solutions in the population
d) The next generation population
35. What is the default structure for a population in the 8 Queens Problem?
a) A single 8x8 matrix
b) An Nx8 array where N is the population size
c) A binary string for each solution
d) A list of fitness values
36. Which algorithm step ensures exploration of new areas in the solution space?
a) Fitness calculation
b) Crossover
c) Mutation
d) Selection
Answer: c) Mutation
Answer: b) Heuristic
43. What is the primary advantage of using GAs for the 8 Queens Problem?
a) It guarantees the global optimum
b) It is faster than all other methods
c) It efficiently explores large solution spaces
d) It requires no coding
Answer: b) 0
45. Why should the population size (N) in GAs be even?
a) To simplify mutation
b) To ensure pairs of parents for crossover
c) To avoid negative fitness values
d) To minimize runtime
Answer: b) 7
49. What happens when a fitness value is -10, and the minimum fitness value in the population is -18?
a) The fitness is normalized to 10
b) It is converted to a positive value by adding 19
c) The fitness is ignored
d) The solution is removed from the population