Week 10 - Searching for a solution to Twiddle
Last week we looked at the very introduction of "Intelligent Search" - that is, how to search for a solution to a problem.
In the activities for this week we will review this material and introduce a game called Twiddle that will be our domain for searching for solutions.
Lesson Videos (50 minutes)
Note, while some of this week is repetition of last week, I think this is GOOD. I think it may help.
- Complexity Analysis of Queues (10 minutes)
- This is another video from several years ago and it starts by referring to a discussion with the students at the face to face meetup. Don't worry about that.
- This video revisits the Queue ADT from week 8 and has what I think is a worthwhile discussion about why I feel the Queue code that Miller and Ranum gave us in their textbook is "backwards." This is a great review of Big-Oh notation and addresses design issues.
- The code I showed during the video
- BFS and DFS recap (25 minutes. Recap of last week, but I think it is worth your time)
- Introducing Twiddle (7 minutes)
- Twiddle Children question (2 minutes)
- Twiddle Children answer (3 minutes)
- Twiddle Children assignment (2 minutes)
Paired Activity
- Get together with a partner.
- Go to Replit and find the Activity "Twiddle part 1"
- In the main.py file that is in that activity:
- complete the body of the function called children()
- that takes in a single, length 9 string as a parameter
- and returns a list of 8 strings.
- Each of these should be one of the children of the original parameter twiddle board.
- For example:
- Another example:
When you think you have it you can test that I agree with you by running schafersTester() which is provided in the main.py file at the bottom.