Displaying 3 results from an estimated 3 matches for "blockparts".
2007 Nov 19
2
All nonnegative integer solution
Dear all,
Is there any method in R to find all possible nonnegative integer
solutions to the linear equation with unit coefficients as follow:
X1+X2+...+Xk=N
Thank you,
Amin Zollanvari
2008 Nov 14
1
Generating unique permutations of a vector
Hi all,
I try to generate sets of strategies that contain probability
distributions for a defined number of elements, e.g. imagine an
animal that can produce 5 different types of offspring and I want to
figure out which percentage of each type it should produce in order to
maximize its fitness. In order to do so, I need to calculate the fitness
for all potential strategies. As an example, if I
2009 Dec 19
4
expand.grid game
Dear list,
In a little numbers game, I've hit a performance snag and I'm not sure
how to code this in C.
The game is the following: how many 8-digit numbers have the sum of
their digits equal to 17?
The brute-force answer could be:
maxi <- 9 # digits from 0 to 9
N <- 5 # 8 is too large
test <- 17 # for example's sake
sum(rowSums(do.call(expand.grid, c(list(1:maxi),