Maths problem - number Ninjas needed!

Off Topic (Everything besides dubstep)
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
wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:10 pm

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?

particle-jim
Posts: 10747
Joined: Mon Jun 01, 2009 10:56 am
Location: Hermosillo, Mexico via South London
Contact:

Re: Maths problem - number Ninjas needed!

Post by particle-jim » Wed Oct 10, 2012 12:13 pm

I'm proper shit at maths, not that that's of any use to you
imami wrote:i put secret donks in all my tunes, just low enough so you can't hear them
http://www.soundcloud.com/particle
http://www.mixcloud.com/particlejim

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:14 pm

It's of some use to you, that's the main thing.

User avatar
Forum
Posts: 10686
Joined: Sat Dec 15, 2007 1:55 am
Location: J R Hartley

Re: Maths problem - number Ninjas needed!

Post by Forum » Wed Oct 10, 2012 12:16 pm

log rhythms
Image Image

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:17 pm

That means nothing to me.

particle-jim
Posts: 10747
Joined: Mon Jun 01, 2009 10:56 am
Location: Hermosillo, Mexico via South London
Contact:

Re: Maths problem - number Ninjas needed!

Post by particle-jim » Wed Oct 10, 2012 12:18 pm

I think he's asking how frequently you poo
imami wrote:i put secret donks in all my tunes, just low enough so you can't hear them
http://www.soundcloud.com/particle
http://www.mixcloud.com/particlejim

User avatar
Forum
Posts: 10686
Joined: Sat Dec 15, 2007 1:55 am
Location: J R Hartley

Re: Maths problem - number Ninjas needed!

Post by Forum » Wed Oct 10, 2012 12:19 pm

divide the groups by hypotenuse and add the pyathagoras. That should give you the isoceles
Image Image

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:20 pm

Fuck off :lol:

User avatar
Electric_Head
Posts: 16958
Joined: Tue May 11, 2010 9:59 am
Location: South of Africa
Contact:

Re: Maths problem - number Ninjas needed!

Post by Electric_Head » Wed Oct 10, 2012 12:21 pm

southstar wrote:divide the groups by hypotenuse and add the pyathagoras. That should give you the isoceles
Surely you mean divide the rectangle by 2?
Image ImageImage Image
Image

User avatar
AxeD
Posts: 9361
Joined: Tue Oct 20, 2009 10:10 pm
Location: Damstarem

Re: Maths problem - number Ninjas needed!

Post by AxeD » Wed Oct 10, 2012 12:26 pm

Holy shit, you have to apply knowledge of formulas to real life.

Whatever job that is, back out now.
Agent 47 wrote:Next time I can think of something, I will.

volcanogeorge
Posts: 2110
Joined: Tue Apr 13, 2010 8:58 pm
Location: Newcastle via Lincoln

Re: Maths problem - number Ninjas needed!

Post by volcanogeorge » Wed Oct 10, 2012 12:30 pm

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?
what exactly would you need this formula to spit out?

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

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:31 pm

volcanogeorge wrote:
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?
what exactly would you need this formula to spit out?

you give it a number of objects and it spits out a number of groups of 2 and a number of groups of 3?
Pretty much, yeah.

volcanogeorge
Posts: 2110
Joined: Tue Apr 13, 2010 8:58 pm
Location: Newcastle via Lincoln

Re: Maths problem - number Ninjas needed!

Post by volcanogeorge » Wed Oct 10, 2012 12:40 pm

wub wrote:
volcanogeorge wrote:
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?
what exactly would you need this formula to spit out?

you give it a number of objects and it spits out a number of groups of 2 and a number of groups of 3?
Pretty much, yeah.
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 work

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

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 12:41 pm

If you could point me at some of the steps I'm happy to have a go myself :)

volcanogeorge
Posts: 2110
Joined: Tue Apr 13, 2010 8:58 pm
Location: Newcastle via Lincoln

Re: Maths problem - number Ninjas needed!

Post by volcanogeorge » Wed Oct 10, 2012 12:48 pm

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
Soundcloud
"Gettin' paid like a biker with the best cranks, spray it like a high ranked sniper in the West Bank"
BEETS

slothrop
Posts: 2655
Joined: Thu Aug 24, 2006 11:59 am

Re: Maths problem - number Ninjas needed!

Post by slothrop » Wed Oct 10, 2012 12:49 pm

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...

ItsSpire
Posts: 13
Joined: Mon Oct 08, 2012 5:44 am

Re: Maths problem - number Ninjas needed!

Post by ItsSpire » Wed Oct 10, 2012 1:08 pm

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 :)
Last edited by ItsSpire on Wed Oct 10, 2012 1:11 pm, edited 1 time in total.
Image

wub
Posts: 34156
Joined: Tue Feb 26, 2008 3:11 pm
Location: Madrid
Contact:

Re: Maths problem - number Ninjas needed!

Post by wub » Wed Oct 10, 2012 1:10 pm

Number of objects is a variable.

ItsSpire
Posts: 13
Joined: Mon Oct 08, 2012 5:44 am

Re: Maths problem - number Ninjas needed!

Post by ItsSpire » Wed Oct 10, 2012 1:14 pm

but any idea of how many youll be getting, roughly. Is it in the hundreds?
Image

User avatar
garethom
Posts: 13426
Joined: Wed Dec 22, 2010 12:55 pm
Location: Birmz
Contact:

Re: Maths problem - number Ninjas needed!

Post by garethom » Wed Oct 10, 2012 1:18 pm

Image

Locked

Who is online

Users browsing this forum: No registered users and 0 guests