take n as any integer variable gT as the total number of groups g2 as the number of groups of size 2 g3 as the number of groups of size 3
we know
gT = g2 + g3
to find the best total number of groups:
gT = 4*round(n/10)
due to the way changing a group from 2 to 3 allows us to count up in increments of 1 it is quite simple
g2 = 3gT - n g3 = -2gT + n
you will see that some values of n are not solvable, such as 13, 14, 15 and of course any n < 8
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 7:16 am
by wub
Oooooo...that looks like just what I was after. Thanks
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 7:49 am
by dmz007
Type "spy" in at the MATLAB terminal. It will blow your mind
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:18 am
by volcanogeorge
is that the one that draws the picture of spy vs spy as a graph?
i went through all the easter eggs when i was bored last year
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:54 am
by LACE
aww shame i missed this, that's what i get for having a life i guess but i've still managed to figure something out for you wubbz
Xi = {2,3} so as a function you could say X(0) = 2, X(1) = 3 and f(x) = X(x) where x is either 0 or 1.
so now you have S total things but the number of groups needs to be divisible by four yes?
put N to be the number of groups: then N % 4 = 0 and the % is the modulus which gives the remainder of N/4
umm you also got S = Sum of X_i from i = 1 to N.
there are alot of possible combos for the actual groups, there's no one formula to get all the x_i's as you've seen in this thread.
my suggestion to you though would be to look at different combos of different configurations of groups and forget about the ones that don't have N be a multiple of 4.
i'll break it down for you since i'm such a darl
N = number of groups
S = total number of things
X_i = number of objects in group i where i is a whole number from 1 to N and
S = Sum X_i i = 1 to N
N % 4 = 0
X(a) = 2 if a = 0 or X(a) = 3 if a = 1 and a can only equal 0 or 1
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:54 am
by LACE
.
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:54 am
by LACE
goddamn work computer always double posts.
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:55 am
by wub
LACE wrote:aww shame i missed this, that's what i get for having a life i guess but i've still managed to figure something out for you wubbz
Xi = {2,3} so as a function you could say X(0) = 2, X(1) = 3 and f(x) = X(x) where x is either 0 or 1.
so now you have S total things but the number of groups needs to be divisible by four yes?
put N to be the number of groups: then N % 4 = 0 and the % is the modulus which gives the remainder of N/4
umm you also got S = Sum of X_i from i = 1 to N.
there are alot of possible combos for the actual groups, there's no one formula to get all the x_i's as you've seen in this thread.
my suggestion to you though would be to look at different combos of different configurations of groups and forget about the ones that don't have N be a multiple of 4.
i'll break it down for you since i'm such a darl
N = number of groups
S = total number of things
X_i = number of objects in group i where i is a whole number from 1 to N and
S = Sum X_i i = 1 to N
N % 4 = 0
X(a) = 2 if a = 0 or X(a) = 3 if a = 1 and a can only equal 0 or 1
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 9:58 am
by Forum
Half base x height
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 10:02 am
by LACE
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 11:30 am
by daeMTHAFKNkim
I feel retarded looking at your guys posts.
1+1 is 2.
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 11:31 am
by idontreallygiveashit
^ way to be a stereotype
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 7:04 pm
by dmz007
So is the aim to determine the minimum number of groups needed?
If so then I think I have a solution and could upload a dodgy .exe program today if you want.
Select Windows or Linux
Re: Maths problem - number Ninjas needed!
Posted: Thu Oct 11, 2012 7:17 pm
by fractal
LACE wrote:aww shame i missed this, that's what i get for having a life i guess but i've still managed to figure something out for you wubbz
Xi = {2,3} so as a function you could say X(0) = 2, X(1) = 3 and f(x) = X(x) where x is either 0 or 1.
so now you have S total things but the number of groups needs to be divisible by four yes?
put N to be the number of groups: then N % 4 = 0 and the % is the modulus which gives the remainder of N/4
umm you also got S = Sum of X_i from i = 1 to N.
there are alot of possible combos for the actual groups, there's no one formula to get all the x_i's as you've seen in this thread.
my suggestion to you though would be to look at different combos of different configurations of groups and forget about the ones that don't have N be a multiple of 4.
i'll break it down for you since i'm such a darl
N = number of groups
S = total number of things
X_i = number of objects in group i where i is a whole number from 1 to N and
S = Sum X_i i = 1 to N
N % 4 = 0
X(a) = 2 if a = 0 or X(a) = 3 if a = 1 and a can only equal 0 or 1
wub wrote:
Re: Maths problem - number Ninjas needed!
Posted: Fri Oct 12, 2012 2:13 am
by BonerJams04
fucking hell you guys are smart
Re: Maths problem - number Ninjas needed!
Posted: Fri Oct 12, 2012 8:23 am
by Forum
Reverb wrote:fucking hell you guys are smart
Thank you
Re: Maths problem - number Ninjas needed!
Posted: Fri Oct 12, 2012 8:26 am
by Electric_Head
Reverb wrote:fucking hell you guys are smart
Do some phyiscs, you'll soon realize a page long equation is not always right.