Maths problem - number Ninjas needed!
Forum rules
Please read and follow this sub-forum's specific rules listed HERE, as well as our sitewide rules listed HERE.
Link to the Secret Ninja Sessions community ustream channel - info in this thread
Please read and follow this sub-forum's specific rules listed HERE, as well as our sitewide rules listed HERE.
Link to the Secret Ninja Sessions community ustream channel - info in this thread
Maths problem - number Ninjas needed!
Ok, maths problem.
I need to divide a certain number of objects into groups. Each object must remain whole. Each group can be either 2 or 3 objects. Total number of groups must be divisable by 4.
Is there a formula for calculating this based on a variation in the number of objects?
I need to divide a certain number of objects into groups. Each object must remain whole. Each group can be either 2 or 3 objects. Total number of groups must be divisable by 4.
Is there a formula for calculating this based on a variation in the number of objects?
-
- Posts: 10747
- Joined: Mon Jun 01, 2009 10:56 am
- Location: Hermosillo, Mexico via South London
- Contact:
Re: Maths problem - number Ninjas needed!
I'm proper shit at maths, not that that's of any use to you
http://www.soundcloud.com/particleimami wrote:i put secret donks in all my tunes, just low enough so you can't hear them
http://www.mixcloud.com/particlejim
Re: Maths problem - number Ninjas needed!
It's of some use to you, that's the main thing.
Re: Maths problem - number Ninjas needed!
That means nothing to me.
-
- Posts: 10747
- Joined: Mon Jun 01, 2009 10:56 am
- Location: Hermosillo, Mexico via South London
- Contact:
Re: Maths problem - number Ninjas needed!
I think he's asking how frequently you poo
http://www.soundcloud.com/particleimami wrote:i put secret donks in all my tunes, just low enough so you can't hear them
http://www.mixcloud.com/particlejim
Re: Maths problem - number Ninjas needed!
divide the groups by hypotenuse and add the pyathagoras. That should give you the isoceles


- Electric_Head
- Posts: 16958
- Joined: Tue May 11, 2010 9:59 am
- Location: South of Africa
- Contact:
Re: Maths problem - number Ninjas needed!
Surely you mean divide the rectangle by 2?southstar wrote:divide the groups by hypotenuse and add the pyathagoras. That should give you the isoceles





Re: Maths problem - number Ninjas needed!
Holy shit, you have to apply knowledge of formulas to real life.
Whatever job that is, back out now.
Whatever job that is, back out now.
Agent 47 wrote:Next time I can think of something, I will.
-
- Posts: 2110
- Joined: Tue Apr 13, 2010 8:58 pm
- Location: Newcastle via Lincoln
Re: Maths problem - number Ninjas needed!
what exactly would you need this formula to spit out?wub wrote:Ok, maths problem.
I need to divide a certain number of objects into groups. Each object must remain whole. Each group can be either 2 or 3 objects. Total number of groups must be divisable by 4.
Is there a formula for calculating this based on a variation in the number of objects?
you give it a number of objects and it spits out a number of groups of 2 and a number of groups of 3?
this would be pretty complex cos it could have multiple combinations of outputs that achieve the same result, unless you were to look for say the least number of total groups
Soundcloud
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
Re: Maths problem - number Ninjas needed!
Pretty much, yeah.volcanogeorge wrote:what exactly would you need this formula to spit out?wub wrote:Ok, maths problem.
I need to divide a certain number of objects into groups. Each object must remain whole. Each group can be either 2 or 3 objects. Total number of groups must be divisable by 4.
Is there a formula for calculating this based on a variation in the number of objects?
you give it a number of objects and it spits out a number of groups of 2 and a number of groups of 3?
-
- Posts: 2110
- Joined: Tue Apr 13, 2010 8:58 pm
- Location: Newcastle via Lincoln
Re: Maths problem - number Ninjas needed!
right i can think of a way of doing this but it'd involve a bit of head scratching and a fair amount of MATLAB code to workwub wrote:Pretty much, yeah.volcanogeorge wrote:what exactly would you need this formula to spit out?wub wrote:Ok, maths problem.
I need to divide a certain number of objects into groups. Each object must remain whole. Each group can be either 2 or 3 objects. Total number of groups must be divisable by 4.
Is there a formula for calculating this based on a variation in the number of objects?
you give it a number of objects and it spits out a number of groups of 2 and a number of groups of 3?
short answer: there's probably not a simple formula that will do it for you but there is a sequence of steps to follow (which for a large number of objects you'd need to get a computer to perform) which will give you all possible answers
Soundcloud
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
Re: Maths problem - number Ninjas needed!
If you could point me at some of the steps I'm happy to have a go myself 

