2

I am a biologist. My apologies if I my question is too basic.

I am writing a scientific manuscript and I would like to express the following with a correct mathematical expression: for a list of numbers (from $x_1$ to $x_n$) calculate the product of $x_1$ to $x_n$ every time $x$ is above $0$.

Thanks a lot for the help.

mike_
  • 21
  • 1
  • Is what you want the product of all the positive numbers in the list? – David K Feb 13 '18 at 11:41
  • yes, something like this [for (i in 1:length(vector)){while (vector[i]>0){x=vector[i]*x}}] but expressed with correct words or a correct mathematical expression for a scientific manuscript. – mike_ Feb 13 '18 at 11:54
  • I think then there is an answer below that does what you want. – David K Feb 13 '18 at 12:43

1 Answers1

3

You probably look for $$ \prod_{\substack{1\leq j\leq n \\x_j>0}} x_j, $$ where I assume that $x$ above $0$ means $x_j>0$ (you did not define $x$).