1. Home
  2. Explore
  3. Computer Science
  4. Recursion and Factorials

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Recursion and Factorials

  • 15Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Factorial Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What does the factorial n!n!n! represent for a positive integer nnn?

Tap to flipClick to flipspace

The product of all positive integers from nnn down to 111.

Or swipe the card

15 cards

  1. What does the factorial n!n!n! represent for a positive integer nnn?

    The product of all positive integers from nnn down to 111.

  2. What is 4!4!4!?

    242424

  3. What is 2!2!2!?

    222

  4. What is 1!1!1!?

    111

  5. What is 0!0!0!?

    111

  6. How can the terms after the leading nnn in the factorial product be rewritten?

    They equal (n−1)!(n-1)!(n−1)!, so n!=n(n−1)!n! = n(n-1)!n!=n(n−1)! for n≥1n\geq 1n≥1.

  7. For which values of nnn does the relation n!=n(n−1)!n! = n(n-1)!n!=n(n−1)! work?

    It works for integers n≥1n\geq 1n≥1.

  8. Why can’t n!=n(n−1)!n! = n(n-1)!n!=n(n−1)! be used at n=0n=0n=0?

    It would require (−1)!(-1)!(−1)!, which is not defined.

  9. What two cases give a complete recursive definition of factorial for nonnegative integers?

    n!=n(n−1)!n! = n(n-1)!n!=n(n−1)! when n≥1n\geq 1n≥1, and 0!=10! = 10!=1.

  10. Why is the formula n!=n(n−1)!n! = n(n-1)!n!=n(n−1)! alone an incomplete definition of factorial?

    It does not define the value at n=0n=0n=0.

  11. What is recursion in computer science?

    A way to solve a problem by having a function call itself.

  12. What is the purpose of a function named fact in the factorial example?

    It takes a nonnegative integer as input and returns that integer’s factorial.

  13. What is the recursive case for calculating factorial with a function?

    For n≥1n\geq 1n≥1, return nnn multiplied by the factorial of n−1n-1n−1.

  14. What is the base case for a recursive factorial function?

    When the input is 000, return 111.

  15. Using the recursive definition, what is 3!3!3!?

    666

Card 1 of 15
Card 1 of 15

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent