Wikipedia:Reference desk/Archives/Mathematics/2008 January 9

= January 9 =

fuzzy logic 2
fuzzy logic in washing machines09:38, 9 January 2008 (UTC)
 * See Fuzzy Logic. -- Meni Rosenfeld (talk) 09:42, 9 January 2008 (UTC)
 * And don't forget to clean the filter afterwards. --Lambiam 21:36, 9 January 2008 (UTC)


 * While you guys are making fun, the question does have basis in reality, even if the questioner has mistaken the Ref Desk for a search engine. In fact, it's not even necessary to go off Wikipedia, the fuzzy logic article states "Fuzzy logic can be used to control household appliances such as washing machines (which sense load size and detergent concentration and adjust their wash cycles accordingly)".  -- LarryMac  | Talk  21:44, 9 January 2008 (UTC)
 * Links to fuzzy logic didn't seem to help with the OP's previous question on the issue. -- Meni Rosenfeld (talk) 08:42, 10 January 2008 (UTC)

How to write and chart indifference curves?
I'm currently working on the article on AD-AS model. I'd like to create a chart drawing the model. It's very easy to draw, but I want it to be drawn to scale. What programs are good for drawing indifference curves used in Economics? I only have an introductory education in economics combined with my own independent research. How indifference curves are used isn't covered until the intermediate level.

For examples of the kinds of curves I'm talking about, search for "AD-AS model" on Google images or see Supply and demand, Indifference curve, and Keynesian cross. I've never taken a course on Calculus and it's been a long time since I took Pre-Calc. I think I can figure out indifference curves if someone could post the basic mathematical functions representing Supply and demand. If you could post that function on Supply and demand, it would also be very useful. Zenwhat (talk) 10:06, 9 January 2008 (UTC)
 * Supply and demand depend on enormously many factors in complicated ways. There is no simple "one-size-fits-all" function which can accurately describe this phenomenon in generality. Of course, you can try using some approximation - for demand, I think an exponential function, $$D=\alpha e^{-\beta P}\;\!$$, can give a reasonable fit. For supply, I have no idea.
 * I don't know about drawing programs, but some here do so you will eventually get an answer. -- Meni Rosenfeld (talk) 10:35, 9 January 2008 (UTC)


 * It seems possible to use one of MATLAB compatible programs to get the graph (for example, GNU Octave), or some sort of spreadsheet... --Martynas Patasius (talk) 11:14, 9 January 2008 (UTC)
 * I had attempted before to use exponential functions to draw supply and demand using a basic spreadsheet. The supply curve can be drawn through a simple exponential function (y=x^2). I was going absolutely nuts, though, trying to figure out how to draw the demand curve. I'm going to post this same question in humanities, to see if there are any economists there that can answer. Zenwhat (talk) 14:45, 9 January 2008 (UTC)
 * $$y=x^2\;\!$$ isn't exponential, it's quadratic. It's trivial to find a function that will look like the one on those graphs, the hard part is to find one which will actually reflect reality in some way. Did you understand what I suggested for the demand? -- Meni Rosenfeld (talk) 14:54, 9 January 2008 (UTC)
 * Of course, if all you want is something that just looks nice, use something like $$y=a(x-b)^2+c$$, where $$b \le 0$$ for supply and b is large for demand. -- Meni Rosenfeld (talk) 14:59, 9 January 2008 (UTC)
 * I feel a bit confused about your question. Indifference curve is a microeconomic term. Though you could find easily the answer to how to draw them, I'm not sure if that's what you want, since you are apparently working on Macroeconomic stuff. Meni has given you some answers for drawing something that could look like aggregate demands or supplies. That's basically all you need to know, since no one really cares to calculate such curves, they are basically an abstraction to understand macroeconomic equilibrium.
 * Just for the record, drawing indifference curves is easy: take the Cobb-Douglas case:
 * $$u(x,y)=x^\alpha y^{1-\alpha}.$$

