Advertisement
uopspop

Untitled

Sep 18th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Lines can be used to approximate a wide variety of functions; often a function can be described using many lines.
  2. If a stock price goes from $10 to $12 from January 1st to January 31, and from $12 to $9 from February 1st to February 28th, is the price change from $10 to $9 a straight line?
  3. How can I use two pieces of lines to describe the price movements from the beginning of January to the end of February?
  4. ==============================================================================
  5.  
  6. 1) is the price change from $10 to $9 a straight line?
  7. The price change from $10 to $9 is not straight line, because it goes up from 10$ to 12$ during January and then goes down from 12$ to 9$ during February.
  8. 2) How can I use two pieces of lines to describe the price movements from the beginning of January to the end of February?
  9. If we use date as our x-axis and price as our y-axis, we will have a Set S that have points on either one of the two lines:
  10. S = { (1,10), (31,12), (31+1,12), (31+28,9) }
  11. = { (1, 10), (31,12), (32,12), (59,9)}
  12. Now, we can get two equations from these points:
  13. M = (12 - 10)/(31 - 1)
  14. = 2/30 = 1/15
  15. Y= (1/15) * x + b
  16. Use (1,10)
  17. 10 = (1/15)*1 + b
  18. b = 10 – (1/15) = 149/15
  19. Therefore, we get the equation:
  20. Y = (1/15)*x + 149/15 while x interval = [1,31]
  21.  
  22. M2 = (9 – 12)/(59 - 32)
  23. = -3/27 = -1/9
  24. Y = (-1/9)x + b
  25. Use (32,12)
  26. 12 = (-1/9)*32 + b = (-32/9) + b
  27. b = 12 + (32/9) = 140/9
  28. Therefore, we get another equation:
  29. Y = (-1/9)x + 140/9 while x interval = [32,59]
  30.  
  31. To represent the price movement from January 1st to February 28th, we will get a piecewise function as below:
  32. f(x) = (1/15)*x + 149/15 while x interval = [1,31]
  33. f(x) = (-1/9)x + 140/9 while x interval = [32,59]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement