Wikipedia:Reference desk/Archives/Mathematics/2008 October 15

= October 15 =

The "bound"/"clamp"/? function
The common function $$f_{l,h}(x):=\begin{cases}l&xh\end{cases}$$ seems to go by the names bound and clamp. The simple ghit test suggests the former name, but that's polluted by such things as Python's bound methods. I don't mean for this to be a poll, but is there a (most-) standard convention of which I'm not aware? --Tardis (talk) 01:34, 15 October 2008 (UTC)
 * Clamp is very commonly used especially in electronics for exactly what you want. I've not seen bound used in the same sense. Dmcq (talk) 08:08, 15 October 2008 (UTC)

conjugate harmonic function
Does anybody know how to fund the conjugate harmonic function of this function:

$$cos\left( 2\,x\,\left( y-2\right) \right) \,{e}^{{x}^{2}-{\left( y-2\right) }^{2}}-3\,x\,{y}^{2}+{x}^{3}$$

I've been trying to solve it using maxima, but taking the x derivative and then integrating with respect to y and vice versa just leaves me with a horrible mess. is there some sort of trick involved?


 * I don't know of a simple way of doing these things, but if you replace y-2 with y' in the first part you might notice something about the result of differentiating to x. In the second two terms just leave y and something similar happens. Might give an idea about what the result is when integrating to y. Just do the two parts separately and add up. Dmcq (talk) 08:26, 15 October 2008 (UTC)


 * Thanks, I've just tried doing it with pencil and paper and it's actually completely trivial. which makes me wonder why the maxima CAS was giving me such a strange answer (containing erfs and imaginary numbers!). I'm usually very lazy when it comes to differentiation and integration and my first resort is to use a CAS, but in this case it looks like the CAS can't do it properly. That's weird, but at least in future I'll know that you can't always rely on the computer for this sort of thing. —Preceding unsigned comment added by Damian Eldridge (talk • contribs) 08:46, 15 October 2008 (UTC)


 * Aargh, these whipper-snappers nowadays. Their brains will atrophy, using the computer to bring them pizzas :) I can see where the erf (error function) comes from, brute force can lead to things which are hard to simplify. My pleasure. Dmcq (talk)

Well, it's even simpler. The difficulty is mostly psychological, indeed. Let see. This is clearly an harmonic function from a textbook, not from the real mathematical world, as the simultaneous presence of the exponential and polynomial part indicates (in real life they would fight). Textbooks are supposed to be friendly, and didactic. So, what do they want to teach you? Most likely, a definition: v is conjugate to u iff u+iv is holomorphic. Can you figure out the whole thing, that is, the holomorphic? The polynomial is clearly half of a cube:

$$(x+iy)^3 = (x^3 - 3xy^2) + i(3x^2y -y^3)$$.

The exponential looks more difficult, but we are at the zoo, and it will not bite. So let's replace y-2 with y, as suggested by Dmcq, just to see it better (indeed, whoever invented this exercise, made a substitution of a $$y$$ with a $$y-2$$ as a last touch, because he thought it was too easy otherwise)... now, $$x^2-y^2$$ and $$2xy$$ are real and imaginary part of $$(x+iy)^2$$; $$\cos(2xy)$$ is the real part of $$e^{2ixy}$$... remember, it has to be easy... Can you see it? why not $$e^{(x+iy)^2} $$ ?

Yes, of course:

$$e^{(x+iy)^2}=e^{x^2-y^2}e^{2ixy}=e^{x^2-y^2}[\cos(2xy)+i\sin(2xy)]=e^{x^2-y^2}\cos(2xy)+ ie^{x^2-y^2}\sin(2xy)$$,

and you can see the u and v parts (and don't forget to replace y-2 where it was). You see? It's easy. Remember Kung Fu Panda. There is no secret ingredient. Just be confident! PMajer (talk) 21:10, 16 October 2008 (UTC)

Simple problem re Future Value
I just want to confirm that I've got the approach re future value correct.

If I want to calculate the future value of $1,000 with interest of 8% p.a. in 400 days, is it correct to calculate it like this?


 * $$FV = \$1,000 \cdot (1+8\%)^\frac{400}{365}$$

Or do I have to convert the 8% p.a. rate to a rate over 400 days? —Preceding unsigned comment added by 203.3.186.10 (talk) 03:19, 15 October 2008 (UTC)


 * Your future value expression is correct as long as:
 * The figure of 8% p.a. is an effective interest rate, not a nominal interest rate.
 * The interest is being compounded either continuously or daily. Gandalf61 (talk) 09:21, 15 October 2008 (UTC)

Hmmmm. I'm not so sure because consider the exponent being 730/365 and then the result is the same as if you only earned simple interest (not compound) and the result is the same as 1.08*1.08 which is compound interest but only one period per year, thus you are only earning simple interest, but with 1 compounding point at the end of the 365th day. I have a ba in fin, and its confusing because we're expected to equally learn several different types of interest rates and conversions between them. The main thing which is lacking from your formula is e and/or ln, that's usually an indicator Interest rates by convention are always nominally quoted, usually twice per year, or yearly. So if the 8% is an effective interest rate, then I'd have to dig up my old book, but Gandalf is very smart, so he's probably correct. Sentriclecub (talk) 21:36, 16 October 2008 (UTC)
 * No, 1.08*1.08 is compound interest over 2 years compounded yearly. That's still compound interest, it's just not continuously compounded. If you want the equivalent (ie. same end result) as continuously compounded interest you need to reduce the interest rate from 0.08 to log(1.08)=0.077. Then if you compound continuously, an amount, A, after 2 years becomes $$Ae^{0.077\cdot2}=A 1.08^2$$ which is exactly what you had before. Basically, it doesn't make any difference how often you compound as long as you adjust the interest rate accordingly (there are exceptions when you're doing complicated things but for money in a bank account it's that simple). In the UK most rates you see advertised are annualised effective rates (ie. the rate that it would be if compounded yearly, we call that APR, but I think APR means something different in the US). In maths, you switch between discretely and continuously compounded interest rates depending on what you're doing with them and have to keep track - it's simple enough, (1+r)t means discrete and ert means continuous, it's just important to remember that it isn't the same r! --Tango (talk) 21:51, 16 October 2008 (UTC)
 * In the US, the usual presentation is a pair: the APR is the rate you would get per year for simple interest (which I think is what you said held for the UK), and then there's the APY which is what you really get with whatever compounding is in effect.
 * I think it helps the discrete/continuous comparison if you make the compounding period T explicit: $$F=P(1+r_T)^{t/T}$$, and if we do the usual (but confusing) thing and treat the rate as an expression of simple interest, we have $$r_T=r_0T: \lim_{T\rightarrow0}F=Pe^{r_0t}$$. If, instead, we have daily compounding and a "yearly" given rate, it's easy to do $$r_d=r_0d=r_0y\frac dy=\frac{r_y}{365}$$ and get the effective yearly rate as $$(1+r_d)^{y/d}=\left(1+\frac{r_y}{365}\right)^{365}$$ (for various values of 365). --Tardis (talk) 01:35, 17 October 2008 (UTC)
 * In the UK, APR is the rate with compounding, so what you call APY. I don't see the point in reporting the rate with simple interest, it's a meaningless number (it seems meaningful if you pay the interest every period, but then you're adding cash flows at different times without discounting which means it's still meaningless). --Tango (talk) 15:31, 17 October 2008 (UTC)

Thanks everyone 203.3.186.10 (talk) 07:12, 17 October 2008 (UTC)