he went thru all the millions of possibilities and giving up the stone was the only one that would work in defeating Thanos
makes sense. I was under the impression that he only knew the calculations, but he didnt know which situation would bring the victory.