Wikipedia:Reference desk/Archives/Mathematics/2016 July 20

= July 20 =

Four things
I just want to make sure I'm thinking about this right. Given four things, like A, B, C and D, what are the chances you'll get a matching order of any two? I already figured out that there are 6x4 permutations of ABCD. It looks as though for any given pair I "guess", it will only show up twice. So the probability of guessing two in the right order is 2/24. Is there a more mathematically sound approach to arriving at this (hopefully correct) answer? Thanks. Dumnum (talk) 02:35, 20 July 2016 (UTC)


 * So you have ABCD in every possible order, right ? I agree that there are 24 ways to do that.  As for a "matching pair", do you mean AB, BC, or CD, adjacent to each other ?  And are you looking two in adjacent order, like ABCD or CDAB ?  If so, then I agree there are only 2 ways to do that. StuRat (talk) 03:32, 20 July 2016 (UTC)


 * Good question. I think I misunderstood the problem. The problem is to find the probability of finding a matching set of two when trying to guess the order of the four items. So the pattern would then be for a match of 2: XX00 X0X0 X00X 0XX0 0X0X 00XX... meaning 6/24, if I'm not mistaken this time. Dumnum (talk) 03:59, 20 July 2016 (UTC)


 * By brute force: there are nine permutations with zero matches (BADC BCDA BDAC CADB CDAB CDBA DABC DCAB DCBA), eight permutations with one match (ACDB ADBC BCAD BDCA CABD CBDA DACB DBAC), six permutations with two matches (ABDC ACBD ADCB BACD CBAD DBCA), and one with four matches (ABCD). —Tamfang (talk) 06:47, 20 July 2016 (UTC)
 * A more general question would be: among permutations of $$n$$ elements, how many have exactly $$m$$ fixed points (i.e. "matches")? There is no simple analytical answer to that, but Wikipedia has an article on the subject: rencontres numbers.  Tigraan Click here to contact me 10:58, 20 July 2016 (UTC)


 * Interesting. Thanks! Dumnum (talk) 03:15, 21 July 2016 (UTC)

Weighted expression
What are possible values of the following weighted expression w containing the weights w1, w2 with values between 0 and 1:
 * $$w = \frac{w_1\rho_1(w_1) + w_2\rho_2(w_2)}{\rho_1(w_1) + \rho_2(w_2)}$$?

More specifically, how is the position of value w between w1 and w2 influenced by the values of functions rhoi of weights wi?--82.137.10.117 (talk) 09:41, 20 July 2016 (UTC)
 * I'm not sure what you mean exactly, but note that this expression needn't be between $$w_1$$ and $$w_2$$, because $$\rho_1(w_1),\ \rho_2(w_2)$$ can be outside $$[0,1]$$. -- Meni Rosenfeld (talk) 09:47, 20 July 2016 (UTC)


 * More exactly, what is the sensitivity of the expression to different values of $$\rho_i(w_i)$$ set by definition outside $$[0,1]$$ when the values of the weights are fixed to, say, $$w_1 = 0.1$$ and $$w_2 = 0.3$$? (An additional specification would be that the resulting w has an associated value $$\rho(w)$$ between $$[\rho_1(w_1), \rho_2(w_2)]$$.)--82.137.10.117 (talk) 10:02, 20 July 2016 (UTC)


 * A weighted expression would normally have a sum of weights underneath in the fraction. You treat $$\rho$$ as weights but then here talk about the $$w$$ as a weight, which in fact would be a more usual notation. See Weighted arithmetic mean. I'm not certain what is behind the second part you talk about. The nearest I can think is you want a sum of the input weights to be associated with a weighted average. Dmcq (talk) 10:18, 20 July 2016 (UTC)
 * I treat $$\rho_i$$ not as weights but as parameters in a weighted expression with various constraints. It could be assimilated to a weighted average. w is a weight only in association to the parameter $$\rho$$.--82.137.10.117 (talk) 10:49, 20 July 2016 (UTC)
 * People are confused because what you wrote is an expression where the rhos are the weights, if anything. Are you sure you did not mean $$\rho = \frac{w_1\rho_1(w_1) + w_2\rho_2(w_2)}{w_1 + w_2}$$ ? (Compare with what you posted) Tigraan Click here to contact me 11:00, 20 July 2016 (UTC)
 * Perhaps this is a bit unusual situation where terminology could be adjusted to fit the picture. Does the situation changes much in the case of the last mentioned expression compared to the first expression?--82.137.8.197 (talk) 19:34, 20 July 2016 (UTC)
 * Could w from the initial expression lie outside $$[0,1]$$? In what conditions? Or its values are always between $$[0,1]$$ based on w1 and w2 belonging to this interval?--82.137.8.197 (talk) 21:11, 20 July 2016 (UTC)
 * w can be outside $$[0,1]$$ (and actually, take any value), because $$\rho_1(w_1),\ \rho_2(w_2)$$ can be negative. If for example $$w_1=0,\ w_2=1$$, then for any $$x\in\mathbb{R}$$, take $$\rho_2(w_2)=x,\ \rho_1(w_1)=1-x$$, and you get $$w=x$$. (You have a similar solution for any $$w_1,\ w_2$$, as long as they're different.)
 * I'm inclined to think this is an XY question. You have some problem you wish to solve, after thinking about it you came to believe (erroneously) that working with your expression w above will help you, so you ask about that expression. It could help if you tell us what your original problem is, and we might be able to help you come up with a better solution. -- Meni Rosenfeld (talk) 21:39, 20 July 2016 (UTC)
 * Thanks for specifying the values for rhos, an additional restriction that I've forgot to mention consisting in rhos being only greater than zero.--82.137.10.46 (talk) 22:09, 20 July 2016 (UTC)
 * In this case you're good - w is a proper weighted average of $$w_1,\ w_2$$, and so must be between them, and specifically, in $$[0,1]$$. -- Meni Rosenfeld (talk) 08:38, 21 July 2016 (UTC)

Of course the initial expression can have on both numerator and denominator a constant V which simplifies:
 * $$w = \frac{(w_1\rho_1(w_1) + w_2\rho_2(w_2))V}{(\rho_1(w_1) + \rho_2(w_2))V}$$--82.137.8.197 (talk) 21:26, 20 July 2016 (UTC)

The original problem that leads to the discussed expression is about mass balance when mixing equal volumes of two binary solutions of different mass fractions of solute. I've added some details in mixing ratio and I intend to further add extensions of cases.--82.137.11.152 (talk) 22:29, 20 July 2016 (UTC)