---
tags: mth225, weekly-challenge
---
# MTH 225: Weekly Challenge 7
**Due on Blackboard by 11:59pm Eastern on Sunday 11/7.**
:::warning
**Instructions**:
* Your work on Weekly Challenges should consist of **complete solution attempts for all the Application/Extension Problems and complete and thoughtful responses to all the Feedback and Reflection prompts**. Before submitting your work, make sure you've reviewed the [Specifications for Satisfactory Work in MTH 225](/Cy6P0rGZQzuOM3NwZ3ZuMw) document to make sure your work meets the standards to the best of your knowledge.
* **Practice Exercises are optional.** You do not need to turn any part of these in. But if you want feedback on any of them, turn those in with the rest of your work and I'll look at it.
* You may type up your work or write it by hand on paper, whiteboard, or in a notes app. **Typewritten work is preferred** because it makes revisions easier for you.
* If you handwrite your work on paper or a whiteboard, your work needs to be **scanned to a legible, black-and-white PDF**.
* **If you do problem 4, it must go in a Jupyter notebook** so the code can be tested without copy/pasting.
* All your work is to be submitted as a **single PDF** at the appropriate assignment area on Blackboard in the *Weekly Challenges* folder. Please do not submit multiple PDFs, or files that are not in PDF format.
:::
## Practice Exercises
**Practice Exercises are optional and for your benefit only.** You do not need to turn in work or answers unless you want feedback on your work.
:::info
This week, since we've covered no new material in the last few days, instead of giving you new Practice Exercises **please go back and look at earlier Weekly Challenges and their practice exercises.** Start with [MTH 225: Weekly Challege 6](/OK7bar-SSTauVp4JU-oW5A) and work your way backwards. **I will give feedback on any practice exercise from an earlier Weekly Challenge that you submit.** Just be sure to indicate where it's coming from.
:::
## Application/Extension Problems
Choose **any two (2) of the following four problems** to work. *Do not submit work on more than two of these.*
1. This problem returns to an idea we started discussing in class two weeks ago but never got around to finishing: How to count the number of anagrams of a word that contains duplicate letters. Remember an "anagram" of a word is just a rearrangement of the letters in the word.
a) How many anagrams are there of the word "grand"? Show your work and answer, and explain your reasoning. **Attain your answer by using a counting argument, not by just listing the anagrams out using brute force.**
b) How many anagrams are there of the word "valley"? Show your work and answer, and explain your reasoning. Again, use a counting argument and not brute force.
c) How many anagrams are there of the word "anagram"? Show your work and answer, and explain your reasoning. Again, use a counting argument and not brute force.
d) How many anagrams are there of the word "tattooist"? Show your work and answer, and explain your reasoning. Again, use a counting argument and not brute force.
e) Now it's time to generalize. If you are given a word that is $n$ letters long, with some of the letters repeated, how would you go about finding the number of anagrams of that word? Give a **precise, complete, and correct** algorithm for doing so. By "algorithm" we mean a detailed set of instructions on how to take the input (in this case, the word) and produce the output (in this case, the number of anagrams). Your algorithm should be a complete set of instructions that a reader can use to make this calculation given any word whatsoever. **Don't be vague.** Your algorithm should almost be computer code in its precision and specificity --- think of it as computer code for humans. *Your work will be evaluated by me (Talbert) taking a random word and seeing if I can follow your algorithm step by step and attain a correct result*.
2. a) How many positive integers less than 1000000 have exactly one digit equal to 9? (Once such integer would be 109. But 199 would *not* be an example because there are two 9's, not exactly one.)
b) How many positive integers less than 1000000 have exactly one digit equal to 9, *and* have a sum of digits equal to 13? (For example, the sum of the digits of the number 793 is 19, so this would *not* be counted even though it has exactly one 9.)
3. a) How many ways are there to put six professors into four identical offices? Assume that you can leave some offices empty, and it's OK to put more than one professor in the same office. (In fact, note that it's impossible in this situation to avoid putting more than one professor in the same office because of the Pigeonhole Principle.)
b) How many ways are there to put six professors into four identical offices so that none of the offices is empty?
4. Write a Python function called `distribute` that accepts two natural numbers `a` and `b` as input, and returns the number of ways to distribute $a$ identical objects to $b$ different bins. Here are some sample inputs and outputs, to show you two correct computations as well as to demonstrate what the function should look like when used:
```
> distribute(5,5)
> 126
> distribute(10,8)
> 19448
```
For this problem: You may assume that the user always inputs natural numbers. (So you don't need to include code that checks for correct input types.) If your function returns floating point numbers instead of integers (for example 126.0 instead of 126) that's OK. **Here are some requirements for your work:**
- Your function must be an actual Python function, with a `def` statement in the first line and not just a block of code. And it must be called `distribute` -- you may not name it something else.
- As always, your function must compile properly when run --- no syntax errors should happen when you run it. **Test your code out first** to avoid this.
- Your function must use `return`, not `print`, to return the result.
- You may not use libraries outside the standard library; the function must execute and produce results without having to load anything extra. In particular, you may not use any function from `math`, `scipy`, or `numpy`.
- You must include *not only* code, **but also an explanation** that explains what your code does and why it will always produce the correct result. *Do not put this explanation in your code as comments* but instead **put the code in a code block in a Jupyter notebook and the explanation in a Markdown cell separate from the code.**
## Feedback and Reflection
This week instead of doing the usual questions, please answer the questions on this survey:
https://docs.google.com/forms/d/e/1FAIpQLSdUVPIZSGFtIJJ52LvEtkK78mTqLp6aj3jkhWlOrUe6wsOXlQ/viewform

:::info Welcome to MTH 201! I'm Dr. Robert Talbert, Professor of Mathematics, and I am grateful that you are signed up for the course and am looking forward to working with you this semester. ::: What's MTH 201 all about? MTH 201 is a first course in Calculus, which is all about modeling and understanding change. Change is maybe the most important facet of the world around us, and we care about it more than we realize. For example, we care a lot about the number of Covid-19 cases in our community, but we might care even more about how fast the number of cases is changing (either up or down). In MTH 201, you'll learn the mathematical language of change and apply it to models that you build to draw conclusions, make predictions, and give meaningful answers to real problems. MTH 201 goes beyond just computation. In MTH 201, you'll build skills with understanding complex concepts, communicating those concepts and the meaning of your results to appropriate audiences, using professional tools to help you in your work, and practice working with others to improve your learning (and theirs). These are valuable skills no matter where you go next. Success in this course doesn't come easy, and you can expect to be pushed and stretched intellectually. But the struggle you experience is normal and healthy, a sign of growth and that you are doing things the right way. And you will receive tireless support from me and your classmates in the process. Above all, my top priority is to support you in your work and help you succeed.

11/11/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview Our final miniproject reaches back into linear algebra to look at diagonalizable matrices and their uses in solving systems of differential equations. Prerequisites: You'll need to be able to solve basic systems of differential equations and find the eigenvalues and eigenvectors for a small matrix. You'll also need a basic comfort level with concepts of linear independence and matrix arithmetic from earlier in the course. Background This entire problem comes from Section 3.9.1 in your textbook. Here is a rephrased version of the introduction to that section.

3/29/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview This miniproject will teach you about the Runge-Kutta method, a standard numerical solution technique for differential equations. Prerequisites: A strong grasp of Euler's Method for single DE's is needed. You will also need to be comfortable using a spreadsheet. Miniproject 6 (Euler's Method for systems) is also recommended. Background A description of the Runge-Kutta method along with an example is given in this tutorial. Read it carefully and make sure you can work along with the example before proceeding.

3/29/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview This miniproject introduces a version of Euler's Method as a numerical solution technique for systems. Prerequisites: You will need to be comfortable with using Euler's method for single differential equations. You'll also benefit from some familiarity with spreadsheets or Python in order to automate the calculations. Background This tutorial gives you the background you need for this assignment. Please read it and make sure you understand the concepts and the example: https://github.com/RobertTalbert/linalg-diffeq/blob/main/assignments/Euler's_Method_for_Systems.ipynb

3/22/2023
Published on ** HackMD**