AnsweredAssumed Answered

Random Numbers in Quiz Table

Question asked by Brian Baugh on Nov 10, 2016
Latest reply on Nov 14, 2016 by Brian Baugh

I want to generate a table that looks something like this, which has a different starting spot price [s] for each version of the quiz and a different strike price [k]. I'd then ask the students to infer the strike price by looking at the table. Preferably I'd plot this in Canvas but I don't think that functionality exists yet. If I'm wrong, please let me know.

 

Here's what I want Canvas to produce after randomly generating a starting spot price for the table [s] and a random strike price [k].

 

What is the strike price of the following call option?

Spot Price ($)Call option Payoff ($)
20
30
40
50
60
71
82
93
104

 

 

What I coded into the Canvas table:

What is the strike price of the following option?

 

Spot Price ($)Call option Payoff ($)
[s]
max(0,[s]-[k])
[s]+1max(0,[s]+1-[k])
[s]+2max(0,[s]+2-[k])
[s]+3max(0,[s]+3-[k])
[s]+4max(0,[s]+4-[k])
[s]+5max(0,[s]+5-[k])
[s]+6max(0,[s]+6-[k])
[s]+7max(0,[s]+7-[k])
[s]+8max(0,[s]+8-[k])

 

 

What canvas produces

What is the strike price of the following option?

  

Spot Price ($)Call option Payoff ($)
2max(0,2-6)
2+1max(0,2+1-6)
2+2max(0,2+2-6)
2+3max(0,2+3-6)
2+4max(0,2+4-6)
2+5max(0,2+5-6)
2+6max(0,2+6-6)
2+7max(0,2+7-6)
2+8max(0,2+8-6) 

 

How do I get canvas to compute the formula in a table using the variables [s] and [k]? Better yet, how do I plot this function?

 

Thanks!

Brian

Outcomes