2
$\begingroup$

I am trying to explain R code:

(1:n)/(n+1) 

such that:

> n <- 4 > (1:n)/(n+1) [1] 0.2 0.4 0.6 0.8 

I might use

$\frac{\{1, \ldots ,n\}}{n+1}$

Is that okay? It seems to imply $n\neq1$. Does it?

  • 0
    @Egbert, not sure if I understand fully, so I posted a [question on SE](http://stackoverflow.com/q/10924655/513006) to follow up on this discussion.2012-06-07

1 Answers 1

3

A lot of people are going to be completely mystified if you write $\frac{\{1, ... ,n\}}{n+1}$ I think you would do better to write this: $\frac1{n+1},\cdots,\frac n{n+1}$

Note that there are no curly braces, which would imply that the result was a set, rather than a sequence.

Perhaps you could write the first one if you first explained that it means the second one.

My suggestion does not imply $n\ne 1$. $n=1$ is perfectly okay, and in that case the expression means a sequence with one element.

R most likely generates an empty sequence when $n=0$; check this. If not, mention it explicitly. Depending on your audience, you might want to mention it anyway.

  • 0
    I wouldn't. I would use some other sort of braces.2012-06-07