math question

Mundane & Pointless Stuff I Must Share: The Off Topic Forum

Moderator: Moderators

Post Reply
User avatar
The Vigilante
Master
Posts: 246
Joined: Tue Jun 02, 2009 1:42 am

math question

Post by The Vigilante »

Hello denners, I am currently stomped on a couple of unconstrained optimization questions. Let's see if anyone can lend a hand ! Basically I just need to find the maximum/maxima or minimum/minima and tell if they are local/global and unique/multiple. I know they are optimizable but I don't know how to do the process analytically.

I. f(x) = e^x - x^3 - x
First order condition : f ' (x) = 0
---> e^x - 3x^2 - 1 = 0
e^x = 3x^2 + 1
x ln (e) = ln (3x^2 + 1)
x = ln (3x^2 + 1)

and that's where I'm stuck for this one, I have no idea how to solve for x in that equation.


II. f(x) = cos(x) - e^x
First order condition : f ' (x) = 0
---> -sin(x) - e^x = 0
e^x = -sin(x)
x ln (e) = ln(-sin(x))
x = ln(-sin(x))

same problem here. Any help would be much appreciated !
Yea though I walk through the valley of the shadow of death, I fear no one - for I am the meanest motherfucker in the valley.
User avatar
Avoraciopoctules
Overlord
Posts: 8624
Joined: Tue Oct 21, 2008 5:48 pm
Location: Oakland, CA

Re: math question

Post by Avoraciopoctules »

The Vigilante wrote:Hello denners, I am currently stomped on a couple of unconstrained optimization questions. Let's see if anyone can lend a hand ! Basically I just need to find the maximum/maxima or minimum/minima and tell if they are local/global and unique/multiple. I know they are optimizable but I don't know how to do the process analytically.

I. f(x) = e^x - x^3 - x
First order condition : f ' (x) = 0
---> e^x - 3x^2 - 1 = 0
e^x = 3x^2 + 1
x ln (e) = ln (3x^2 + 1)
x = ln (3x^2 + 1)

and that's where I'm stuck for this one, I have no idea how to solve for x in that equation.


II. f(x) = cos(x) - e^x
First order condition : f ' (x) = 0
---> -sin(x) - e^x = 0
e^x = -sin(x)
x ln (e) = ln(-sin(x))
x = ln(-sin(x))

same problem here. Any help would be much appreciated !
It's been a while since I had any advanced math courses. However:
If x ln (e) = ln(-sin(x)), and x = ln(-sin(x)), then x = x ln (e).

If -sin(x) is = to e^x, then you can make a substitution in this line: ---> -sin(x) - e^x = 0, giving you e^x - e^x = 0
User avatar
Avoraciopoctules
Overlord
Posts: 8624
Joined: Tue Oct 21, 2008 5:48 pm
Location: Oakland, CA

Post by Avoraciopoctules »

I put the equation f(x) = e^x - x^3 - x into a graphing site and got this:
Last edited by Avoraciopoctules on Fri Mar 15, 2013 3:18 pm, edited 1 time in total.
User avatar
Ancient History
Serious Badass
Posts: 12708
Joined: Wed Aug 18, 2010 12:57 pm

Re: math question

Post by Ancient History »

It's been a while since I had any advanced math courses. However:
If x ln (e) = ln(-sin(x)), and x = ln(-sin(x)), then x = x ln (e).

If -sin(x) is = to e^x, then you can make a substitution in this line: ---> -sin(x) - e^x = 0, giving you e^x - e^x = 0
ln(e) = 1, so x = x ln (e) is just the equivalent of saying x = x. Not helpful.

Your derivations look right, but I don't think that your equations reduce much further. (3x^2 + 1) is unfactorable so there's nothing to be gained that way, and algebraic identities won't save you with e^x stuck in there; you're probably best off with the graphing calculator.
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

Post by fectin »

Pretty much. Reduce it to 0 = ln(3x^2+1) - x and you can use Newton's Method, but at that point you may as well just use a calculator.
There's an inflection point at 0, and a global minimum between 4 and 5.

The second has local minima approximately every (2k-1)pi below 0, local maxima approximately every (2k)pi below zero, and a global maximum at 2kpi, k->infinity (i.e, for practical purposes does not have one).
Vebyast wrote:Here's a fun target for Major Creation: hydrazine. One casting every six seconds at CL9 gives you a bit more than 40 liters per second, which is comparable to the flow rates of some small, but serious, rocket engines. Six items running at full blast through a well-engineered engine will put you, and something like 50 tons of cargo, into space. Alternatively, if you thrust sideways, you will briefly be a fireball screaming across the sky at mach 14 before you melt from atmospheric friction.
John Magnum
Knight-Baron
Posts: 826
Joined: Tue Feb 14, 2012 12:49 am

