Table of Contents

03 Search III, Adversarial I

How to efficiently go towards a goal. How to search when someone is playing against us.

Learning outcomes

After this lab session, a student

Program

  1. Q/A
  2. Homework assignement (quiz, search)
  3. Recursive factorial implementation and analysis.
  4. Recursive Fibonacci numbers generator.
  5. Exercises: Intro to recursion in game playing.
  6. Learning about Reversi.

Factorial

Implement recursive computation of $f(n) = n!$

Guidelines

Call visualisation:

Fibonacci Sequence

Program the recursive calculation of the Fibonacci sequence: $f(n) = f(n-1) + f(n-2)$.

Analyze the number of function calls and plunge depths.

Call visualisation:

Demo code:

Exercise I / Solving together

How to to optimize the number of trials by throwing eggs from a building!

Exercise II / Solving together

Gold coins! Mine! How to maximize rewards and scam your colleagues thanks to “game theory”, “democracy”, and weight lifting!

Reversi: 2nd assigment

Bonus quiz: heuristics

Homework