01BTOV Intelligenza Artificiale

Total Page:16

File Type:pdf, Size:1020Kb

01BTOV Intelligenza Artificiale

01BTOV – Intelligenza Artificiale 01GPW - Gestione della Conoscenza e Intelligenza Artificiale

Compito del 20 settembre 2013

Matricola: ______Cognome: ______Nome: ______Corso di Laurea: ______(ATTENZIONE: risposte brevi e puntuali! Riportare i passaggi significativi e le motivazioni!)

1) Risolvere il seguente problema: We have four buttons in a row. Pushing a button means changing its ON-OFF state. Every time the state ON-OFF of one of the buttons is changed, the state of the two adja- cent buttons is changed as well. The configuration of buttons is circular, i.e. the button at one end is adjacent to the button at the other end. For instance, if in the state

ON OFF OFF OFF

we push the first button on the left, we get

OFF ON OFF ON

Consider the search problem consisting in starting with an initial state where all the buttons are ON, and the following goal state: OFF OFF ON OFF Consider the heuristic h defined as the number of buttons whose state is different from the goal state. Answer the following questions, explaining your answer, possibly with an example.

1) How many states are there in the state space? 2) Define the operator push, with preconditions, effects, and cost. 3) Is h admissible? 4) If we apply greedy search without elimination of repeated states (using h), is it pos- sible to find a solution (if one exists)? 5) If we apply greedy search with elimination of repeated states (using h), is it possible to find a solution (if one exists)? (Important: As for questions 4) and 5) you are not requested to find a solution, nor to draw a search tree!) (segue) 2) Si assumano i seguenti fatti: a. Giovanni ama tutte le donne bionde. b. Esiste una donna mora. c. Tutte le more amano Giovanni ma non sono ricambiate. Si dimostri che esiste qualcuno che ama Giovanni ma non è ricambiato.

3) Si abbiano dei dati su un piano (x, y) appartenenti a due classi A e B secondo la figura seguente. Disegnare la rete neurale feed-forward più semplice che permetta di effettuare la classificazione, motivando le scelte.

B A

4) Due astronomi, in parti differenti del mondo, misurano M1 e M2 come numero di stelle N in una qualche piccola regione del mondo, usando i loro telescopi. Normalmente vi è una piccola possibilità d'errore fino ad una stella. Ogni telescopio può inoltre (con una probabilità leggermente più bassa) essere fortemente sfuocato (eventi F1 e F2), nel qual caso gli scienziati conteranno tre o più stelle in meno. Si considerino le due reti di credenza mostrate in figura. La seconda è corretta, mentre la prima è errata e corrisponde ad un ordinamento dei nodi come il seguente: F1, F2, M1, M2, N. Si supponga di aver già messo a posto i nodi F1, F2, M1 e di dover inserire il nodo M2. Stabilire le corrette connessioni calcolando P(M2|F1, F2, M1) sul modello causale.

F1 F2 F1 N F2

M1 M2 M1 M2

N

(i) (ii) SOLUZIONI

Esercizio 1 da prof.ssa Aiello

1) The cardinality of the state space is 24 = 16. 2) push(i) is a unary operator that pushes the i-th button in the row. The operator has no preconditions, cost 1, and is effect is to change the state of the buttons i , ( i + 1)mod 4, and (i - 1)mod 4. 3) The heuristic h is not admissible. To prove it it is sufficient to consider that each move costs 1, that the move that leads from the last-but-one state to the final state changes 3 buttons, so the value of the heuristic on the last-but-one state is 3. Hence h overestimates the real cost. 4) If we apply greedy search without elimination of repeated states (using h), is it not possible to find a solution, as there are states with value of h equal to 2, so the search will never choose a state with heuristic value 3. 5) If we eliminate repeated states it is possible to find a solution, as the search state is finite.

Esercizio 2 da prof.ssa Mello

 X donna(X), mora(X).  X donna(X), bionda(X) -> ama(giovanni,X)  X donna(X), mora(X) -> ama(X, giovanni), not ama(giovanni, X).

 X donna(X), ama(X, giovanni), not ama(giovanni, X).

C1: donna(d), C2: mora(d). C3: not donna(X) or not bionda(X) or ama(giovanni,X) C4: not donna(X) or not mora(X) or ama(X, giovanni) C5: not donna(X) or not mora(X) or not ama(giovanni, X)

Gn: not donna(X) or not ama(X, giovanni) or ama(giovanni, X).

Risoluzione: C6: C4 e C1: not mora(d) or ama(d, giovanni) C7: C6 e C2: ama(d, giovanni) C8: C5 e C1: not mora(d) or not ama(giovanni, d) C9: C8 e C2: not ama(giovanni, d) C10: Gn e C1: not ama(d, giovanni) or ama(giovanni, d). C11: C10 e C7: ama(giovanni, d) C12: C11 e C9: clausola vuota Soluzione 3)

La rete avrà 2 nodi di input, 3 nodi hidden e 2 (o 1) nodi di output. Il numero di input è imposto dalla dimensionalità dei dati. Il numero di nodi hidden è giustificato dal fatto che ogni hidden genera una retta di separazione. Il numero di nodi output è giustificato dalla scelta di codificare l’uscita secondo l’1 su N.

Recommended publications