This kind of algorithmic takeover, which I think is far, far more likely than the science fiction scenarios of a robot rebellion, can actually happen far more easily in an authoritarian regime than in a democratic regime. The only ingredient missing is for the people higher up to develop enough trust in the algorithm.