Wikipedia:Reference desk/Archives/Mathematics/2017 March 26

= March 26 =

Cross product derivative
How to prove

without any guessing and checking both sides, because doing that sounds to me like assuming the equation is already true? יהודה שמחה ולדמן (talk) 18:45, 26 March 2017 (UTC)


 * You can just write x and y (vector valued functions) componentwise, and then apply the definition of the cross product, and use the product rule for the derivative. No guessing required (or assuming anything you shouldn't). --Deacon Vorbis (talk) 19:14, 26 March 2017 (UTC)
 * The same as with any other product of functions – using the derivative's definition and properties of limits:
 * $$\frac{d}{dt}(\vec x\times\vec y)=\lim\limits_{\delta t\to0}\frac{\vec x(t+\delta t)\times\vec y(t+\delta t)-\vec x(t)\times\vec y(t)}{\delta t}=\lim\limits_{\delta t\to0}\frac{\vec x(t+\delta t)\times\vec y(t+\delta t)-\vec x(t)\times\vec y(t+\delta t)}{\delta t}+\lim\limits_{\delta t\to0}\frac{\vec x(t)\times\vec y(t+\delta t)-\vec x(t)\times\vec y(t)}{\delta t}=$$
 * $$\lim\limits_{\delta t\to0}\frac{\vec x(t+\delta t)-\vec x(t)}{\delta t}\times\lim\limits_{\delta t\to0}\vec y(t+\delta t)+\lim\limits_{\delta t\to0}\vec x(t)\times\lim\limits_{\delta t\to0}\frac{\vec y(t+\delta t)-\vec y(t)}{\delta t}=\frac{d\vec x}{dt}\times\vec y+\vec x\times\frac{d\vec y}{dt}$$
 * Ruslik_ Zero 19:42, 26 March 2017 (UTC)

OK, almost done. But how do you prove distribution $$\vec a\times(\vec b+\vec c)=(\vec a\times\vec b)+(\vec a\times\vec c)$$ ? And is it distributive also over subtraction? יהודה שמחה ולדמן (talk) 21:11, 26 March 2017 (UTC)
 * Fine, I had to find it myself:

$$\begin{align} &\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\times\left(\begin{pmatrix}b_1\\b_2\\b_3\end{pmatrix}+\begin{pmatrix}c_1\\c_2\\c_3\end{pmatrix}\right) =\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\times\left(\begin{pmatrix}b_1+c_1\\b_2+c_2\\b_3+c_3\end{pmatrix}\right) =\begin{pmatrix}a_2(b_3+c_3)-a_3(b_2+c_2)\\a_3(b_1+c_1)-a_1(b_3+c_3)\\a_1(b_2+c_2)-a_2(b_1+c_1)\end{pmatrix} =\begin{pmatrix}a_2b_3+a_2c_3-a_3b_2-a_3c_2\\a_3b_1+a_3c_1-a_1b_3-a_1c_3\\a_1b_2+a_1c_2-a_2b_1-a_2c_1\end{pmatrix}\\ &=\begin{pmatrix}a_2b_3-a_3b_2+a_2c_3-a_3c_2\\a_3b_1-a_1b_3+a_3c_1-a_1c_3\\a_1b_2-a_2b_1+a_1c_2-a_2c_1\end{pmatrix} =\begin{pmatrix}a_2b_3-a_3b_2\\a_3b_1-a_1b_3\\a_1b_2-a_2b_1\end{pmatrix}+\begin{pmatrix}a_2c_3-a_3c_2\\a_3c_1-a_1c_3\\a_1c_2-a_2c_1\end{pmatrix} =\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\times\begin{pmatrix}b_1\\b_2\\b_3\end{pmatrix}+\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\times\begin{pmatrix}c_1\\c_2\\c_3\end{pmatrix} \end{align}$$
 * יהודה שמחה ולדמן (talk) 07:32, 27 March 2017 (UTC)

Statistics in the REAL WORLD with cupcakes
This is NOT a homework problem but I want to know how to do statistics in the REAL WORLD. Say I sell cupcakes in my store and everyday I baked 100 cupcakes before I open my store for business. My customers buy cupcakes from me and sometimes I have to turn away customers because I have sold out all my cupcakes. If the cupcakes are very costly to make and I cannot afford to make lots and lots of cupcakes because any cupcakes not sold is costing me money.

I have reason to believe the number of cupcakes my customers want to buy in a day is a normal distribution. But how can I calculate its value (aka mean and variance) when my data is something like this. Note: 100+ means I sold 100 cupcakes and had to turn away customers due to lack of cupcakes.

Data is {88,98,88,100+,96,100+,71,98,92,98,83,99,91,95,96,100+,100+,81,100+,91,98,76,100,90,96,98,96,95,96,96}

148.182.26.69 (talk) 23:40, 26 March 2017 (UTC)
 * If this is the data you have available, what you want is Maximum likelihood estimation. The normal distribution has two parameters, mean $$\mu$$ and standard deviation $$\sigma$$. Given the parameters, you can calculate the probability density of your data $$P(D|\mu,\sigma)$$. Each datapoint contributed a multiplicative term to the density - for the exact numbers you use the PDF and for ranges you use the CDF. Once you have this expression, you need to find the values of the parameters that maximize it.
 * In practice you will generally maximize the logarithm of the density rather than the density itself. It is equivalent but easier to work with.
 * For the data you gave, for example, the result is $$\mu = 94.3673,\ \sigma = 8.37915$$. -- Meni Rosenfeld (talk) 23:55, 26 March 2017 (UTC)

I got mean=94.5 and stdev=8.55 using the Maxima source code below. 148.182.26.69 (talk) 01:28, 28 March 2017 (UTC)


 * "I have reason to believe the number of cupcakes my customers want to buy in a day is a normal distribution."
 * In a real world situation you would not make that assumption as you would end up severely underestimating the effects outliers. The normal distribution breaks down a few standard deviations away from the mean, beyond this region it will give astronomically low probabilities while in the real world such events will have a low, but not astronomically low probability. Count Iblis (talk) 22:09, 28 March 2017 (UTC)

As the number of cupcakes sold is a non-negative integer, the distribution is not a normal distribution, which assumes both negative and non-integer values. It is more reasonable to assume a Poisson distribution. Note that the Poisson distribution has mean value L and standard deviation √L, so there is only one parameter to estimate. Replacing 100+ with 101, your 30 data values have mean value 93.7 and standard deviation 9.7. Now the problem is to find a number L such that the Poisson distribution with parameter L, truncated such that outcomes greater than 101 are replaced by 101, have mean value 93.7 and standard deviation 9.7. I haven't got the time to do it right now. Bo Jacoby (talk) 10:53, 29 March 2017 (UTC).
 * If there are N potential customers in town who each day decide independently from each other and from their past decisions to buy a cupcake or not with probability p each, the resulting binomial distribution is close to a Gaussian with mean pN and variance Np(1-p). That sounds to me like a reasonable model, at least compared to the simplest Poisson-yielding alternative of a constant stream of many possible customers that decide or not to go through the door. Tigraan Click here to contact me 11:11, 29 March 2017 (UTC)
 * It has mean pN and variance Np(1-p), but it is not necessarily close to a Gaussian. If N is big and p is small, then it is close to a Poisson distribution. Bo Jacoby (talk) 23:20, 29 March 2017 (UTC).
 * ...but also to a Gaussian near the mean. Going by the original post, the cupcake-maker wants to optimize for the average day, and does not really care if he made tons of additional cupcakes or refuses tons of customers once every zillion years. So the shape of the tails does not really matter here; and then, if N is small, Gaussian is better, and if N is large both Gaussian and Poisson are equivalent.
 * Yes, the problem would be quite different if (say) customers are irritable mafiosi and the cupcake maker puts the highest priority on being able to serve all customers no matter the cupcake waste; but even then, I doubt it would be wise to use the Poisson approximation for the tails, even if it is better than the Gaussian. Tigraan Click here to contact me 11:18, 30 March 2017 (UTC)
 * If Np=1 and N is big, then the binomial distribution does not at all look like a Gaussian, but very much like a Poisson with L=1. Bo Jacoby (talk) 21:23, 30 March 2017 (UTC).
 * But Np is much greater than 1 (by the dataset presented, a reasonable estimate would be around 90-100), and a Poisson with L>>1 is very similar to a Gaussian near the center (which, again, is the area of interest). Tigraan Click here to contact me 15:15, 31 March 2017 (UTC)

A Poisson distribution with parameter 95.5, truncated such that outcomes greater than 100 are replaced by 101, has mean value 93.7 and standard deviation 7.3. The following J code did the brute force calculation. n=.i.150 f =. 3 : '({.,%:&({:-*:&{.))}.(%{.)+/((101<.n)^/i.3)*(y^n)%!n'"0  5j1":f 95 95.5 96 93.4 7.5 93.7  7.3 94.1  7.2 Bo Jacoby (talk) 08:03, 31 March 2017 (UTC).