State governments are increasingly relying on algorithms to determine whether, and to what extent, people qualify for public benefits.