There's a science fiction story in which a character is using a probability algorithm to restore a smashed stained glass window. As the story progresses, he begins to leave more and more of the pieces out, trying to simplify the problem. Then he gets batty and leaves still more and more out, till finally he is found dead at his computer, the window wholly gone, the frame empty, the white light of day pouring in upon him.
What story is this in? Who wrote it?