where \(n^{(j)}_{X}=\sum _{k} n^{(j)}_{X,k}\) . The total number of errors in the \(X\) -basis is \(m_X=\sum _j m^{(j)}_{X}\) . The fraction of errors resulting from a pulse of intensity \(k\)  can be found by weighting \(m^{(j)}_{X}\)  by the term \(p_k D_k (j)/[\sum _k p_k D_k (j)]\) . Similar results can be found for the \(Z\)  basis. These quantities can be used in Eq. (REF ) and (REF ) together with Eqs. (1) to (5) of [1]}, to calculate the length of the secure key (REF ).
