distinguish P matrix