Discrete dynamics for mathematical simulation of living systems