Then, for utility level U, the indifference curve is given by
 * $$y=(U x^{-\alpha})^\frac {1}{1-\alpha}.$$
 * For drawing such curves, I use a CAS [Mathematica], but I remember struggling a bit with spreadsheets before, and it works. Pallida  Mors  17:04, 9 January 2008 (UTC)
 * Oh, a point I forgot: you may want to get an inverse expression: Although we economists rotate ordinate/abscissa axes, poor programs aren't economists. And let me give you an additional hint on formulations: Take
 * $$P=A X^B+C.$$
 * Just play with those coefficients until you find a nice curve. For demand, A and B must have different signs. Together with A, B determines convexity. Pallida  Mors  17:20, 9 January 2008 (UTC)
 * Pallida, indifference curve is a microeconomic theory, but they're used extensively in Macroeconomics. See New Keynesian economics and Mainstream economics (Keynesianism built on microeconomic models). Hence, I slapped a factual inaccuracy tag on Indifference curve. Also, I think I misspoke when I called the Keynesian cross an indifference curve. That's all correct, right? Isn't Thanks for your help! Zenwhat (talk) 22:44, 9 January 2008 (UTC)


 * Ehm... I haven't really see indifference curves in "new" macroeconomic texts. I have seen of course other microeconomic topics, like utility maximization, representative-agent models, etc. It's alright if you're interested in indifference curves. Bear in mind though that they don't represent utility functions by themselves, they just represent a contour, or level set, of the utility function. Thus, Keynesian cross is not related to such curves. Pallida  Mors  16:34, 10 January 2008 (UTC)

By the way, it looks like the required images have already been created for Lithuanian Wikipedia (lt:AS-AD modelis, Image:IS LM model.svg). Probably you would only have to translate them into English (or ask the author to do so). --Martynas Patasius (talk) 01:25, 10 January 2008 (UTC)
 * Those aren't the same, I don't think. Anyone, feel free to correct me if I'm wrong here (I'll check my textbook), but the basic model of AD/AS looks just like the basic model of Supply and demand:


 * [[Image:Price_of_market_balance.svg]]


 * In the Keynesian model (probably the one he used in his General Theory), the demand curve is logarithmic rather than linear, because it's almost flat on the leftward-half of the graph, then shoots back up on the rightward half, so it looks more like this. I really ought to get a textbook on Intermediate economics. Zenwhat (talk) 01:49, 10 January 2008 (UTC)


 * Well, I have always see those curves as convex functions, but I can't recall any reason for it besides a graphical tradition. Anyway, Monetarists and Keynesians would argue a lifetime about the form of the aggregate supply, so I wouldn't worry too much about a specific formulation. For most people, they represent, as I said above, an abstraction. That said, there exist specialists dedicated to calibrate and estimate IS-LM and AD-AS models. Pallida  Mors  16:34, 10 January 2008 (UTC)

Non-recurring and non-terminating numbers(irrational numbers)
How do we prove or see that a number such as pi is non-recurring and non-terminating? What is the formula for it? On another note, when were the Roman, Mayan and Greek numerals first used/invented/discovered? How were they discovered? DISCLAIMER: this is not homework nor any competition question. It is only for my own reference and reading but I could not find the answer. I would appreciate if anyone can help me. —Preceding unsigned comment added by Invisiblebug590 (talk • contribs) 12:48, 9 January 2008 (UTC)
 * See A simple proof that &pi; is irrational, Roman numerals, Maya numerals and Greek numerals. -- Meni Rosenfeld (talk) 13:02, 9 January 2008 (UTC)
 * I saw a proof of e's irrationality a while back - it wasn't particularly nice. mattbuck (talk) 13:12, 9 January 2008 (UTC)


 * Simple proof that e is irrational - Suppose e is rational. Then e = a/b for some integers a and b. So b!e = a(b-1)! is an integer. But


 * $$b!e - \sum_{k=0}^b \frac{b!}{k!} = \sum_{k=b+1}^\infty \frac{b!}{k!} < \sum_{k=1}^\infty \frac{1}{(b+1)^k}=\frac{1}{b}$$
 * $$\Rightarrow \sum_{k=0}^b \frac{b!}{k!} < b!e < \sum_{k=0}^b \frac{b!}{k!} + \frac{1}{b}$$
 * Therefore b!e cannot be an integer, so e cannot be rational. I think that proving that e is transcendental is much more difficult. Gandalf61 (talk) 15:18, 9 January 2008 (UTC)


 * I don't think much is known about how some of the old numeral systems were invented (I call it invented and not discovered). We have articles about Roman numerals, Maya numerals, Greek numerals. PrimeHunter (talk) 16:54, 9 January 2008 (UTC)


 * We have articles on Proof that e is irrational and Proof that π is irrational. There is a chapter on irrational numbers in Hardy & Wright's Introduction to the Theory of Numbers, which includes proofs that general nth roots; e and its rational powers; and π are irrational. It also says that eπ is known to be irrational. Interestingly, it is still not known whether πe is irrational. Gandalf61 (talk) 14:38, 10 January 2008 (UTC)

