
Assignment 2
Ling 420
Due Tuesday, January 30
1. (exercise 2.3, p. 59) Compute the probability of the event “A period
occurs after a three-letter word and this period indicates an abbreviation,”
assuming the following probabilities:
(1) a. P(is-abbreviation|three-letter-word) = 0.8
b. P(three-letter-word) = 0.0003
2. (exercise 2.4, p. 59) Are Xand Yas defined in the following table inde-
pendently distributed?
x0011
y0101
p(X=x, Y =y) 0.32 0.08 0.48 0.12
3. Bowl B1contains 2 white chips, bowl B2contains 2 red chips, bowl B3
contains 2 white and 2 red chips, and bowl B4contains 3 white chips
and 1 red chip. The probabilities of selecting bowl B1,B2,B3, or B4
are 1/2, 1/4, 1/8, and 1/8, respectively. A bowl is selected using these
probabilities, and a chip is then drawn at random. Find
(a) P(W), the probability of drawing a white chip
(b) P(B1|W), the conditional probability that bowl B1had been se-
lected, given that a white chip was drawn.
4. Write a python program which does the following:
•Reads in a text file (using open)
•Nicely prints out every *unique* bigram (i.e., two words occurring
adjacently) in the text, along with its count
–For printing, make three columns: print out word 1 in the first
column, word 2 in the second, and the frequency in the third
–Both column 1 and column 2 should be left-aligned
•Don’t worry about sophisticated tokenization for this program.
1