Consider the set $S\_n$ of all strings of length $n$ ($n$ integer, $n \geq 3$)
representing an expression in RPN   

( <http://en.wikipedia.org/wiki/Reverse_Polish_notation>. )


Assumptions (to simplify):


* A string represents always a "valid" expression, where, by "valid", here it is merely meant that when evaluated it will not give an error due to missing operands (the expression is allowed to "have undefined operations" such as division by 0, etc. )
* Each character in a string can be only either an operand or an operator
* All operators have arity equal to 2


Question:


1. What is the probability that one random character picked from a string is an operator ?
2. What is the probability that the $i$-th character of the string is an operator ?


Edit:  

"valid" is to be interpreted as "well-formed" as Andreas Blass rightly noted.



Operator probability in a RPN string
I'm going to assume that "valid" expressions are well-formed in the usual sense. This means that not only are there (as you required) no operators lacking operands but also you do not end up with two or more operands on the stack and no operation to combine them. Such an expression necessarily has $n$ operators and $n+1$ operands for some $n$ (in particular, its length is odd). So the probability of a randomly chosen term in a valid string of length $2n+1$ being an operator is $n/(2n+1)$. (I'll think about question 2 after I emerge from jet lag; at the moment, my brain is 9 hours out of phase with reality.) 


