This measure does not take into account the number of language switch points in a sentence (denoted by P (x)) and so the authors modify it further: The code-mixing in the entire corpus can then be quantified by taking an average of the above measure across all sentences in the corpus: where U is the number of sentences in the corpus.
their main assumption that the language which has the maximum number of tokens in a sentence is the Matrix language, may not always hold.