Recursion for 5-year-olds
So, Peter, my 5-year-old comes to me in my office and says, "Dad, David is sitting in my chair. Could you go and talk to him about it for a while?"
"Did he kick you out of the chair?"
"No."
"Were you sitting in the chair when he sat in it?"
"No."
"Well, where were you when he sat down in your chair?"
"I was coming to you, to tell you that he was sitting in my chair."
"Yes, I know he's sitting in it now, but where were you when he first sat down in it? Were you sitting in it already?"
"No."
"Then where were you?"
"I was coming to tell you that he is sitting in my chair."
I walked him through it several times. Same answer. I guess I'm too old to understand.


blog comments powered by Disqus