Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,287 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,337 people online right now. Registration is fast and FREE... Join Now!




Decision tree problem [picture of excel enclosed]

 
Reply to this topicStart new topic

Decision tree problem [picture of excel enclosed]

m1_girard
post 26 Feb, 2008 - 01:10 PM
Post #1


New D.I.C Head

*
Joined: 25 Feb, 2008
Posts: 6

Hi everyone,

I'd like to first thank everyone for helping me with understanding this VBA stuff, what you have seen is only a few of the questions I haven't been able to get, the majority I've been able to reason out on my own. However; I do have one final question that I have attempted, but am unable to solve. I have enclosed an image of the problem in a jpeg file.

It is a 3 stage decision tree with uniform probabilities given, and I need to write the macro that will work backwards and calculate the first value in the tree. Again, this is in the excel file.

Here's an exercise I did earlier to find expected value of a cell, but I'm having an extremely hard time adapting it.

CODE

Function valuex(i, j)
Dim pup
Dim pdown
pup = 0.6
pdown = 1 - pup
valuex = pup * Cells(i + 1, j + 1) + pdown * Cells(i - 1, j + 1)
End Function
Sub loopy()
'ctrl l runs this sub
Dim i
Dim j
Dim temp
i = 4
j = 1
temp = valuex(i, j)
Cells(6, 3) = temp
End Sub


Thanks in advance for any help that can be rendered, I really appreciate it.

Cheers

This post has been edited by m1_girard: 26 Feb, 2008 - 01:54 PM


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM

Go to the top of the page

m1_girard
post 26 Feb, 2008 - 04:28 PM
Post #2


New D.I.C Head

*
Joined: 25 Feb, 2008
Posts: 6

Hey everyone,

I was actually able to work through it and get it on my own after cruising the forum and using a little bit of my own know how! Thanks again for all your help.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 01:03AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month