Well as someone said, Picard calls for the holodeck pretty early on. That was hardly programmed in. So there must be freedom within the system's boundaries. As an extreme example, if Picard murdered his daughter, she wouldn't become a scientist, no? The point being that there are possible outcomes that don't involve the outcomes we saw in the episode.