Page 1 of 1

math question

Posted: Fri Mar 15, 2013 2:33 pm
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 !

Re: math question

Posted: Fri Mar 15, 2013 3:14 pm
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

Posted: Fri Mar 15, 2013 3:17 pm
by Avoraciopoctules
I put the equation f(x) = e^x - x^3 - x into a graphing site and got this:

Re: math question

Posted: Fri Mar 15, 2013 4:01 pm
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.

Posted: Sun Mar 17, 2013 5:04 am
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).

Posted: Sun Mar 17, 2013 5:35 pm
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.

Posted: Fri Dec 13, 2013 4:15 am
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?

Posted: Fri Dec 13, 2013 4:55 am
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.

Posted: Fri Dec 13, 2013 7:24 am
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

Posted: Fri Dec 13, 2013 7:41 am
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.

Posted: Fri Dec 13, 2013 8:13 am
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.

Posted: Fri Dec 13, 2013 8:52 pm
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.

Posted: Sat Dec 14, 2013 12:09 am
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.

Posted: Sat Dec 14, 2013 1:04 am
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.

Posted: Sat Dec 14, 2013 3:35 am
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.

Posted: Sat Dec 14, 2013 4:43 am
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%.

Posted: Sat Dec 14, 2013 11:29 am
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

Posted: Sat Dec 14, 2013 5:04 pm
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. :)