-
- Posts: 2110
- Joined: Tue Apr 13, 2010 8:58 pm
- Location: Newcastle via Lincoln
Re: Maths problem - number Ninjas needed!
right if you're dodgy on any of the terminology i'm using here then gimme a shout because i tend to think in terms of how i'd go about it in MATLAB:
1) Have the program break down the number of objects into all possible combinations of number pairs that will add together to total your number of objects. Store this as an array or a matrix
2) Search the matrix or array for combinations of numbers where one can be divided by 2 and the other by 3 (this is probably several steps in one
3) Divide each number by its respective multiple and store this as a separate array or matrix
4) Add the pairs of numbers in this new matrix together and store as a THIRD matrix with a single column
5) Search the third matrix for numbers which can be divided by 4 and store the row numbers that these are in
6) Spit out the relevant rows of the second matrix based on these row numbers
i'll clarify this later, gotta go see Taken 2
1) Have the program break down the number of objects into all possible combinations of number pairs that will add together to total your number of objects. Store this as an array or a matrix
2) Search the matrix or array for combinations of numbers where one can be divided by 2 and the other by 3 (this is probably several steps in one
3) Divide each number by its respective multiple and store this as a separate array or matrix
4) Add the pairs of numbers in this new matrix together and store as a THIRD matrix with a single column
5) Search the third matrix for numbers which can be divided by 4 and store the row numbers that these are in
6) Spit out the relevant rows of the second matrix based on these row numbers
i'll clarify this later, gotta go see Taken 2
Soundcloud
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
√BEETS
Re: Maths problem - number Ninjas needed!
I can see how to write an algorithm to do it, but it's not obvious that there's a closed form expression for the result...
Algorithm:
you have N objects
if N is divisible by 3, set a = N/3, b=0
is N-2 is divisible by 3, set a = (N-2)/3, b=1
if N-4 is divisible by 3, set a = (N-4)/3, b = 2
(one of these three will always be the case, since the remainder when N is divided by 3 will always be 0, 1 or 2)
If a+b is divisible by 4, job done, crack a beer. Otherwise, set
a = a-2
b = b+3
If a+b is divisible by 4, job done, crack a beer. Otherwise carry on in the same vein until it is.
a is the number of groups of 3, b is the number of groups of 2.
There are going to be a small number of N (mostly small) for which this doesn't work, in which case you're screwed. But this should get the answer for every N where there is a possible partition. (Edit ie any N>7.)
That's how I'd do it in code, you might be able to find a shorter version for doing it on paper...
Algorithm:
you have N objects
if N is divisible by 3, set a = N/3, b=0
is N-2 is divisible by 3, set a = (N-2)/3, b=1
if N-4 is divisible by 3, set a = (N-4)/3, b = 2
(one of these three will always be the case, since the remainder when N is divided by 3 will always be 0, 1 or 2)
If a+b is divisible by 4, job done, crack a beer. Otherwise, set
a = a-2
b = b+3
If a+b is divisible by 4, job done, crack a beer. Otherwise carry on in the same vein until it is.
a is the number of groups of 3, b is the number of groups of 2.
There are going to be a small number of N (mostly small) for which this doesn't work, in which case you're screwed. But this should get the answer for every N where there is a possible partition. (Edit ie any N>7.)
That's how I'd do it in code, you might be able to find a shorter version for doing it on paper...
Re: Maths problem - number Ninjas needed!
How many objects are you looking at? and if there is one group of two does it mean the other groups have to be groups of two?
You could divide the number of objects by 8 which leaves x amount of groups of 8. This could be split up into 4 groups of 2. The total number of groups would be x times 4 which means its divisible by 4.
for example you have 72 objects.
Divide this by 8 and you get 9.
You have 9 groups of 8.
Divide these groups of 8 into 4 smaller groups (the final groups, 2, 2, 2, 2)
you have 4 groups of 2 for every group of 8.
This totals up to 36 groups of 2 which is divisible by 4.
You could apply this same technique but instead divide by 9, 10, 11, 12 and it would work.
for example you have 154 objects.
Divide this by 11 and you get 14.
You have 14 groups of 11.
Divide these groups of 9 into 4 smaller groups (2, 3, 3, 3)
you have 4 groups every group of 8.
This totals up to 44 groups which is divisible by 4.
Sorry if im unclear, its abit hard to explain my thoughts without a piece off paper to draw the equations on
You could give me the numbers and i would be glad to work it out for ya, im definitaly a number ninja so ill find it fun 
i think you could use logarithms do it but explaining that could take a while
You could divide the number of objects by 8 which leaves x amount of groups of 8. This could be split up into 4 groups of 2. The total number of groups would be x times 4 which means its divisible by 4.
for example you have 72 objects.
Divide this by 8 and you get 9.
You have 9 groups of 8.
Divide these groups of 8 into 4 smaller groups (the final groups, 2, 2, 2, 2)
you have 4 groups of 2 for every group of 8.
This totals up to 36 groups of 2 which is divisible by 4.
You could apply this same technique but instead divide by 9, 10, 11, 12 and it would work.
for example you have 154 objects.
Divide this by 11 and you get 14.
You have 14 groups of 11.
Divide these groups of 9 into 4 smaller groups (2, 3, 3, 3)
you have 4 groups every group of 8.
This totals up to 44 groups which is divisible by 4.
Sorry if im unclear, its abit hard to explain my thoughts without a piece off paper to draw the equations on


i think you could use logarithms do it but explaining that could take a while

Last edited by ItsSpire on Wed Oct 10, 2012 1:11 pm, edited 1 time in total.

Re: Maths problem - number Ninjas needed!
Number of objects is a variable.
Re: Maths problem - number Ninjas needed!
but any idea of how many youll be getting, roughly. Is it in the hundreds?

Who is online
Users browsing this forum: No registered users and 0 guests