Post by John Magnum »

e^x = 3x^2 + 1 happens to have one obvious solution, x = 0. No negative number can be a solution, since decreasing x from 0 makes e^x smaller and 3x^2 + 1 larger, so they can never be equal. There might be a positive solution, though. Mathematica tells me there's two. The one fectin noticed between 4 and 5, and another one around 0.4.
-JM
User avatar
Maj
Prince
Posts: 4705
Joined: Fri Mar 07, 2008 7:54 pm
Location: Shelton, Washington, USA

Post by Maj »

OK. Resurrection time because I need help...

I read this article in Forbes about Paypal's new SMB loans. There is no interest on these loans - the fee assessed is based on how quickly you choose to repay the loan (based on what percentage of your sales you choose to have Paypal automatically withhold). The peeps at Forbes decided to attempt to translate the Paypal loans into APR, despite the fact that there's no interest on these loans.

I do not understand their math. Here's the maths from Forbes:
Following the original appearance of this article, a finance specialist has offered the following analysis to express the cost of PayPal’s fees as annual interest, which is the terminology borrowers are most accustomed to seeing. In the first example above, using 30% of receipts and a fee of $281 in exchange for a $8000 advance, for an SMB with $100k of annual PayPal transactions ($8,333/mo), the advance would be paid back in 100 days at an annual rate of 25.27%. This is the longest this loan can be outstanding based on PayPal’s 8% cap. For an SMB with $330k of annual Paypal transactions ($27,600/mo), the advance would be paid back in 30 days at an annual rate of 86.3%. Using the example of 10% of receipts and a fee of $947 for an $8000 advance, an SMB with $100k of annual PayPal transactions ($8,333/mo), the advance would be paid back in 327 days at an annual rate of 25.2%. This is the longest this loan can be outstanding based on PayPal’s 8% cap. For an SMB with $330k of annual Paypal transactions ($27,600/mo), the advance would be paid back in 99 days at an annual rate of 83.9%
Here's the page from Paypal on the loan plan.

How do I turn a flat fee into an APR?
Last edited by Maj on Fri Dec 13, 2013 4:33 am, edited 1 time in total.
My son makes me laugh. Maybe he'll make you laugh, too.
John Magnum
Knight-Baron
Posts: 826
Joined: Tue Feb 14, 2012 12:49 am

Post by John Magnum »

Presumably they calculate the total amount you pay and the duration you pay it over. They then figure that the total amount you pay is equivalent to principal + interest, and figure out the interest rate of an ordinary loan where you pay the same amount of interest over the same period of time.
-JM
Username17
Serious Badass
Posts: 29894
Joined: Fri Mar 07, 2008 7:54 pm

Post by Username17 »

"Interest Free" loans, whether they are from Islamic banks, Paypal, or the Mafia, always have an effective interest rate. If the amount you pay back is more than the amount loaned to you, that's interest whether it's called that or not.

A loan has an amount of time you have to pay it back, and a difference between what you repay and what you were given up front. To convert fees for time to interest per year, all you need to do is take fees divided by total loan amount divided by the repayment time times one year. If you want to convert that to compound interest, you're going to need a log function, but these loans are generally structured into periods of less than one year, so whatever.

-Username17
name_here
Prince
Posts: 3346
Joined: Fri Mar 07, 2008 7:55 pm

Post by name_here »

On the other hand, these loans don't have a fixed repayment period, so I question the utility of calculating an effective interest rate. n% of your PayPal income goes to paying off the loan until you've paid it off, so the repayment period varies wildly with the stability of your income stream. Most importantly, if your income crashes the repayment period gets way longer but the amount you owe stays fixed.
DSMatticus wrote:It's not just that everything you say is stupid, but that they are Gordian knots of stupid that leave me completely bewildered as to where to even begin. After hearing you speak Alexander the Great would stab you and triumphantly declare the puzzle solved.
User avatar
tussock
Prince
Posts: 2937
Joined: Sat Nov 07, 2009 4:28 am
Location: Online
Contact:

Post by tussock »

There is no interest on these loans
Well, that's one way of looking at it. Really there is, and they're just getting around the laws that prevent them charging interest on loans by using different words for the same thing.


Anyway, you want an equation for interest (i), when they've given you time to pay (t), initial loan (L), and total payment (P). So it's

