"mattG" <mg******@gmail .comwrote in message
news:11******** **************@ g4g2000hsf.goog legroups.com...
>I have a scenario where I have these things that take up (x) number of
space. I know the max number of space I will ever have is 512. I am
trying to figure out a way to write a formula or whatever will make it
work to tell me how many of these things I can put in this space.
So example
I want to put 60 of these thing that take up (21) units each. Well
given that I cannot go over 512 the max I am able to put in any one
space is 29. I did the math to do that, but what sort of formula am I
looking for to do this.
I want to know how many of these things I can fit and what the next
available number for space is. I have in the worksheet a cell that
contains the number of units each different thing takes up because it
varies.
Thank you for any help.
Matt
This is pretty simple if you think about it.
If you have x objects that take up y units then that is a total of x*y units
taken up... or x + x + x + x + ... + x where there are y x's in the sum.
To make this concrete, suppose you have 10 dollar bills and each dollar bill
is 4 quarter(or represents 4 units where are unit is the quarder), then
10 dollar bills * [4 quarters / 1 dollar bill] = 40 quarters.
notice that I used dimensional analysis here. What this means is that I
treat the "dimension"(thi s case its dollars and quarters) which represents
what type of object the number is as sorta its own "number" that can be used
like a number.
That probably doesn't make sense but realize that
4 quarters / 1 dollar bill = 1
because
4 quarters = 1 dollar bill. (dividing both sides by the same amount is a
valid mathematical operation)
So essnetially what I did was start with
10 dollar bills = 10 dollar bills * 1
(multiplying by 1 doesn't change it)
but now I used
4 quarters / 1 dollar bill = 1
to get
10 dollar bills * [4 quarters / 1 dollar bill]
but then the dollar bill(s) cancel each other because have something like 10
* x * 4 * y / x = 10*4*y.
Which results in 40 quarters.
What that means is that
10 dollar bills = 40 quarters.
----------
Thats kinda a long explination but hopefully you understand it. (trying to
make it very simple so you can learn how to do this yourself)
If your a computer guy and know about bits and bytes you can do the same,
1000 bytes * [8 bits / byte] = 8000 bits
i.e., 1000 bytes is the same as 8000 bits.
-----------
Your problem is the exact same but a different perspective
x objects * [y space / object] = x*y space [for x objects]
i.e., x objects is the number of objects we are talking about
y space / object or y space / one object is the space taken by one object,
which is y.
The we multiply them and the units cancel and we are left with the total
space.
-----
For your specific problem
its 60*21 = 1260 units of space. (I left out the units in the product but I
know they are implicitly there)
Now if you have a max of 512 then you went over. By how much?
Well, its simple, we are looking for how many objects we can put into 512
because that would be our max.
i.e., x * 21 = 512. This gives us x = 24.123... but since x has to be an
integer(because we can't have partial objects), it means that we can have a
max of 24 units.
Notice that x = 512/21... but you can generalize this to be "Max
space"/"Size of one object".
Since you have 60 objects and 24 was the max then you are over by 60 - 24 =
36.
You can replace numbers with variables to make the equations more abstract
but more useful. If you don't know algebra then its about time to start
because this is what algebra is all about.