Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

image text in transcribed

(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, w1, and W2 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 corner. 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 Section search method. HINT: 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). Example Output: B D B C A 1 Problem 1 2 W N A 1 Problem 1 2 3 a 4 b a 0 3 4 b 10 4 w No 5 w1 2 5 w1 w2 3 6 w2 6 7 8 7 Length: =Ladder(C3,C4,C5,C6) 8 Length: 7.023482 (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, w1, and W2 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 corner. 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 Section search method. HINT: 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). Example Output: B D B C A 1 Problem 1 2 W N A 1 Problem 1 2 3 a 4 b a 0 3 4 b 10 4 w No 5 w1 2 5 w1 w2 3 6 w2 6 7 8 7 Length: =Ladder(C3,C4,C5,C6) 8 Length: 7.023482

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance For Non Financial Managers

Authors: Pierre G. Bergeron

5th Edition

0176104070, 9780176104078

More Books

Students also viewed these Finance questions

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago