Problem Set 7 - Due Thu Oct 15 at 23:59

1. Slides and notebooks from:
2. Lab 10 on recursion, and lab 11 on fruitful recursion.
3. Think Python, Ch. 5, Sections 5.8–5.10 on recursion, and Think Python, Ch. 6, Sections 6.5–6.9 on fruitful recursion.

This problem set will challenge your understanding of recursion, including fruitful recursion.

• Task 0: Survey — Please fill out this anonymous survey to help us improve this course and learn more about how our teaching strategies worked or didn't work.

• Task 1: Recursive Trees — Use Turtle to draw trees similar to those from problem set 3, but this time using only a single recursive function. Then create a fruitful recursive tree function that counts the number of leaves it has. You may complete EITHER this task or task 2, but you don't have to complete both. For this problem, having a partner is optional but recommended.

• Task 2: Branching Notes — Create recursive music, including random recursive music which uses fruitful recursion to return the duration of the note pattern that it produces. You may complete EITHER this task or task 1, but you don't have to complete both. For this problem, having a partner is optional but recommended.

• Task 3: Genetic Sequences — Use fruitful recursion to write some functions that process strings representing DNA sequences. For this problem, having a partner is optional but recommended.

If you want to find a partner to work with for this problem set, use this Piazza post to do so (we will mark old requests as closed when each new problem set is posted).

Note that you may not work with different partners on different tasks in this problem set. If you are working with a partner on one task, you must either work individually or work with that same partner on any other tasks where a partner is allowed.

Notes

• Each task has a rubric which you should use as a checklist to determine whether you have completed the task.

• Reminder: Collaboration and honor code: you can talk with other individuals and teams about high-level problem-solving strategies, but you cannot share any code with them (unless you are working together on a partner problem).

• If you are not going to be able to get everything done before the deadline, you may take a 24-hour extension on this problem set, no questions asked. To do so, you must click the "Take extension" button for this problem set in the Ocean Server before the deadline has passed. If it is close to the deadline and you don't know if you'll make it in time, consider taking the extension now, and then turn in your work. If you take an extension you will not receive feedback until the extended deadline has passed; note that the deadline for revisions does not change when you take an extension, so this gives you less time to revise your work.

• The CS111 Problem Set Guide gives an overview of psets, including a detailed description of individual and partner tasks.

• Follow the practices discussed in our CS111 Code Style Guide.

• All code for this assignment is available in the `ps07` folder in the `cs111/download` directory within your `cs` server account.

Time Estimate

To help you plan how long you need to spend on this problem set, we have some guidelines based on how long students spent on these tasks last semester (please fill out your time estimates to help students in future semesters).

When you've been working on a task for about 4 hours, you should evaluate whether you are making efficient progress, and make use of some of the class resources available to you, like help-room hours or office hours. If you've been working on one task for 7 hours and still have a ways to go, you should definitely get some help with it.

The entire problem set will probably take you something like 8–14 hours of programming, plus another half hour to hour of reading, although some students take more or less time than that.

The instructions for each task and their specific requirements are laid out on the following pages:

How to turn in this Problem Set

• For task 1, each team member must save their final `tree.py` file in their `ps07` folder. It is not sufficient for your teammate to submit this task, you must both submit it independently, or you will not get credit. If you worked with a partner on this problem, this file should contain a comment with both of your names and usernames at the top, in addition to the submission date.
• For task 2, each team member must save their final `branchingNotes.py` file in their `ps07` folder. It is not sufficient for your teammate to submit this task, you must both submit it independently, or you will not get credit. If you worked with a partner on this problem, this file should contain a comment with both of your names and usernames at the top, in addition to the submission date.
• For task 3, each team member must save their final `genetics.py` file in their `ps07` folder. It is not sufficient for your teammate to submit this task, you must both submit it independently, or you will not get credit. If you worked with a partner on this problem, this file should contain a comment with both of your names and usernames at the top, in addition to the submission date.

• Note: It is critical that the name of the folder you submit is `ps07`, and your submitted files are named exactly as specified above. In other words, do not rename the folder that you downloaded, do not create new files or folders, and do not delete or re-name any of the existing files in this folder. We have automated scripts to check your electronic submission: an improperly named folder will not count as a valid submission.

• Drop your entire `ps07` folder in your `drop` folder on the `cs` server using Cyberduck by the deadline (Thu Oct 15 at 23:59). This will serve as a back-up submission mechanism, in case there are issues with the new web submission site. It is required for every problem set.