This reminds me of one of my favourite short stories, EPICAC by Kurt Vonnegut. https://en.wikipedia.org/wiki/EPICAC_(short_story)
Edit: readable here http://newmediaabington.pbworks.com/f/vonnegut_EPICAC.pdf
Edit: readable here http://newmediaabington.pbworks.com/f/vonnegut_EPICAC.pdf