Second-order nonlinear ODE
Does the differential equation
 * $$\frac{d^2x}{dt^2} = -\sin x$$

have an analytic solution? It arises in the equation of motion of a rigid pendulum, such as a pendulum ride at an amusement park.

Also, some of my friends insist on rewriting the equation this way:
 * $$-\frac{1}{\sin x}d^2x = dt^2$$

and then trying to integrate twice or something. I tried to tell them that this is a meaningless manipulation of symbols, but they still think this approach might be fruitful. How can I convince them that this will never work? —Keenan Pepper 16:41, 9 January 2008 (UTC)
 * Of course the equation has an analytic solution, and you can find the coefficients of its Taylor expansion using any of your favorite methods. To the best of my knowledge, it is not elementary, though.
 * I don't think this string of symbols is any less meaningful than, say, $$y\ dy=dx\;\!$$. The only difference is that the latter allows a solution via a simple transformation, and the former does not. The only way to convince them that this is futile is to let them try and fail (and point out any specific errors in their attempts). -- Meni Rosenfeld (talk) 17:14, 9 January 2008 (UTC)
 * Also, check out Pendulum (mathematics) and Jacobi's elliptic functions. The solution, for $$x(0)=0,x'(0)=1$$ is given in Mathematica notation as 2JacobiAmplitude[t/2,4], but I don't know how that translates to traditional notation. -- Meni Rosenfeld (talk) 17:29, 9 January 2008 (UTC)
 * Mathematica's  and   give me essentially $$2\,\operatorname{am}\!\!\left(\left.\frac t2\right|4\right)$$. --Tardis (talk) 17:34, 9 January 2008 (UTC)
 * I meant analytic in the sense of . It's enough to know that it's a Jacobi elliptic function. What my friends were doing couldn't possibly produce that, so it's obviously wrong. =) Thanks! —Keenan Pepper 20:56, 9 January 2008 (UTC)
 * I figured this was the intention, but it's just been so long since I've last encountered "analytic" used this way. -- Meni Rosenfeld (talk) 21:01, 9 January 2008 (UTC)
 * [edit conflict] See pendulum (mathematics): no. As far as integrating, one can rewrite the equation as $$\frac{dv}{\sin x}=-\,dt$$, then express x (which is really an angle) in terms of v via the conservation of energy argument outlined in the main pendulum article and integrate.  However, the expression is $$\sin x=\sqrt{1-\left(\frac{rv^2}{2g}+\cos\theta_0\right)^2}$$ where r is the length of the pendulum, g is of course gravity, and $$\theta_0$$ is its maximum displacement, so the integration over v (which is really an angular velocity) might be a bit interesting.  As for explaining to your friends, you might point out that $$\frac{d^2x}{dt^2}=\frac{d(dx/dt)}{dt}$$, and so you can't actually get the two $$dt$$s out: the original notation is a confusion of $$\left(\frac d{dt}\right)^2$$, where multiplication is used to represent operation in the usual fashion.  --Tardis (talk) 17:34, 9 January 2008 (UTC)
 * I disagree with the assertion that the notation $$\frac{d^2x}{dt^2}$$ is a confusion of $$\left(\frac{d}{dt}\right)^2x$$. The Leibniz notation can be given meaning for higher orders just like for first order. We are comfortable with dt being an infinitesimal change in t, and $$dx=x(t+dt)-x(t)$$ being the corresponding change in x. $$dt^2$$ is just that - the product of dt with itself. Then $$d^2x=d(dx)$$ (d itself is an operator, thus in its context multiplication means application, or composition) is the infinitesimal change in dx, $$d^2x=dx(t+dt)-dx(t)=(x(t+2dt)-x(t+dt))-(x(t+dt)-x(t))=x(t+2dt)-2x(t+dt)+x(t)\;\!$$. You can then plainly see that $$\frac{d^2x}{dt^2}$$ indeed gives the second derivative. -- Meni Rosenfeld (talk) 18:13, 9 January 2008 (UTC)
 * Hm, you're right. I was too focused on finding a "square root" of the whole object; it didn't occur to me that one of the ²s might be a true squaring and the other an operator power.  Thanks! --Tardis (talk) 21:12, 9 January 2008 (UTC)

