<jupyter_start><jupyter_text>Pair Problem 1: FACTORIALFactorial(n) written as n! is the product of all the numbers up to n.8! = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 = 40320Write a function to calculate the factorial of a given number.		def factorial(n):Once done, can you rewrite this function using recursion. A recursive function is one that calls itself. Pair Problem 2: FIBONACCI SERIESFibonacci series goes like this: 0 1 1 2 3 5 8 13 21 34You start with 0 and 1. Each of the following numbers are the sum of the previous two numbers in the series.Write a function, that given N, will return the Nth number of the Fibonacci series.Once done, can you rewrite this function using recursion.<jupyter_code>def factorial(n):
    total = 1
    while n != 0:
        total *= n
        n = n - 1
    return total
factorial(8)
def recursive_factorial(n):
    if n==1:
        return n
    return n * factorial(n-1)
recursive_factorial(8)
def recursive_fibonacci_number(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return get_fibonacci_number(n-1) + get_fibonacci_number(n-2)
recursive_fibonacci_number(5)
def fibonacci_number(n):
    num = [0, 1]
    if n == 0:
        return 0
    elif n == 1:
        return 1
    for i in range(n - 1):
        num.append(num[i] + num[i + 1])
    return num[-1]
        
fibonacci_number(6)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07841726618705036, 'fraction_numerical': 0.039568345323741004, 'mean_word_length': 2.907303370786517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '581206', 'license': 'MIT', 'n_tokens_mistral': 516, 'n_tokens_neox': 454, 'n_words': 190, 'path': 'pair_programming_exercises/Pair Programming - Day 17.ipynb', 'repo_name': 'athena15/metis', 'size': '1390'}