Three people were condemned to death Friday and one given life in prison for a mass stabbing that killed 31 people in China, state media said, in an attack authorities blamed on separatists from largely Muslim Xinjiang.