On finding an estimate of the complexity of discrete k-valued functions