Would it be possible to display a random number in a given range? For example, if LimeSurvey is being used out in the field, I would like the ability to have it display a number between 1 and the total number of people in the area (entered by me of course) to select which person to survey.
Did you have a look at the manual how to implement things with Expression Manager? There are some examples of code. I would say, the most obvious thing is that you can't just put the function into the source code like this, because LS doesn't know that it is an equation.
Equations in Expression Manager are usually between { and }.
Have a look at the link about Expression Manager. There are a lot of good examples.