Course list http://www.c-jump.com/bcc/
The topic of this week is understanding algorithms. Start by reading Chapter 10 of the textbook, "Algorithmic Thinking."
Read the following definitions of the algorithm:
My favorite definition is the one by Stephen Kleene :
"...what we do is describe a procedure, performable for each set of values of the independent variables, which procedure necessarily terminates and in such manner that from the outcome we can read a definite answer..." (1943)
Given:
Magnets and hand-written notes on my refrigerator door hold data about businesses and people, primarily their phone numbers.
I need to check my house for an electrical problem in one of the rooms.
My plumber told me that if I reference his company to an electrician in the area, I should get a discount between 30 and 60% on the first visit by an electrician to my house.
Using all of the above as known facts, write a pseudocode and draw a algorithmic chart diagram to solve the following problem:
How can I get my electrical problem fixed at the lowest possible cost?
Other known things:
There is a landline phone in the house and it is okay to make local calls.
There is a pencil and paper near the phone and it's okay to make notes. It is also okay to use those notes later as "known facts" and input data.
It is absolutely crucial to have your pseudocode and the diagram specifying the necessary steps at the highest possible level of detail.
Keep in mind that if your pseudocode instructions were given to a robot or a computer, they should be able to successfully solve the problem. (Remember, though, that the task at hand is not fixing the actual electrical system, but rather getting an electrician to visit -- simply because they have a license to do the job -- otherwise I would consider fixing it myself with a screwdriver...)
Try the following format. For example, pseudocode for ordering pizza could look like this:
ALGORITHMIC SOLUTION FOR ORDERING PIZZA
----------------------------------------------------------------------------------
Step# Input data Processing Output and decisions
----- ----------------- ----------------------------- ----------------------------
1. Walk to the fridge door
2. Door magnets Locate pizza shop info If found, continue to step 3
and sticker If not found, go to
notes step 11 :-(
3. Phone number Call pizza shop
4. Do they deliver? If yes, continue to step 5
If no - go back to step 2
5. My name and Order pizza Confirmation number
address
6. Wallet Reserve cash for payment Cash
7. Wait for delivery
8. Door bell Open the door
9. Cash Make payment + tips Pizza!!
10. Pizza Eat and watch TV
11. Done!
If you read my pizza ordering plan carefully, you may seriously disagree with the decisions I make and steps that I take. But this is why we have lots of algorithm implementations in the world, and no single solution exists for many of them. At the same time, not every algorithm has to be perfect if it works. It's okay to be sceptical and keep improving, but at some point we must give it a realistic try...
Please have your name and BCC course number specified at the top of your document. Also, please write a paragraph or two regarding your biggest challenges or difficulties while working on this problem. Your feedback is important and can easily yield some additional points on the grade!
Submit by email to your instructor: Igor Kholodov Igor.Kholodov@bristolcc.edu
Attach your document with pseudocode to the email and send it with the proper email subject line:
CIT122 Homework 1 Lastname, Firstname
where Lastname, Firstname is your last and first name.
Submitting algorithmic chart diagram is optional, but it can give you some nice extra points toward your final grade. Use any drawing software you like, for example, Microsoft Excel Diagrams. You could make a drawing on paper and then take a picture of it. I am looking for a very casual expression of algorithmic thinking -- not a formal methodical chart.
As a general rule, your email must contain your last name (mandatory!) and first name (or at least the first name initial.)