Skip to content
Prev 380579 / 398498 Next

Integer Sample with Mean Dependent on Size

Dear All,
I cannot unfortunately provide any R code, otherwise I would not need to post this in the first place.
I need to generate a sample of N positive non-zero integers such that their mean is *exactly* 2(N-1)/N, i.e. the mean depends on the length of the sample.
For a start, we can assume that every integer in my sample can assume only the values 1, 2 and 3.
Any suggestion is appreciated.
Cheers

Lorenzo