NOTE Several of these problems refer back to problems in module 1. If you have not yet completed module 1 for any reason, we suggest you devote this week to completing module 1, and then complete this module later.
The purpose of this problem is to introduce some advantages of using a modelling language by taking a look at AMPL, which is a modelling language for linear programming (LP), including integer linear programming. With this language we can descibe an optimization problem in a convenient way. The basic elements are still the same: variables, objective function and constraints, but a richer syntax is offered to make it easy to describe and modify also large problems. When you have descibed your optimization problem in AMPL, the AMPL system can translate your description into a raw linear programming format suitable for input to standard optimization solvers. That is all it does.
Look at the following two source files which AMPL takes as input:
How many variables and constraints does the LP problem being defined in these two files have?
AMPL can give its output in several different formats. Here is the output produced by the above source files in MPS and LP formats, two standard formats for represeting LP problems:
Discuss and compare these alternatives:
Here are some links for detailed information and documentation about the systems and formats referred to in this question:
A much studied area in artificial intelligence has been knowledge representation, i.e. how to conveniently model facts, rules and procedures that are more complicated than what can be stored in an ordinary database, and which are maybe not so trivial to program from scratch. In this problem we will look at some small examples of rule based expert systems written for the CLIPS expert system tool.
The purpose of this problem is to show how knowledge can be encoded in a rule based expert system, where the basic idea is to encode knowledge as a set of IF.. THEN.. production rules.
Look at this example source file for CLIPS. Try to understand as much you can of the file, and summarize your findings. How did the makers of CLIPS solve this problem: How do you model knowledge (facts and rules) in a form that can be processed by computer?
When thinking about this problem, consider the following questions in order of importance:
Here is a sample transcript (input and output) of a session with CLIPS using this source file:
CLIPS> (run) The Engine Diagnosis Expert System Does the engine start (yes/no)? yes Does the engine run normally (yes/no)? no Is the engine sluggish (yes/no)? yes Suggested Repair: Clean the fuel line.
Here are some links for more information about CLIPS:
This problem goes into more depth with the issues discussed in the Bicycle Braking Problem in module 1, in particular part (a) of that problem.
Assume that we wish to model life expectancy based on a database of 1000 randomly selected deceased people. For each individual 50 different attributes have been collected such as certain diseases, diseases of ancestors, weight, length, living habits, education, type of work, living location etc. The question is about finding a function predicting the life expectancy of an arbitrary person.
This problem sheds a little more light on the purpose of the "surprise" function from the first module. Recall the formula for the amount of information we receive when we learn that something with probability p has happened. (If you do not recall this formula, please ask a supervisor.)
We are reading a binary file, one bit at a time. Suppose that, each time, the probability that the next bit is a one is p1, and the probability that it is a zero is p0 = 1-p1. Let I(p1) be the expected (average) amount of information carried by a bit in the file.
Find a formula for I(p1). What is the value of this function for p1 = 0.0, 0.1, 0.5, 0.9, 1.0? Plot the function.
Person A wants to avoid person B, who insists on meeting A at lunchtime. At the university there are two restaurants, a regular one (dining time 20 min), and a fancy one (dining time 50 min). For simplicity, we assume that, at 12.00 each day, A and B each choose a restaurant and go to lunch; they never choose not to eat, and they do not change their choice of restaurant that day.
What strategy should A use to choose a restaurant in order to minimize the time spent with B? What strategy should B use to maximize the amount of time spent with A? If they both choose the optimal strategy, how much time do they spend together per day on average?
Hint: Spend some time thinking about the problem intuitively before you start trying to solve it mathematically.