Transform the second order equation into two first order equations by introducing the velocity like this
 * $$\frac{dx}{dt} = v$$
 * $$\frac{dv}{dt} = -\sin x$$

Note that the energy
 * $$E=\frac 1 2 v^2 - \cos x$$

is conserved:
 * $$dE = v\cdot dv+\sin x\cdot dx= v\cdot (-\sin x\cdot dt) + \sin x\cdot( v\cdot dt) = 0\cdot dt=0$$

This gives the following relationship between velocity and displacement
 * $$\frac{dx}{dt} =v=(2\cdot E + 2\cdot\cos x)^{\frac 1 2}$$

and the following relationship between time and displacement
 * $$t=\int(2\cdot E + 2\cdot\cos x)^{-\frac 1 2}dx$$

Bo Jacoby (talk) 22:26, 9 January 2008 (UTC)

Cutting Sandwiches
In one of my many physics-induced daydreams i was thinking about cutting sandwiches. Specifically, can you cut a standard square sandwich twice (that is 2 cuts with a knife) and end up with more than 4 bits? Also noticed that something like a zig-zag sandwich _could_ be cut into more than 4 bits, so is there a rule or proof surrounding the number of bits you can cut sandwiches into? One of the more 'interesting' questions on here i expect.. ;) Benbread (talk) 20:21, 9 January 2008 (UTC)
 * I'll assume that the knife cuts can be modelled as straight lines. The relevant feature of a square is that it is convex. Thus, after one cut, each side of the cut is the intersection of convex sets (a square and a half-plane) and is thus itself convex; in particular, it means that it is connected, thus you are only left with 2 pieces. Cutting again is equivalent to cutting each piece separately, and since each of those is convex, once again you get only 2 pieces from each. So no, for a convex shape, like a square, you can only get up to $$2^n$$ pieces with n cuts. For non-convex shapes it could get more complicated. -- Meni Rosenfeld (talk) 20:47, 9 January 2008 (UTC)
 * This had me thinking. For any sufficiently sane set, you can look at its convex hull minus the set itself, and count how many pieces this is made of. This gives us a "non-convexity index", being 0 for convex sets, 1 for simply nonconvex ones, and so on. Has anyone heard of such a thing before? I'm pretty sure the original question can be answered in terms of this non-convexity index of the sandwich. -- Meni Rosenfeld (talk) 20:54, 9 January 2008 (UTC)


 * I'm sure this is true, provided that you define "sufficiently sane" as meaning: the cuttability index can be expressed in terms of the non-convexity index. Otherwise, consider a convex-shaped sandwich from which a fractal bite has been taken by a hungry Koch snowflake in such a way that the non-convexity index equals one. (If necessary we patch up the sandwich a bit at the intersection of the bite and the pre-bite boundary of the sandwich.) By just a single cut in the right way along some edge of one of the straight-edged finite iterations converging to the fractal, we can get infinitely many bits. --Lambiam 21:34, 9 January 2008 (UTC)
 * Yep, that's how I define it! :-) Seriously though, I do not understand your construction. A koch-bitten sandwich obviously has an infinite non-convexity index, and I don't see how you intend to patch it into an index of 1 while maintaining its fractal nature. -- Meni Rosenfeld (talk) 22:45, 9 January 2008 (UTC)


 * As a simpler illustration of Lambiam's point, consider a set in the shape of the letter E (with the middle arm shorter than the other two): it has a non-convexity index of one but can be cut into four pieces with a single cut. Conversely, consider a set in the shape of a gear wheel with 100 short teeth: it has a non-convexity index of 100, but cannot be cut into the expected 100+2 pieces, because no single line intersects more than a few teeth. --mglg(talk) 23:01, 9 January 2008 (UTC)


 * Here's an alternative measure of concavity: Convex sets have concavity zero. If the convex hull of set S, minus S, has concavity n, then S has concavity n + 1. Otherwise S has infinite concavity. Then the letter E has concavity 2, because the convex hull minus the E is a backwards C shape that has concavity 1. The Koch snowflake has infinite concavity. Does that do the trick? —Keenan Pepper 00:33, 10 January 2008 (UTC)
 * I have the impression that for a shape whose boundary is a non-intersecting differentiable loop the concavity (which you could the wiggle count) is half the number of times the curvature around the loop crosses zero. --Lambiam 01:56, 10 January 2008 (UTC)
 * The example of E certainly shows I was being a bit naive with my thinking (regardless of sandwiches, I would want it to have an index of 2, I think). I'll have to ponder some more whether Keenan's suggsestion reflects my intuition. -- Meni Rosenfeld (talk) 08:51, 10 January 2008 (UTC)
 * Thanks everyone for your responses they're humorous if anything else - I think yo've gone beyond my understanding but what i can pick out is very interesting indeed, thank you all :) -Benbread (talk) 08:56, 10 January 2008 (UTC)

