Wikipedia:Reference desk/Archives/Mathematics/2011 March 12

= March 12 =

Random reverse Polish notation question
I was just wondering what something like (7x2 + 5x + 1)/(3x − 6) would look like in reverse Polish notation. Although, now that I think about it, maybe it can't be done or just isn't done. It seems that this notation is mostly used for evaluating expressions, but I see no reason that it can't be used for more algebraic things. So, can it be done, and if so how? 10:42, 12 March 2011 (UTC) —Preceding unsigned comment added by 98.185.234.63 (talk)
 * 7x2^*5x*+1+3x*6−/, or, if we decide − ought to be unary, 7x2^*5x*+1+3x*6−+/. Algebraist 11:02, 12 March 2011 (UTC)
 * Every expression can be represented in reverse polish notation without parentheses, assuming you've established how many arguments each operation requires. You can convert an expression of infix operators to postfix by converting the outermost operation first (ie, (some-expression) op (some-other-expression) to some-expression some-other-expression op), then converting the deeper expressions, eliminating the parentheses along the way.


 * BTW, the associative law written in postfix looks like "abc++ = ab+c+". --COVIZAPIBETEFOKY (talk) 15:39, 12 March 2011 (UTC)
 * Shouldn't it be "a b c + + a b + c + =" with the equality sign at the end? Bo Jacoby (talk) 12:27, 14 March 2011 (UTC).
 * Hm. Technically, yes. Of course I was indicating the two expressions which should be equal according to the associative law, written in postfix, and not thinking about applying postfix to the statement of equality itself. --COVIZAPIBETEFOKY (talk) 15:36, 14 March 2011 (UTC)
 * There are some other problems you need to deal with other than arities. For example, you need a way of distinguishing between 123+=1+23 and 123+=12+3. Algebraist 21:03, 12 March 2011 (UTC)
 * Yeah, so you also need spaces to separate the parameters. Is that all, or was there something else you were thinking of as well? --COVIZAPIBETEFOKY (talk) 04:22, 13 March 2011 (UTC)
 * That's all I was thinking of. I suppose another potential problem would be dealing with infinitary operations. I guess you'd either allow infinite strings in some way or replace the infinitary operation with an unary operation on sequences, or just decide not to use postfix notation at all for such things. Algebraist 04:29, 13 March 2011 (UTC)
 * See also: Forth (programming language). 93.95.251.162 (talk) 15:45, 15 March 2011 (UTC) Martin.

Flipping coins
Me and my friend are flipping a weighted coin w a p probability of heads a number of times (p>0.5) and betting $1 even money on heads on each flip. We stop flipping the coin when we hit x dollars. What would be a fair over/under of number of games we end up playing? Also, what would be a fair over/under if my friend would lay me odds such that I only have to win the bet w a probability of q? I need this for a poker propbet. Thanks 93.141.6.170 (talk) 11:54, 12 March 2011 (UTC)


 * Do you have an infinite amount of money to bet ? If not, the possibility exists that you can run out, and this would enter into the calcs, depending on your stake. StuRat (talk) 21:30, 12 March 2011 (UTC)


 * In theory no, but in practice I'm rolled well enough to weather a bad luck run of 6-7 standard deviations below the mean so I think we can ignore that possibility. 93.136.39.209 (talk) 20:21, 13 March 2011 (UTC)


 * You might like to take a look at our spread betting article. Also, take a look at the Poisson distribution and Skellam distribution articles. — Fly by Night  ( talk )  00:01, 13 March 2011 (UTC)


 * Yes I think Skellam is what I was after although I'll have to read that article a few times to fully understand it; so far I've never needed anything beyond binomial and normal distribution so this is very new to me. Thanks to both of you for answering my question, I appreciate it. 93.136.39.209 (talk) 20:21, 13 March 2011 (UTC)


 * Your welcome. Note that another approach is to do a computer simulation of, say, a million trials, with different under/over values to determine which is the "fairest".


 * I'm going to mark this question as resolved. Please remove the resolved tag if that article doesn't answer all your questions. StuRat (talk) 22:38, 14 March 2011 (UTC)

Linear Algebra help
Hello, I am stuck in a Numerical Linear Algebra problem, which is to solve the system in the form $$A(X^{t=n+1})\cdot X^{t=n+1}=B(X^{t=n})$$, where $$A$$ is a tridiagonal matrix. $$A$$ is a function of $$X$$ calculated at time $$t = n+1$$. I am assuming initial guess for $$X^{t=n+1}=X_0^{t=n}$$, then I calculate $$A$$, then I solve the system to get the new values of $$X^{t=n+1}$$. I repeat the procedure for convergence, but my system never seems to converge. Can anybody suggest some other approach via let's say splitting of $$A$$ or something cleverer. Thanks. - 14.139.128.12 (talk) 20:40, 12 March 2011 (UTC)


 * Your notation appears to be a bit nonstandard -- if you have a sequence of successive values of X, it is more common to name those with subscripts $$X_0$$, $$X_1$$, ..., $$X_n$$ instead of $$X^{t=n}$$. Or am I misunderstanding you.
 * Are you sure that the matrix A really depends on X? It would be a more standard linear algebra situation if A was a fixed matrix such that its product with X depends on X. If A does depend on X, you probably need to be more specific about what this behavior is before we can help much. Similarly for B, if $$B(X^{t=n})$$ does not mean just a fixed matrix multiplied by $$X_n$$ from the right.
 * If you can compute the matrix A without necessarily knowing X, your plan would be to invert A and multiply your equation with the inverse from the left. –Henning Makholm (talk) 00:40, 13 March 2011 (UTC)


 * First of all thanks a lot for showing interest to help me. In the current problem, $$X$$ is a column vector to be obtained as a solution of Linear system but the Coefficient matrix $$A$$ is the function of column vector $$X$$ and thus it's sort of implicit problem. The $$R.H.S.$$ contains a column vector $$B$$ which is again depending on $$X$$ at last time step. As,I know the value of $$X$$ at last time step, I know the $$B$$. In my first post, I mean the same by $$B(X^{t=n})$$.
 * Coefficient matrix $$A$$ is depending on column vector $$X$$ (which itself is the solution to be obtained), through some numerical schemes (Finite difference).Can u please suggest any standard algorithms to solve such kind of implicit Linear System? —Preceding unsigned comment added by 14.139.128.12 (talk) 10:36, 13 March 2011 (UTC)


 * Unfortunately, if your A is so secret that "some numerical schemes" is all you can disclose about it, I doubt anyone will be able to help you. –Henning Makholm (talk) 13:56, 13 March 2011 (UTC)