IMPORTANT: Remember that I encourage you to work in groups, but each student must submit his/her
own homework spreadsheet. Every student's homework assignment should look significantly different from
all other students (ie., each student's work should be a representation of their own work).
You are responsible for keeping copies of all work you submit for grading. Also, please plan to submit your
homework in advance - there will be no exceptions in case your computer and/or internet connection are
not working. Please plan to submit assignments at least a few hours early so that any connectivity or
computer problems can be fixed or another computer/facility can be used.
Solve the following problems using Excel/VBA. Please place each problem on a new worksheet in your
single workbook. Label areas of the spreadsheet to make it clear where each part of the problem is worked.
You may consider separating various parts of problems by a border.
NOTE: You may have to search for various bits of information somewhere, like on the web (?)!
1. (Problem 2, Homework 4 revisited.) For the ladder problem described in Problem 2 of Homework 4.
develop a VBA function called Ladder(a,b,w1,w2) that has input arguments a, b, w₁, and w, and
returns the length of the longest ladder that will fit around a given corner. Your function should use the
Golden Search method (20 rounds) to find the minimum L (see diagram in Homework 4 assignment)
and it is this minimum value of L that is the length of the longest ladder that will fit around the comer.
The variables a and b are the initial low and high values used in the Golden Search method.
The TA should be able to type into a cell on your spreadsheet "Ladder(0,10,2,3)", for example, and
the answer for the longest ladder that fits around the corresponding corner will be output in that cell
(no input boxes or message boxes!). Your solution must utilize the Golden Search method.
HINT#1: If I were you, I would set this up in Excel first (similar to bisection-the solution is found in the
Homework 4 Solutions online!) so that you have something to check your function return value against
(I've also got an example below).
HINT #2: See the Learning Module "Implementing targeting and optimization algorithms in VBA
subroutines in the Class 16 module. This screencast shows how to do the Golder Search method in
a subroutine, but you'll have to implement a function here.
Example Output:
A
1 Problem 1
2
3
4
5
6779
b
w1
W2
B
C
0
10
2
D
Length: Ladder(C3,C4,C5, C6)
1 Problem 1
2345
6
7
B
a
b
w1
w2
B
Length:
C
0
10
2
3
7.023482
Fig: 1