2-Webster

# 2-Webster - Computational modeling of Websters problem Comp...

This preview shows pages 1–9. Sign up to view the full content.

Computational modeling of Webster’s problem Comp 140 Fall 2009

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
26 August 2009 (c) Devika Subramanian, 2009 The “word problem” The devil made a proposition to Daniel Webster. The devil proposed paying Daniel for services in the following way:"On the first day, I will pay you \$1,000 early in the morning. At the end of the day, you must pay me a commission of \$100. At the end of the day, we will both determine your next day's salary and my commission. I will double what you have earned at the end of the day, but you must double the amount that you pay me. Will you work for me for a month?" 2
26 August 2009 (c) Devika Subramanian, 2009 Abstraction and automation 3 Answer Relevant input Algorithm Recipe Construction Recipe Execution (i.e., the cooking) First we, as humans, design a recipe. Then we get the machine to cook it.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
26 August 2009 (c) Devika Subramanian, 2009 Abstraction Identifying the right level at which to model/think about the problem What is to be computed? What are the givens? What is the recipe for computing what we need from the givens? How do we precisely state the recipe to a machine? Creative process, requires human ingenuity and thought 4 Answer Relevant input Algorithm (mathematical description of recipe) Word Problem ABSTRACTION
26 August 2009 (c) Devika Subramanian, 2009 Automation Communicating a precise recipe to a machine. Computational mapping of recipe to data structures and control flow supported by a programming language. Translating the mathematical recipe into a program using the chosen computational mapping. 5 Algorithm/recipe (mathematical representation) Program AUTOMATION

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
26 August 2009 (c) Devika Subramanian, 2009 The purpose of the computation Should Webster take the devil’s deal or not? We compute to find the answer to this yes/no question. Questions of this form have a name in computer science, they are called decision problems . 6
26 August 2009 (c) Devika Subramanian, 2009 Modeling: extracting the relevant pieces of information Not all details in the real-world word problem may be necessary for getting to an answer. What is the essence of the problem, i.e. what is the relevant information? How do we express the essence, the abstraction, in an unambiguous, well-defined manner? 7

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
26 August 2009 (c) Devika Subramanian, 2009 What are the “givens”? How the game starts Webster gets a salary of 1000 on day 0. The devil’s commission at the end of day 0 is 100. How the game works (from day 0 on) Webster gets a salary at the start of the day. At the end of the day, Webster’s take is his salary minus the commission he pays the devil. The following day, Webster’s salary is double his take from the previous day. The following day, the devil’s commission is twice what he got the previous day.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/26/2010 for the course COMP 140 taught by Professor Devika during the Spring '10 term at Rice.

### Page1 / 55

2-Webster - Computational modeling of Websters problem Comp...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online