0440949 Andreas van Cranenburgh Cognitive Models of Language Assignment 5a NB: instead of calculating all this by hand I decided to implemement a DOP and PCFG model in python using nltk. Hence any mistakes here are mistakes in my implementation. The code is available at: https://unstable.nl/andreas/dop.py 1. S -> NP VP 2 / 2 NP -> 'Harry' 1 / 3 NP -> 'pizza' 1 / 3 NP -> 'Hermione' 1 / 3 VP -> V NP 1 / 2 VP -> 'eats' 1 / 2 V -> 'eats' 1 / 1 2. S -> NP V NP 1 / 14 S -> NP V 'pizza' 1 / 14 S -> NP VP 2 / 14 S -> NP 'eats' 1 / 14 S -> NP 'eats' NP 1 / 14 S -> NP 'eats' 'pizza' 1 / 14 S -> 'Harry' V NP 1 / 14 S -> 'Harry' V 'pizza' 1 / 14 S -> 'Harry' VP 1 / 14 S -> 'Harry' 'eats' NP 1 / 14 S -> 'Harry' 'eats' 'pizza' 1 / 14 S -> 'Hermione' VP 1 / 14 S -> 'Hermione' 'eats' 1 / 14 NP -> 'Harry' 1 / 3 NP -> 'Hermione' 1 / 3 NP -> 'pizza' 1 / 3 VP -> V NP 1 / 5 VP -> V 'pizza' 1 / 5 VP -> 'eats' 1 / 5 VP -> 'eats' NP 1 / 5 VP -> 'eats' 'pizza' 1 / 5 V -> 'eats' 1 / 1 3. Prefix probabilities: PCFG prefix prob: Hermione 1.33333333333 prefix prob: Hermione eats 2.33333333333 prefix prob: Hermione eats pizza 0.888888888889 prefix prob: pizza 1.33333333333 prefix prob: pizza eats 2.33333333333 prefix prob: pizza eats Harry 0.888888888889 PTSG: prefix prob: Hermione 0.252380952381 prefix prob: Hermione eats 0.471428571429 prefix prob: Hermione eats pizza 0.342857142857 prefix prob: pizza 0.180952380952 prefix prob: pizza eats 0.357142857143 prefix prob: pizza eats Harry 0.133333333333 4. Surprisals: PCFG: surprisal: Hermione -0.287682072452 surprisal: Hermione eats -0.559615787935 surprisal: Hermione eats pizza 0.965080896044 surprisal: pizza -0.287682072452 surprisal: pizza eats -0.559615787935 surprisal: pizza eats Harry 0.965080896044 PTSG: surprisal: Hermione 1.37681561717 surprisal: Hermione eats -0.624827936582 surprisal: Hermione eats pizza 0.318453731119 surprisal: pizza 1.70952137099 surprisal: pizza eats -0.67990195381 surprisal: pizza eats Harry 0.985283603361 5. The surprisals for the PCFG are the same for both sentences, whereas for the PTSG they differ, which immediately makes the PTSG model superior. However, it is strange to me that "pizza eats" is less surprising than "Hermione eats", whereas the fact that "Hermione" is less surprising than "pizza" and "Hermione eats pizza" less than "pizza eats Harry" is just as expected. More generally, DOP's modus operandi is more cognitively plausible. For example, memory damage in a DOP implementation can result in graceful degradation. Compare losing one subtree in a DOP model with losing one PCFG rule: the former slightly alters the probability distribution, while the latter can be disastrous since there are surely many sentences depending for their parsability on that rule.