Docsity

Exam Artificial Intelligence 2, Exams of Artificial Intelligence

Partial preview of the text

Download Exam Artificial Intelligence 2 and more Exams Artificial Intelligence in PDF only on Docsity!

Name:

Birth Date:

Matriculation Number:

Exam

Articial Intelligence 2

August 11., 2020

To be used for grading, do not write here

prob. 1.1 1.2 1.3 2.1 2.2 2.3 2.4 3.1 3.2 4.1 4.2 4.3 4.4 4.5 Sum grade

total 6 10 2 6 4 6 9 12 3 10 2 4 8 3 85

reached

Exam Grade: Bonus Points: Final Grade:

i

The solutions to the exam/assignment problems in this document are

supplied to give students a starting point for answering questions. While

we are striving for helpful solutions, they can be incomplete and can even

contain errors.

If you nd solutions you do not understand or you nd incorrect, discuss

this on the course forum and/or with your TA and/notify the instructors.

In any case, grading student's answers is not a process of simply compar-

ing with the reference solution, therefore errors in the solutions are not a

problem in this case.

In the course Articial Intelligence I/II we award 5 bonus points for the rst

student who reports a factual error (please report spelling/formatting errors

as well) in an assignment or old exam and 10 bonus points for an alternative

solution (formatted in LATEX) that is usefully dierent from the existing ones.

ii

2 pt

4. What exactly (formal criterion) does an arrow between two nodes in a Bayesian

network mean for the associated events?

Solution:

  1. Two events A, B are conditionally independent given C, if P (A ∧ B|C) = P (A|C)P (B|C).
  2. Every node in a Bayesian network is conditionally independent of its non-descendants given its parents. This means that X 2 , X 3 are conditionally independent of X 1 given A 1
  3. The nodes A 1 and A 2 have no parents, so they are in fact stochastically independent of their non-descendants. The non-descendants of A 1 are A 2 and X 3 , and the non-descendants of A 2 are A 1 and X 1. This means that the pairs A 1 and A 2 , A 1 and X 3 , A 2 and X 1. Note that it would be also correct to say that X 1 and X 3 are stochastically independent by D-separation^1 , but this was not covered in the lectures.
  4. We draw an arrow from Xj to Xi if Xj is in the smallest set Parents(Xi) with the property P (Xi|Xi− 1 , ..., X 1 ) = P (Xi|Parents(Xi))

Problem 1.3 (Arrows in Bayesian Networks) 2 pt

Suppose that in a Bayesian network N we have variables C 1 , E 1 , C 2 , and E 2 , such that C 1 2 min

causes E 1 and C 2 causes E 2.

1. How do we call an arrow going from C 1 to E 1?

2. How do we call an arrow going from E 2 to C 2?

Solution:

  1. Causal.
  2. Diagnostic

2 Decision Theory

Problem 2.1 (Expected Utility) 6 pt

6 min

1. What is the formal(!) denition of expected utility? What is the meaning of every

variable in the dening equation?

2. How do we use expected utility to make decisions?

Solution:

(^1) https://de.wikipedia.org/wiki/D-Separation

  1. The expected utility EU is dened as EU (a|e) =

s′

P (R(a) = s′|a, e) · U (s′)

where

(a) a is the action for which we want to nd out the expected utility, given the evidence e. (b) U (s′) is the utility of a state s′. (c) R(a) is the result of the action a.

  1. The principle of maximum expected utility says that a rational agent should choose the action that maximizes the agent's expected utility.

Problem 2.2 (The Value of Information) 4 pt

Chef Giordana runs a kitchen that provides food for a large organisation. A salad is sold 4 min

for e6 and costs e4 to prepare. Therefore, the contribution per salad is e2. At present

Giordana must decide in advance how many salads to prepare each day (40 or 60). Actual

demand will also be 40 or 60 each day. So Giordana's payo table looks as follows:

Demand Probability 40 salads 60 salads

40 0.4 e 80 e 0

60 0.6 e 80 e 120

Thus, the expected utility for making 40 salads is 80 and the expected utility for making

60 salads is 72. Based on these expected values without additional information, Giordana

would choose to make 40 salads per day with an EU of e80 per day.

She is considering a new ordering system, where the customers must order their salad

online the day before. With this new system Giordana will know for certain the daily

demand 24 hours in advance. She can adjust production levels on a daily basis. How much

is this system worth to her (per day)?

Task: Compute the concrete value in e and explain what you did.

