Review session
2026-10-16
Domain D={Tom,Ann,Joe,Sue,Sam}
A=runner=(1,1,0,1,0) B=tall=(0,1,1,1,0)
Here A=runner={Tom,Ann,Sue}, B=tall={Ann,Joe,Sue} and A∩B={Ann,Sue}, so ∣A∣=3 and ∣A∩B∣=2.
| Sentence | Test | Here |
|---|---|---|
| Every A is B | ∣A∩B∣=∣A∣ | 2=3, false, Tom is the witness |
| Some A is B | ∣A∩B∣>0 | 2>0, true |
| No A is B | ∣A∩B∣=0 | 2=0, false |
Tips
Always say which test you applied. The verdict alone is not the answer.
Domain D={Tom,Ann,Joe,Sue,Sam}
A=singer=(1,0,1,1,1),B=dancer=(0,0,1,1,1)
(a) Compute A⊙B and A⋅B. Say what each denotes.
(b) Evaluate Every singer is a dancer, Some singer is a dancer and No singer is a dancer, naming the test.
(c) Evaluate Every dancer is a singer. Compare with part (b).
(d) What single change to the model makes Every singer is a dancer true?
Domain D={Tom,Ann,Joe,Sue}. Fij=1 when i follows j, rows are the follower.
| Object | Order | Type |
|---|---|---|
| F | 2, matrix | ⟨e,⟨e,t⟩⟩ |
| Fe | 1, vector | ⟨e,t⟩ |
| e⊤Fe | 0, scalar | t |
Each application to an entity contracts one index and drops one order.
F is not symmetric. F12=1 but F21=0, since Tom follows Ann and Ann does not follow Tom.
Domain D={Tom,Ann,Joe,Sue}. Tij=1 when i teaches j.
(a) Compute TeSue and T⊤eSue. Name each set in English.
(b) Write “Ann teaches Tom” as a bilinear form and evaluate it.
(c) Is T symmetric? Name a pair that settles it.
(d) Give the type of teaches, and the order and type of TeSue.
Bonus. What is T⊤eJoe, and what does it say? The zero vector, since Joe teaches nobody.
counts→ratio→PMI=log2(ratio)
PMI→PPMI=max(0,PMI)→cos
Row totals (50,30,20), column totals (40,40,20).
Clipping merges “co-occurs less than chance” with “exactly at chance”. Both now read 0.
The usual reason to accept that loss. Negative PMI is unreliable when counts are small.
cos(u,v)=∥u∥∥v∥u⋅v
Raise context counts to a power α<1 before normalizing.
pα(c)=∑c′count(c′)αcount(c)α
Row totals (50,30,20), column totals (50,30,20). Leave answers as log2 of a fraction.
(a) Compute PMI(x1,c1) and PMI(x1,c2).
(b) Compute the whole PMI row of x3. What does it say about x3?
(c) Write the PPMI matrix. What distinction was lost?
Use the same table.
(d) Compute cos(x1,x2) on the PPMI rows. Then try cos(x1,x3) and say precisely what goes wrong.
(e) On the raw count rows, cos(x1,x2)≈0.87. Explain why this disagrees with part (d).
Context counts (60,30,10) and α=0.5.
(a) Compute p(c) and pα(c) for the three contexts.
(b) Which context gains probability, and which loses?
(c) What happens to the PMI of the rarest context, and why is that the point of smoothing?
u⊤Gv=i,j∑uiGijvj
Take u=(2,3), v=(5,1) and G=(1023).
102⋅1⋅5+42⋅2⋅1+03⋅0⋅5+93⋅3⋅1=23
Reversing the roles gives v⊤Gu=49. Because G=G⊤, the order of the arguments matters.
A query q is compared with several candidates x. Each candidate gets a score, and the ranking sorts the candidates by score.
scoreG(x)=q⊤Gx
Query q=(1,2), candidates a=(4,1) and b=(1,3), and metric G=diag(g,1).
A diagonal G reweights coordinates. A larger weight on coordinate 1 favors the candidate that is large there.
Each label gives the score of that point. Dashed lines join points with the same score. The grey arrow points toward higher scores, so the point on the higher line wins.
(a) Let u=(1,4), v=(3,2) and G=(2011). Compute u⊤v and u⊤Gv, writing out all four terms for the second.
(b) A query q=(3,1) is compared with a=(2,2) and b=(5,0). Which is returned under the dot product?
(c) Find a diagonal G=diag(1,g) under which the other candidate wins. Verify by computing both scores.
(uv⊤)ij=uivj
Take u=(2,1,0) and v=(1,0,3).
uv⊤=210000630
A relation that factors this way is “a property of the first argument” times “a property of the second”.
(a) For u=(3,0,1) and v=(1,2,1) write out uv⊤ and state its rank.
(b) Is (1224) an outer product of two vectors? If so, which?
(c) Is the 2×2 identity an outer product of two vectors? Explain using rank.
| Topic | Coordinates | The inner product gives |
|---|---|---|
| Sets and relations | individuals | a count, then a truth value |
| Distributional pipeline | contexts | a similarity, repaired by PPMI and smoothing |
| Bilinear forms | any basis | a score that depends on the metric G |
Brandeis Fall 2026 CS135 Recitation – Bohan Jiang