Jump to content

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

From Wikipedia, the free encyclopedia
Mathematics desk
< March 11 << Feb | March | Apr >> March 13 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


March 12

[edit]

Random reverse Polish notation question

[edit]

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)[reply]
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)[reply]
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).[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
See also: Forth (programming language)#Programmer's perspective. 93.95.251.162 (talk) 15:45, 15 March 2011 (UTC) Martin.[reply]

Flipping coins

[edit]
Resolved

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)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]

Linear Algebra help

[edit]

Hello, I am stuck in a Numerical Linear Algebra problem, which is to solve the system in the form , where is a tridiagonal matrix. is a function of calculated at time . I am assuming initial guess for , then I calculate , then I solve the system to get the new values of . 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 or something cleverer. Thanks. - 14.139.128.12 (talk) 20:40, 12 March 2011 (UTC)[reply]

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 , , ..., instead of . 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 does not mean just a fixed matrix multiplied by 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)[reply]
First of all thanks a lot for showing interest to help me. In the current problem, is a column vector to be obtained as a solution of Linear system but the Coefficient matrix is the function of column vector and thus it's sort of implicit problem. The contains a column vector which is again depending on at last time step. As,I know the value of at last time step, I know the . In my first post, I mean the same by .
Coefficient matrix is depending on column vector (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)[reply]
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)[reply]