Definition (Average Code Rate)
Let C be a D-ary n-th order VLC f:Xn→{0,1,⋯,D−1}∗for a discrete source {Xi}i=1∞ with alphabet X and joint pmfs {pXn} and let l(cxn) denote the length of codeword cxn:=f(xn) associated with source n-tuple xn∈Xn. Then the average codeword length for C is given by l:=E[l(cXn)]=xn∈Xn∑pXn(xn)l(cxn)and its average code rate is given by R:=nl=n1xn∈Xn∑pXn(xn)l(cxn)