Due Date:
07/01
1.
Objectives
Completing
all tasks in this assignment will help you learn about the process of algorithm
development. In this assignment, we expect you to do the following:
·
Follow
all instructions
·
Write clear algorithms without too
much or too little information (we know this may be your first attempt)
·
Write your first computer program
·
Read the next section carefully and
understand why Step 4 is the most important
First skim, and then carefully read the entire assignment before starting any
tasks.
2.
How
To Solve Them
This is not a question, so much as an outline for how
you should solve problems in this course—and everywhere else. Read and absorb.
The following is adapted from "How
to Solve It" by G. Polya, 2nd ed.,
1. UNDERSTANDING THE PROBLEM
2. DEVISING A PLAN
3. CARRYING OUT THE PLAN
4. Looking Back
3.
A
Friendly Martian
As it turns
out, there is intelligent life on Mars, and some of them want to visit us here
on Earth. You are on the phone with a
Martian who knows nothing about life on Earth, and you are trying to help him
prepare to interact with humans. How
would you explain which direction left was?
Describe a procedure for doing so.
Submit your answer in a Word document
called HW1.doc. Label it Question 1 in boldface.
1.
Maze
of Torment
This example
is based on mazes, like the ones you may have played with on paper when you
were a child. Given a random starting location
in any maze, is there an algorithm that you could follow that would guarantee that you would find your way
out of the maze in a finite amount of time?
Spend some time thinking about this.
If you can think of an algorithm, write it out
clearly and concisely. Explain why it
works.
If you don’t think an algorithm exists, explain why
you think so.
Label this as Question 2.
2.
Savings
Account
Suppose you open a savings account at a bank in
B(t) = 100ert
Where e is
the exponential function.
Create an m-file called balance.m. In it, write a program that asks the user how
long she has had this savings account and outputs what her current balance is.
Use your program to compute the balance after 1, 2,
and 7.5 years.
Hint: Use the help and lookfor
functions to find the Matlab function for the exponential function.
At
the top of balance.m, put your name, student ID, and the date. At the bottom, put your results from
computing the balance. Print a copy of the m-file and submit it with HW1.doc
3.
Submitting
Your Work
Type your
name, student ID, and the date at the top of HW1.doc. Print the document and sign it along with balance.m. Staple them together and
give the signed assignment to the teaching assistant.