Solution: The value of information is equal to the expected value of best action given the

information minus expected value of best action without information. The corresponding formula for the value of perfect information is

VPIE (Ej ) =

k

P (Ej = ejk|E) · EU(αej k|E, Ej = ejk) − EU(α|E)

In Giordana's case this amounts to

VPI = (0. 4 · 80 + 0. 6 · 120) − 80 = (32 + 72) − 80 = 24

so the system is worth at most e24 per day.

Problem 2.3 (Decision Network) 6 pt

You try to decide on whether to take an umbrella to Uni. Obviously, it's useful to do so if 6 min

it rains when you go back home, but it's annoying to carry around if it doesn't even rain.

Here are the states you could end up in:

  1. Value iteration iterates over utilities until they converge, obtaining an optimal policy. Policy iteration alternates the steps of policy evaluation (computing utilities given the current policy) and policy improvement (computing a new policy). The policy resulting from value iteration can be stable long before the individual utilities have converged to their precise values.
  2. In POMDPs the current state is unknown; instead we have observables and a sensor model O(s, e) := P (e|s) for observables e and states s.

3 Markov Models

Problem 3.1 (Stock Market Predictions) 12 pt

You bought SpaceY stock recently and try to predict whether to buy more or sell. The 12 min

stock market is in one of two possible states; bull state or bear state. In a bull state,

it will (in the long term) be advantageous to buy stock; in a bear state it will be more

advantageous to sell.

If the market is in a bull state, the probability it will still be in a bull state tomorrow

is 60%. If it is in a bear state, the probability it will remain so tomorrow is 80%.

If the market is in a bull state, the probability that your stock will rise that day is 90%.

If it is in a bear state, your stock will more likely fall (with 60% probability).

1 pt

1. What are the observable and unobservable variables in this model? 1 pt

2. If we consider this as a hidden Markov model, what is its transition matrix T?

Remember that we use transition matrices to compute the previous or future states.

6 pt

3. Explain what kind of probabilities prediction, ltering and smoothing compute in

this scenario. Do not just give formulas.

4 pt

4. Give the underlying equations for the rst two of these algorithms and explain what

each variable in the equation represents.

Solution:

  1. We take Xt to be a discrete random variables with domain {bull, bear}.

T =

  1. Prediction Given the behavior of the stock market up to time t 0 , compute the probability of the state the stock market will be in at time t 1 > t 0 Filtering Given the behavior of the stock market up to now, compute the probability of the state the stock market is in right now

Smoothing Given the behavior of the stock market up to t 0 , compute the probability that sta stock market was in some state at an earlier point t 1 < t 0.

  1. We have P (Xt+1|e1:t+1) = αP (et+1|Xt+1) ·

xt P^ (Xt+1|xt, e1:t)^ ·^ P^ (xt|e1:t)^ where^ X^ repre- sents the state and e the behavior of the stock market.

Problem 3.2 (Stationary) 3 pt

Dene what it means for a Markov model to be stationary, and why we are interested in 3 min

stationarity.

Solution: A Markov process is called stationary if the transition model is independent of time,

i.e. P(Xt | Xt− 1 ) is the same for all t. We like stationary Markov processs, since they are nite.

4 Learning

Problem 4.1 (Decision List) 10 pt

Construct a decision list to classify the data below. The tests should be as small as possible 10 min

(in terms of attributes), breaking ties among tests with the same number of attributes by

selecting the one that classies the greatest number of examples correctly. If multiple tests

have the same number of attributes and classify the same number of examples, then break

the tie using attributes with lower index numbers (e.g., select A 1 over A 2 ).

Example A 1 A 2 A 3 A 4 y

x 1 1 0 0 0 1

x 2 1 0 1 1 1

x 3 0 1 0 0 1

x 4 0 1 1 0 0

Solution:

Problem 4.2 (Information Theory) 2 pt

Explain why it is possible (even common) that the learning curve (example given below) 2 min

never gets to 100% correctness, even for large example sets.

  1. Hair has the highest information gain, so we split here. All table entries with Dark have result None, so we continue with Hair = Light

Problem 4.5 (Overtting) 3 pt

Explain what overtting means and why we want to avoid it. 3 min

Solution: Overtting is a modeling error that occurs when the chosen hypothesis is too closely

t to a sample set of data points. It picks an overly complex hypothesis that also explains idiosyncrasies and errors in the data. A simpler hypothesis that ts the data less exactly is often a better match for the underlying mechanisms.