( 1+ i ) = ( P/L ) ^ ( 1/t )

So 100 days to pay is ~3.333 monthly payments, 8281 payment, 8000 loan
(8281/8000)^0.3 - 1 = ~1.0% per month, or what a bank would call 12.5%.

Paid over 30 days it's
(8281/8000)^1 - 1 = ~3.5% per month, or what a bank would call 42% (or a credit card company would call crazy low rates of just 3.5% rate quoted is per month).

The Forbes article "expert" is wrong. Most people in the comments are being offered ~18%, which is what you'd expect.
PC, SJW, anti-fascist, not being a dick, or working on it, he/him.
Aharon
Master
Posts: 216
Joined: Mon Jul 27, 2009 9:55 am

Post by Aharon »

FrankTrollman wrote:"Interest Free" loans, whether they are from Islamic banks, Paypal, or the Mafia, always have an effective interest rate. If the amount you pay back is more than the amount loaned to you, that's interest whether it's called that or not.
I'm in a nitpicking mood right now ;-) - there are real interest free loans, but usually not available to the general public. For example, one of the first links that pop up when googling "interest free loan" is http://www.hfls.org/ As the loan-giving organization is a charity, I assume there is no fine print and they finance their overhead expenses via donations.
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

Post by fectin »

Also, there are occasional interest free loans based on the assumption that you will screw up repayment and get charged fees.

And while "interest" usually refers to a percentage of the loan amount, it's a distinction without a difference. You are essentially renting money, and the amount and timing of your rental fees is usually more interesting than arguing about what to call it. From that perspective, translating everything into equivalent APRs is often helpful.
Vebyast wrote:Here's a fun target for Major Creation: hydrazine. One casting every six seconds at CL9 gives you a bit more than 40 liters per second, which is comparable to the flow rates of some small, but serious, rocket engines. Six items running at full blast through a well-engineered engine will put you, and something like 50 tons of cargo, into space. Alternatively, if you thrust sideways, you will briefly be a fireball screaming across the sky at mach 14 before you melt from atmospheric friction.
User avatar
Maj
Prince
Posts: 4705
Joined: Fri Mar 07, 2008 7:54 pm
Location: Shelton, Washington, USA

Post by Maj »

Well, I called my brother - a finance major who works at a bank in the loan department - and he couldn't figure out the numbers in the article. He came up with 12.8% and nothing else.
My son makes me laugh. Maybe he'll make you laugh, too.
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

Post by fectin »

Your brother is probably assuming payback is over the course of a year. If it's over a shorter time, equivalent APR would be higher.

If you borrow $100, and it costs you $5, paying that back over a year is equivalent to 5% APR. Paying it back over 6 months with the same cost is equivalent to 10% APR.
Vebyast wrote:Here's a fun target for Major Creation: hydrazine. One casting every six seconds at CL9 gives you a bit more than 40 liters per second, which is comparable to the flow rates of some small, but serious, rocket engines. Six items running at full blast through a well-engineered engine will put you, and something like 50 tons of cargo, into space. Alternatively, if you thrust sideways, you will briefly be a fireball screaming across the sky at mach 14 before you melt from atmospheric friction.
User avatar
Maj
Prince
Posts: 4705
Joined: Fri Mar 07, 2008 7:54 pm
Location: Shelton, Washington, USA

Post by Maj »

Payback on the loan is 100 days. He's calculating the interest over that period, then spreading it out to a year. Neither of us can even work the problem backwards from the 25.27%.
Last edited by Maj on Sat Dec 14, 2013 4:43 am, edited 1 time in total.
My son makes me laugh. Maybe he'll make you laugh, too.
Username17
Serious Badass
Posts: 29894
Joined: Fri Mar 07, 2008 7:54 pm

Post by Username17 »

Maj wrote:Payback on the loan is 100 days. He's calculating the interest over that period, then spreading it out to a year. Neither of us can even work the problem backwards from the 25.27%.
I also get 12.82%. I have no idea where the 25.27% comes from. It's almost exactly what you'd get if the fees were twice as high as reported, so maybe the actual structure is that you have to pay the fee amount out of the advance and then again at the end?

-Username17
User avatar
Maj
Prince
Posts: 4705
Joined: Fri Mar 07, 2008 7:54 pm
Location: Shelton, Washington, USA

Post by Maj »

Maybe that's what the person who did the math thought, but that's not actually how the loan works. I think the article is just wrong. I really appreciate all the help. Thanks. :)
My son makes me laugh. Maybe he'll make you laugh, too.
Post Reply