1. ## Algebra question

It's been years since I've done any kind of algebra, and I have an equation that I need to do to calculate space useage on *nix boxes and can't for the life of me remember how to solve for "X".
Code:
`((X - Free space) / X) * 100 = Used %`
I have Free space, and I have the % used, but I can't remember how to solve an equation for X.

Thanks.

2. Code:
```(X - Free Space) / X = Used% / 100
X - Free Space = X (Used% / 100)
100X - (100 * Free Space) = X * Used%
100X - (X * Used%) = 100 * Free Space
X( 100 - Used% ) = 100 * Free Space
X = (100 * Free Space) / (100 - Used%)```
I think...but wow, it's been a long time.

And I'm sure there's an easier way to do it, but I think that works

3. After I looked at it for a while, I came up with
Code:
`Free space / (Used % / 100) = X`

4. Knew I was doing it the complicated way

5. Viflux is right:

x = ( 100 - Free Space ) / ( 100 - used% )

6. Originally Posted by Miraculix
Viflux is right:

x = ( 100 - Free Space ) / ( 100 - used% )
Viflux had: x = ( 100 * Free Space ) / ( 100 - used% )
Originally Posted by Viflux
Code:
```(X - Free Space) / X = Used% / 100
X - Free Space = X (Used% / 100)
100X - (100 * Free Space) = X * Used%
100X - (X * Used%) = 100 * Free Space
X( 100 - Used% ) = 100 * Free Space
X = (100 * Free Space) / (100 - Used%)```
I think...but wow, it's been a long time.

And I'm sure there's an easier way to do it, but I think that works

7. I think I had it...

Try putting in some dummy figures and see!

8. sorry, Type-O on my end, I meant 100 * freespace not minus ... his solution is right.

9. At least some people believe in posting code, eh?

Defender1, Free space / (Used % / 100) = X is wrong. Viflux' solution is correct. It can be simplified a bit though to:

Code:
`x = FreeSpace / (1 - Used)`
It's not used % anymore, since dividing a percentage by hundred cancels the %-sign. Given the two inputs, you can compute the simply with

Code:
`x = FreeSpace / (1 - UsedSpace% / 100)`
which is equal to

Code:
`x = FreeSpace / (1 - Used)`

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•