Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

June 23rd, 2018, 2:08 pm

cuch, your pic shows up as a sign that says "no hotlinking"
I used the bounding box as a rough approximation to the real constraints. Hopefully the minimum does not land up in the empty quarter.
Image
 
User avatar
Collector
Posts: 2572
Joined: August 21st, 2001, 12:37 pm
Contact:

Re: Extremes

July 25th, 2018, 10:08 pm

Warning: Too long on this thread and you guys will end in a love triangle!
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

July 26th, 2018, 3:34 pm

Image
More like viscous cycles if you ask me!
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

August 12th, 2018, 1:22 pm

minimise [$]x + y[$] subject to [$]x^2 + y^2 - 2 = 0[$]
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Extremes

August 12th, 2018, 1:55 pm

minimise [$]x + y[$] subject to [$]x^2 + y^2 - 2 = 0[$]
[$]x^2 + y^2 - 2 = 0[$] is circle radius 2
[$]x=\sqrt{2}\cos\theta[$] and [$]y=\sqrt{2}\sin\theta[$]
[$]x+y=\sqrt{2}(\cos\theta+\sin\theta)=2\sin(\theta+\pi/4)[$]
answer is -2
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

August 20th, 2018, 4:45 pm

minimise [$]x + y[$] subject to [$]x^2 + y^2 - 2 = 0[$]
[$]x^2 + y^2 - 2 = 0[$] is circle radius 2
[$]x=\sqrt{2}\cos\theta[$] and [$]y=\sqrt{2}\sin\theta[$]
[$]x+y=\sqrt{2}(\cos\theta+\sin\theta)=2\sin(\theta+\pi/4)[$]
answer is -2
I agree. Nice approach. At which point does it reach a minimum based on this analysis?
Another approach is to use Lagrange multipliers [$]L(x,y,\lambda) = x + y - \lambda(x^2 + y^2 -2)[$] 
Taking the gradient results in 4 solutions [$]x^2 = 1, y^2= 1, \lambda = +1/2, \lambda = -1/2[$], one of which (-1.-1) is the minimum.

Can your approach be applied to the additional inequality constraint [$] y \geq 0[$]?
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Extremes

August 21st, 2018, 5:47 am

[$]2\sin(\theta+\pi/4)=-2[$] when [$]\theta=5\pi/4[$] which is [$]x=y=-1[$]

[$]y\ge 0[$] would be [$]0\le\theta\le\pi[$] so the constrained minimum would be [$]x+y=-\sqrt{2}[$] at [$]\theta=\pi[$] or [$]x=-\sqrt{2}[$],[$]y=0[$]
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

July 19th, 2020, 11:58 am

How many solutions (find [$]x[$], it's at the end of the square root sign.) does this equation have?

[$]\sqrt[2]{2 + \sqrt[2]{3}}^{\,^x} + {\sqrt[2]{2 - \sqrt[2]{3}}}^{\,^x} = 4[$] have?
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Extremes

July 20th, 2020, 5:43 pm

LHS = 4 for x =2 and -2. What makes it numerically tricky?
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

July 20th, 2020, 6:06 pm

LHS = 4 for x =2 and -2. What makes it numerically tricky?
Correct. What is the train of thought?
What makes you think it is numerically tricky?

How many solutions are then in total?
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Extremes

July 20th, 2020, 6:52 pm

I though that you posted it because it was numerically tricky. Analytically/graphically it's simple: I think my line of though was to chose x which makes LHS rational. And notice that there are two solutions, because the bases of the two summands are smaller and greater than 1 (hence the intercept is 2 <4), and they have opposite monotonicities.
Or it was Leela posting telepathically.
Last edited by katastrofa on July 21st, 2020, 12:27 pm, edited 2 times in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

July 20th, 2020, 7:34 pm

I got it from LI and there many solutions, some overkill. I was interested in how people approach problem solving. I plugged it into Python.. Then I did it mathematically. Why do like like closed solutions?
def F3(x):
    f = math.sqrt(3)
    f2 = 2.0 + f;  f3 = 2.0 - f
    f4 = math.sqrt(f2);  f5 = math.sqrt(f3);
     
    return  math.pow(f4, x) +  math.pow(f5, x) - 4

x0 = -2.0
sol = leastsq(F3,x0)
print("Least Squares IV ", sol) 
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Extremes

July 21st, 2020, 11:46 am

It is better to solve one problem five different ways, than to solve five problems one way.
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Extremes

July 21st, 2020, 9:22 pm

Image