Originally Posted by
The One Who
Yes, but there needs to be a first time, surely?
Chicken or the egg?
When time travel is involved cause can come after the effect rather than before.
and events can set themselves into motion.
Like in the children in need special Time Crash. When the 9th doctor met the 5th doctor.
The 9th doctor stopped the tardis exploding because he remembered what he had witnessed when he was the 5th doctor. He only knew what to do because he remembered what he did.
And all the way back to Rose and the Bad Wolf. She took the words and scattered them through time. She chose those words because they were there. and they were only there because she chose them. A self sustaining loop in time.
It can give you a headache if you think about it too much. When it comes to time travel it's best to go with the flow.
So yeah, the doctor knew he'd get out of the Pandorica because he already had.