Size of the vocabulary in Laplace smoothing for a trigram language model Let's say we have a text document with $N$ unique words making up a vocabulary $V$, $|V| = N$. For a bigram language model with add-one smoothing, we define a conditional probability of any word $w_{i}$ given  the preceeding word $w_{i-1}$ as: $$P(w_{i}|w_{i-1}) = \frac{count(w_{i-1}w_{i}) + 1}{count(w_{i-1}) + |V|}$$ As far as I understand (or not) the conditional probability, and basing on a 3rd point of this Wikipedia article, $w_{i-1}$ might be assumed to be "constant" here, so by summing this expression for all possible $w_{i}$ we should obtain 1, and so it is, which is obvious.
However, I do not understand the answers given for this question saying that for n-gram model the size of the vocabulary should be the count of the unique (n-1)-grams occuring in a document, for example, given a 3-gram model (let $V_{2}$ be the dictionary of bigrams): $$P(w_{i}|w_{i-2}w_{i-1}) = \frac{count(w_{i-2}w_{i-1}w_{i}) + 1}{count(w_{i-2}w_{i-1}) + |V_{2}|}$$ It just doesn't add up to 1 when we try to sum it for every possible $w_{i}$. Therefore - should the $|V|$ really be equal to the count of unique (n-1)-grams given an n-gram language model or should it be the count of unique unigrams?
 A: V is the size of the vocabulary which is the number of unique unigrams.
This is because, when you smooth, your goal is to ensure a non-zero probability for any possible trigram.
Consider a corpus consisting of just one sentence: "I have a cat". You have seen trigrams:  "I have a"
"have a cat" 
(and nothing else.)
Without smoothing, you assign both a probability of 1. However, if you want to smooth, then you want a non-zero probability not just for:
"have a UNK" 
but also for "have a have", "have a a", "have a I". 
That's why you want to add V to the denominator.
Consider also the case of an unknown "history" bigram. You want to ensure a non-zero probability for "UNK a cat", for instance, or indeed for any word following the unknown bigram. 
You've never seen the bigram "UNK a", so, not only you have a 0 in the numerator (the count of "UNK a cat") but also in the denominator (the count of "UNK a"). What probability would you like to get here, intuitively? 
Since we haven't seen either the trigram or the bigram in question, we know nothing about the situation whatsoever, it would seem nice to have that probability be equally distributed across all words in the vocabulary: P(UNK a cat) would be 1/V and the probability of any word from the vocabulary following this unknown bigram would be the same. So, add 1 to numerator and V to the denominator, regardless of the N-gram model order.
A: $$P_{\text{Laplace}}^*(w_{i}|w_{i-2}w_{i-1}) = \frac{count(w_{i-2}w_{i-1}w_{i}) + 1}{\sum_w (count(w_{i-2}w_{i-1}w)+1)}=\frac{count(w_{i-2}w_{i-1}w_{i}) + 1}{count(w_{i-2}w_{i-1})+|V|}$$