The sandwich is supposed to stay fixed during the whole operation of k cuttings, right? If so, your question is equivalent to ask how many connected components are there, at most, in $$ R^2$$minus k straight lines, and the answer is that if the lines are generic (=no two of them are parallel, no three of them pass for the same point), then the number of pieces is maximum and it is
 * $${k \choose 0} +{k\choose 1} + {k \choose 2}=\frac{k^2}{2}+\frac{k}{2}+1,$$

more generally, the complement of the union of k affine hyperplanes in $$ R^d$$ has at most exactly


 * $${k \choose 0} +{k\choose 1}+...+{k \choose d} = \frac{k^d }{d!} + O(k^{d-1})$$

connected components, and the maximum number is reached by any generic choice of the hyperplanes. You can easily prove it by induction. For instance, you can cut a watermelon in $$ R^3$$, with k=0,1,2,3,4  katana cuttings into respectively 1, 2, 4, 8, 15 pieces. Be quick. Notice that the sequence of powers of 2 stops as soon as you pass k=the dimension. I also remember a movie with Charles Bronson, where a bunch of pieces of watermelon were obtained by means of a gun machine. PMajer (talk) 12:38, 10 January 2008 (UTC)
 * Silly me, I also assumed the sandwich is fixed but didn't pay attention to $$2^n$$ not being tight. Anyway, I don't think it follows from the original question that it must be fixed, and if not, going all the way to $$2^n$$ is trivial. -- Meni Rosenfeld (talk) 12:44, 10 January 2008 (UTC)

Just to speak, a much harder question seems: how many ways are there to cut his sandwich with k cuts. Say that we consider equivalent cuttings with the same graph. I don't know the answer. With 4 cuts there is only one way, but with 5 it looks like a mess and I'm not even able to count them. Not to speak of higher dimensions...PMajer (talk) 13:11, 10 January 2008 (UTC)
 * I think you're missing the point here somewhat. Would a six-dimensional sandwich be doubly as delicious as a three-dimensional one? mattbuck (talk) 14:15, 10 January 2008 (UTC)
 * yes and even more, provided your tongue has five-dimensional boundary

I went ahead and thought through what happenes with 3 or more cuts, and in the case of 3 the maximum number of zones I can get is 7, (basically the three lines create a triangle inside the sandwitch) but in the case of 4 there begins to be inefficiencies, I don't believe it is possible for another line to cut all 7 zones created by the first 3 lines. A math-wiki (talk) 19:06, 10 January 2008 (UTC)
 * right, and you can easily prove this, because the fourth line meets at most once each of the preceding ones, therefore it is divided by them into 4 segments at most, and for each segment you get a new piece of sandwich. Thus 4 cuts can make at most 7+4=11 pieces. See the general formula above. —Preceding unsigned comment added by PMajer (talk • contribs) 19:48, 10 January 2008 (UTC)