We assume that the BOW corpus is generated from a bigram LM θ in two steps: (i) An ordered document is generated from the bigram LM θ; (ii) The document's unigram counts are collected to produce the BOW x.
the probability of a BOW x being generated by θ can be computed by marginalizing over unique orderings z of x: where σ(x) is the set of unique orderings, and |x| is the document length.