271 : Dan's Directriconix 272:StockProfits2daMax
- Solution: Slow to post this, thank you for your patience; good thing mathematics is "timeless"!
- The ambiguity in part c) was unintentional; I was thinking of only the "big circle" through (1, 1).
- I first tried this out in Mathematica, so my thinking hat's off to those of you who did this by hand!
- I call your attention to Philippe's awesome graphs and document, and present it slightly edited.
![]()
- . . Dan's note: Here Philippe used the smaller circle; I had the bigger one in mind.
- WINNERS - Problem 271 . . listen to dansmathcast - my math podcast! - (back to top) . leader board
- Joe Fendel. . . . . . . . . . . 10 pts - Nice approach, fully correct, and good transition from polar 'theta' to param 'a'.
- Philippe Fondanaiche . . 8 pts - I'd have to call your latest a "prize-winning document" ; Le Prix de Dansmath!
- Claudio Baiocchi . . . . . . 7 pts - First response, mostly good but a couple of errors in your eqns, need 2(x+y)
- Nick McGrath. . . . . . . . . 6 pts - A plague of locus indeed! I like y = x + 1 - 2a approach for the parablocus.
- Moreau de Saint-Martin . 5 pts - I couldn't translate the LaTeX but I figured it out visually; nice algebra work!
- Nats Kroy . . . . . . . . . . . . 4 pts - You get a bonus point for overarcing method for all 3 parts, a eqns ??
- K Sengupta. . . . . . . . . . . 3 pts - Nice work rotating basic eqn 45 deg, I disagree with yr distances in b and c.
- Bradley Wild . . . . . . . . . 3 pts - Finally credited you with prob 269, good work here w/ polar parab eqn too!
- Hermen Jacobs. . . . . . . . 2 pts - Mostly ok part a, but AX^2 + BXY + CY^2 if AC - B^2 < 0 is hyperbola
- Solution: This was an easier problem, to draw in some new contestants, but you folks saw wrinkles
- that I hadn't anticipated, for example the question of fractional shares, or spending the whole $1000.
- For one, Nats decided to invest any time of the month, you could buy late after the price goes down
- for 3 mos (90, 80, 70) then buy at the beginning (70, 80, 90), selling at $100 and clearing $1579.37,
- or $1222.22 if the limit of $40 delta is in effect. This bends the intended rules but seems legal.
- Etienne addressed two possibilities, as good old Dan wasn't entirely clear in his question/ (Note:For
- the whole nos the purchase prices are 990, 960, 980, 960, 990, 1000; total 5880, so the profit was
- actually $1120 not 1000; and $940 not $800; counted as correct as the fractional was higher! -Dan)
- "Given after 6 months, the stock price is 100$, we should buy a maximum of shares to maximize our profit.
Can we buy a part of a share? frac if non integer shares are accepted, int if shares must be integer.a) | stock |int/frac| int/frac month| price | shares | Totshare 0 | 100 | 0 - 0 | 0 - 0 1 | 90 |11-100/9| 11 - 11.111... 2 | 80 |12-100/8| 23 - 23.611... 3 | 70 |14-100/7| 37 - 37.8968253... 4 | 80 |12-100/8| 49 - 50.3968253... 5 | 90 |11-100/9| 60 - 61.5079365... 6 | 100 |10 - 10 | 70 - 71.5079365...
- Selling off all the shares after 6 months, we get 7000$ /-/ 7150$+79 cents making a profit
- of 1000$(1120) /-/ 1150.79$ Anyway (int or frac) the sequence of stock price is the same.
b) | stock |int/frac| int/frac month| price | shares | Totshare 0 | 100 | 0 - 0 | 0 - 0 1 | 90 |11-100/9| 11 - 11.111... 2 | 80 |12-100/8| 23 - 23.611... 3 | 80 |12-100/8| 35 - 36.111... 4 | 80 |12-100/8| 47 - 48.611... 5 | 90 |11-100/9| 58 - 59.722... 6 | 100 |10 - 10 | 68 - 69.722...
- Selling off all the shares after 6 mos, we get 6800$ /-/ 6972$+22 cents, a profit of 800$(940) /-/ 972.22$
- James L. saved a few dollars on whole numbers then spent the extra $70 in the third month :
- 1000. 990. 960. 1050 (not 980), 960, 990 . New profit was 7100 - 5950 = 1150 not 1120.
- Moreau had the idea of holding the whole $6000 until the price was down to $70, then buying up
- 6000/70 = 85.71 shares, selling at end of 6 mos for $8571, a huge profit of $2571; hmmm...
- WINNERS - Problem 272 . . listen to dansmathcast - my math podcast! - (back to top) . leader board
- Etienne Desclin . . . . . . . 10 pts - Nice job allowing for integer or fractional purcahses; I should be clearer
- Nats Kroy . . . . . . . . . . . . 10 pts - I like your approach for begin, end of month option. Tie best with first!
- Tim Poe . . . . . . . . . . . . . . 7 pts - Good to notice I wasn't offered interest, causing lack of interest in investor.
- Nick McGrath. . . . . . . . . 5 pts - That's right; it's silly to sell the shares at $100 just after you've bought em.
- Art Morris . . . . . . . . . . . 4 pts - Good to see you back! the price seq are ok but the profits/shares seemed off
- Quasi-C. . . . . . . . . . . . . . 4 pts - Right; Sn = 1000/Pn, and |p6 - p5| <= 10 not really =. But same answer eh?
- Ed Wern . . . . . . . . . . . . . 4 pts - Correct to assume purchase is at end of month, but ask Nats what he thinks.
- Kirk Bresniker . . . . . . . . 4 pts - Good - wait 3 mos, buy all $6000 at $70 per, then profit is whopping $2571!
- Moreau de Saint-Martin . 4 pts - Yes the profit is exactly $1150.79 23/63 (and those 1/63 cent pieces are hard to find)
- Joe Fendel . . . . . . . . . . . . 3 pts - Fractional share correct, nice ans; some miscalc profit on the whole numbers
- Bob Chen . . . . . . . . . . . . 2 pts - Later entry by a few weeks but kudos for the compact yet effective spread sheet
- James Laverty. . . . . . . . . 2 pts - Liked your idea of 1000, 990, 960, 1050, 960, 990; 2nd part was cut off the .bmp
- Claudio Baiocchi. . . . . . 2 pts - Your idea was sound but you used seven months, gaining an unfair profit!
- K Sengupta. . . . . . . . . . . 2 pts - Some correct understanding, some misunderstanding of the price changes.
- Allen Druze . . . . . . . . . . 2 pts - There were no CDO's (Chief Dansmath Operators) involved, that's right.
- problem #273 - posted sunday, february 10, 2008
- Best Best-Fitting Curve ? (back to top)
- We at DVC feel that more experienced teachers can derive the quadratic formula faster!
- Here is a table of years of experience (x) vs. minutes to formula (y), for a dozen teachers:
x years 1 2 4 7 9 10 y minutes 8 6 5 3 2 2
x years 1 3 6 8 13 15 y minutes 10 4 2 2 1 1 - There are four types of curves we might try to fit to this data set :
- Linear: y = a + bx Logarithmic: y = a + b ln(x) Exponential: y = a*b^x Power: y = a*x^b
- i) Find the best "a" and "b" for each type of curve.
- (measured by the least squares deviation method)
- ii) Which is the best curve choice, for these data?
- (measured by the largest abs value of correlation coeff rxy)
- Solution: This solution from this week's winner Moreau de StM:
- Least squares deviation method: for n data (u_i,v_i) ; I have to minimize: sum_i (v_i - A - Bu_i)^2
Deriving with respect to A and B, I get the equations : sum_i(v_i) - nA - B sum_i(u_i) = 0
sum_i(u_i v_i) - A sum_i(u_i) -B sum_i(u_i^2) = 0.
Let C = sum_i(u_i), D = sum_i(v_i), E = sum_i(u_i^2), F = sum_i(u_iv_i), G = sum_i(v_i^2).
Solving for (A,B) the system : D - nA - CB = 0 , F - CA - EB = 0
I get : A = (DE-CF)/(nE-C^2) ; B = (nF-CD)/(nE-C^2)
with the correlation coefficient : r = |nF-CD|/sqrt((nE-C^2)(nG-D^2))
Calculations are made, according to the type of curve, on the attached spreadsheet.
(sorry, it's not Microsoft Excel, it's OpenOffice Calc, and French-speaking!) Here are the results:
Linear: (u,v,A,B) = (x,y,a,b) ; a = 7.35970202 , b = -0.53565094 , r = 0.85749790
Logarithmic: (u,v,A,B) = (ln(x),y,a,b) ; a = 8.48438659 , b = -2.97382330 , r = 0.96334767
Exponential: (u,v,A,B) = (x,ln(y),ln(a),ln(b)) ; a = 8.2971719 , b = 0.85527488 , r = 0.95421129
Power: (u,v,A,B) = (ln(x),ln(y),ln(a),b) ; a = 9.9695731 , b = -0.77545576 , r = 0.95778794
So the best best-fitting curve is the logarithmic one: r > 0.96 ; y = 8.484 - 2.974 ln(x)
- I also liked Marcello's 'taking-logs' approach:
- The four problems reduce to linear regression problems by putting Y = y, X = ln(x) in the logarithmic,
- Y = ln(y), X = x in the exponential, and Y = ln(y), X = ln(x) in the power case (and taking logarithm of
both sides in the exp and power equations). Using the formulas b = cov(X,Y)/var(X), a = M(Y) b*M(X),- the coefficients a and b (or ln(a) and ln(b) when necessary) are computed (cov(X,Y) = M(XY) - M(X)M(Y)
- is the covariance, var(X) = M(X^2) M(X)^2 is the variance of X, and M is the arithmetic mean). I obtained:
Linear: a = 7.3597, b = -0.5357 ; Logarithmic: a = 8.4844, b = -2.9738
Exponential: a = 8.2972, b = 0.8553 ; Power: a = 9.9696, b = -0.7755
I computed the Pearson coefficient as r(X,Y) = cov(X,Y)/sqrt(var(X)*var(Y)). My results are:
Linear: abs(r(X,Y)) = 0.8575 ; Logarithmic: abs(r(X,Y)) = 0.9633 (best approximation curve)
Exponential: abs(r(X,Y)) = 0.9542 ; Power: abs(r(X,Y)) = 0.9578- Ed's graph is shown here (I imported it from Excel to Numbers and it lost the connecting lines):
![]()
- WINNERS - Problem 273 . . listen to dansmathcast - my math podcast! - (back to top) . leader board
- Moreau de Saint-Martin . 10 pts - Nice explanation and I'll have to check out OpenOffice one day soon!
- Marcello Cammarratta . 7 pts - I like your approach of using semi-log or log-log 'paper' and doing lin reg!
- Ed Wern . . . . . . . . . . . . . 5 pts - Thanks for the effort and picture; readers can connect the dots themselves!
- Etienne Desclin . . . . . . . 3 pts - You had the right idea but you fitted separate curves for each half-dozen.
- Nats Kroy . . . . . . . . . . . . 3 pts - Good work! The resub fixed things somewhat, except for the power-r-coeff.
- Nick McGrath. . . . . . . . . 3 pts - Nice job Nick; the coeffs were a bit off for the last two, resub was better-r.
- Zahi Teitelman . . . . . . . . 2 pts - Some of yr formulas didn't import, but yr typed-in values were mostly ok.
- Solution: Thanks to Philippe F. for providing some correct Latin:
c) The odd prime factors of 74!, with their powers (gotten by tallying them on paper*) are:
Prime Power Prime Power Prime Power Prime Power
3 34 17 4 37 2 59 1
5 16 19 3 41 1 61 1
7 11 23 3 43 1 67 1
11 6 29 2 47 1 71 1
13 5 31 2 53 1 73 1
- * From Dan: A nice way to express the exact power of p that divides n! is [n/p] + [n/(p^2)] + [n/(p^3)] + ...
- where the [ . . . ] are greatest integer brackets, and the sum eventually consists of zeroes.
- So [74/3] + [74/9] + [74/27] + [74/81] + . . . = 24 + 8 + 2 + 0 + ... = 34 (as Ed has 'tallied.')
- ALEA JACTA EST. If there are some mistakes, ERRARE HUMANUM EST, PERSEVERARE DIABOLICUM!
- WINNERS - Problem 274 . . listen to dansmathcast - my math podcast! - (back to top) . leader board
- Ed Wern . . . . . . . . . . . . . 10 pts - I like how you showed your discovery process, and referred back to me!
- Tim Poe . . . . . . . . . . . . . . 8 pts - Nice invention: primary odd and even sequences; did the odd divisor trick.
- Joe Fendel . . . . . . . . . . . . 6 pts - Good math to include sum of 1 term, then figure, then subtract 1 way off.
- Nick McGrath. . . . . . . . . 5 pts - Thanks for link : mathpages.com/home/kmath107.htm ; good use of pr. fac.
- Moreau de Saint-Martin . 5 pts - Good way of proving it's the number of odd divisors; 2N = (b-a+1)(a+b).
- Philippe Fondanaiche . . 5 pts - I threw in an extra point for the Latin. I'm a sucker for foreign languages ;-}
- Mark Rickert . . . . . . . . . 4 pts - sum of k nos starting with n is (k)(k+2n-1)/2, so one of em must be even, yes.
- Art Morris . . . . . . . . . . . 3 pts - First answer this prob - part a) nicely done; part c) needs more than 666 ways
- Sarah P. (new) . . . . . . . . . 3 pts - Welcome to the contest! Good answers; woulda been an extra point for steps!
- Kirk Bresniker . . . . . . . . 3 pts - Good recovery on the resub; yes number of divisors is the product of (1+expon)
- Frank Mullin . . . . . . . . . 3 pts - Nice method for picking out odd divisors; forgot to subtr 1 from final ans...
- Allen Druze . . . . . . . . . . 3 pts - Your 'odd' bases need to be primes for formula to work; final ans very good
- Phil Sayre . . . . . . . . . . . . 3 pts - There were no CDO's (Chief Dansmath Operators) involved, that's right.
- Zahi Teitelman . . . . . . . . 2 pts - Some of yr formulas didn't import, but yr typed-in values were mostly ok.
- Bob Chen . . . . . . . . . . . . 2 pts - Almost got it; a) 3 ways not 4 (2 or more terms); forgot 7^11 and 73 in pf.
- Etienne Desclin . . . . . . . 2 pts - Nice pdf attachmt; need the idea of odd divisors and use only positive terms
- James Laverty. . . . . . . . . 2 pts - Nice reasoning; goo on part a); extra factor of 37 from 73! to 74! and more...
- Radu Ionescu . . . . . . . . . 2 pts - Correct about 120, and about odd-even factor pairs; need more than 2^36 - 1
- Claudio Baiocchi. . . . . . 2 pts - Good answer all three parts; a few weeks after others but nicely done, C.B.
- David Madfes. . . . . . . . . 1 pt - Thanks for entering (later this summer ;-) nice part a), good try on b) and c).
|
|
|
![]() |
- WINNERS - Problem 275 . . listen to dansmathcast - my math podcast! - (back to top) leader board
- Art Morris . . . . . . . . . . . . 9 pts - I would have loved to give 10 points on this but a numerical check was needed
- Ed Wern . . . . . . . . . . . . . 8 pts - That 'mule paradox' applies to more than zombies; I often experience it myself!
- Tim Poe . . . . . . . . . . . . . . 6 pts - Nice solution, and great complication mentioned above. Big zombie in little pond!
- Nick McGrath. . . . . . . . . 5 pts - Thanks for good solution and link to faster zombie speeds, up to 4.603 m/sec.
- Philippe Fondanaiche . . 5 pts - I am really impressed by the content and modern technology of your website.
- James Laverty. . . . . . . . . 4 pts - I liked your table of 10-second intervals, you escape in 110 sec; good pic too!
- Etienne Desclin . . . . . . . . 4 pts - Nice pdf attachmt; good "ring of safety" 100 - 25 pi < r < 25. Bien repondu!
- Phil Sayre . . . . . . . . . . . . 3 pts - Swim out to R/8 in a line, to R/4 in a spiral, then out to R in a beeline, eh?
- Zahi Teitelman . . . . . . . . 3 pts - Can't go straight out 100m, yes, except with mule zombie. (pls put names on attach)
- Earl Gose (new) . . . . . . . . . 3 pts - Welcome to my contest! Nicely done, but you meant sec not min, or ur dead!
- Claudio Baiocchi. . . . . . . 3 pts - Good decision to spiral out to (25 + (100 - 25 pi))/2 and catch up angularly.
- Yakov Macek . . . . . . . . . . 3 pts - Yes, the zom can't catch you unless you try to escape or it can't make up its mind.
- Allen Druze . . . . . . . . . . . 3 pts - That's the popular escape route; the swim, circle, head for shore, and run!
- Frank Mullin . . . . . . . . . 3 pts - Great use of parametric positions 100 exp(i t/25) vs. 25 sin(t/25) exp(-i t/25)
- Ravi Raja . . . . . . .. . . . . . 2 pts - That's a good general strategy, but swimming the last 86m will get you eaten.
|
|
||||||||||||||||
|






