3. Her dad was a
computer scientist.
He worked with
computers all day
long.
4. Alyssa always heard
him talking about
something called
“recursion”, so one
day she asked him,
“Dad, what does
‘recursion’ mean?”
“Well,” he said,
“Recursion is when
you define a
procedure in terms of
itself.”
“I don’t get it,” said
Alyssa.
5. “Let me put it this way,”
her dad said. “You know
the story of
Cinderella, don’t you?” he
asked.
“Of course! She’s my
favorite princess!” Alyssa
smiled.
“Do you remember what
happens at the end?” he
asked.
“Yeah! The prince finds
Cinderella and they get
married and live happily
ever after!”
6. “Right!” he said. “The
prince knows that the
shoe will only fit
Cinderella, but he
doesn’t know who she
is, so he must test all
of the girls until he
finds her. Since he
doesn’t know how
many girls there
are, he doesn’t know
how many times he
will have to try the
same test, so he used
logic to devise a
method of finding
Cinderella.
7. He tries the shoe on a
girl, and if the shoe
fits, they can get
married and live happily
every after, but if not, he
must move on to the
next girl and try to find
Cinderella again by
trying the shoe on her.
He can only stop once
he finds the right girl!
What the prince was
doing was like a
recursive procedure.”
8. “Oh!” said Alyssa. “I
think I get it now!
Recursion is like trying
to solve a problem by
trying the same idea
over and over again on
different things until it
works.”
“That’s pretty close!”
her dad told her. “I
think you’ll be a great
computer scientist one
day!”