FE 459
Spring 2025

Exam Information

Exam Logistics

Material covered

The exam will focus on the material that we have discussed in class during the first half of the course. The exam will cover both finance and programming topics, in approximately equal proportion.

Conceptual finance topics include:

Programming topics include:

Preparing for the exam

Sample Conceptual Questions

Note: this is a sampling only, and NOT a study guide.

  1. Explain the concept of an annuity, and how we calculate the present value of an annuity.

  2. How is the standard deviation of an asset’s rate of return a useful metric, and why would investors be interested in it?

  3. Explain the concept of a stock’s beta. Make an argument about why would investors care about a stock’s beta.

  4. What does the yield-to-maturity of a bond measure? What does it mean for the yield-to-maturity on a bond to be more/less than the coupon rate?

  5. What is the duration of a bond, and what does it measure? Why is this a useful metric for a bond investor? Explain the duration conceptually; you do not need to write out any formulas.

  6. Explain in general terms how the binomial option pricing model helps to compute the value of an European put option. Identify and explain all of the main steps in the correct order, but you do not need to write any specific formulas.

Sample Programming Problems

Note: this is a sampling only, and NOT a study guide.

  1. Write a Python function print_stars(n) where n is a positive integer. It should print n lines of stars with 1 star on first line, 2 stars on second line, and so forth. For example, print_stars(4) should print

        *
        **
        ***
        ****
    
  2. Write a function fv_factors(r, n, m) that returns a list of n future value factors calculated at the annual rate of r with m compounding periods per year. Use a list comprehension.

    For example:

        >>> fv_factors(0.05, 1, 1)
        [1.05]
        >>> fv_factors(0.04, 2, 2) 
        [1.02, 1.0404, 1.0612080000000002, 1.08243216]
        >>> fv_factors(0.04, 2, 4)
        [1.01,
         1.0201,
         1.0303010000000001,
         1.04060401,
         1.0510100501000001,
         1.0615201506010001,
         1.07213535210701,
         1.0828567056280802]
    

    The future value factor (a.k.a. future value of $1) at time t for rate r with m compounding periods per year is given by: fvf = (1+r/m) ** t,
    where t is a period number (not necessarily a year).

  3. Write a Python function years_needed that takes three inputs:

    • principal, which is the initial amount of money deposited in an interest-bearing account
    • rate, which is the annual interest rate in decimal form
    • target, which is the final value that the investor wants to reach

    The function should use a loop to determine the (minimum) number of years of compounded annual interest that are needed for the investment to reach or exceed the specified target.

    Note: After each year, the new principal is computed as

    principal = principal * (1 + rate)
    
  4. Write a function num_divisors(n) that returns the number of integers from 1 to n (inclusive) that divide n evenly. For example, num_divisors(42) should return 8, because 1, 2, 3, 6, 7, 14, 21, and 42 are all divisors of 42.

    1. Use a list comprehension.
    2. Use a definite loop with the accumulator pattern.
  5. Write a function square_root(x, err) to calculate and return an estimate of the positive square root of x such that the square of this result is within err of the value of x.

    Here are some examples:

    >>> # An estimate of the square root of 2, within 0.1.
    >>> square_root(2, 0.1) # returns a a good enough estimate
    1.4375
    >>> # Yes, 25 is a perfect square. This is a very close estimate.
    >>> square_root(25, 0.01) 
    4.9990234375
    

    Your solution must use an indefinite loop (while). The loop should iterate to test values for the square root, adjusting the upper or lower bounds of the values to test at each iteration. You may not use the built-in math.sqrt function or the operator **.

  6. Write a function variance(values) that calculates and returns the population variance of a list of numeric values.

    For example:
    >>> variance([1,2,3,4,5]) 
    2.0
    >>> variance([99,99,99]) 
    0.0
    

    The population variance σ^2 of a sequence of values is given by:
    σ^2=1/n ∑_(i=1)^n▒〖(x-μ)〗^2 , where x represents each value in the list, and μ is the mean (arithmetic average) of all values. Helper functions are not required, but if you use any, write them out.

  7. Write a function create_2d that takes as input two integers height and width, and that creates and returns a 2D list (i.e., a list of lists) with values that are the row number multiplied by the column number. For example:

    >>> create_2d(3, 5)
    [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]]
    
  8. Write a function add_one that takes an input grid that is a 2D list (a list of lists). Your function should add 1 to each element of grid, but it should not return anything. For example:

    >>> my_grid = create_2d(3, 5)
    >>> add_one(my_grid)
    >>> my_grid
    [[1, 1, 1, 1, 1], [1, 2, 3, 4, 5], [1, 3, 5, 7, 9]]
    
  9. Write a function only_positives(values) that takes a parameter which is a 2-dimension list of numbers and returns a new 2-d list of numbers which contains only the positive elements of values; all other elements are set to 0.
    We assume that values is rectangular. For example:

    >>> matrix = [[4, -2], [-3, 5]] 
    >>> only_positives(matrix) 
    [[4, 0], [0, 5]]
    
  10. Write a Python class called Vector, which encapsulates the idea of a vector (of any length) of numbers. The following lines demonstrate creating and printing such an object:

        >>> v1 = Vector([3, 4, 5, 6, 7])
        >>> v2 = Vector([3, 1, 2])
        >>> v2.mult_scalar(3)
        >>> print(v2)
        >>> v3 = v1 * 4
        Vector([9,3,6])
        >> print(v3)
        Vector([12, 16, 20, 24, 28])