# Thread: Separate all values in an expression: (a-1)/b --> ((a/1)*(1/b))-(1/b)

1. ## Separate all values in an expression: (a-1)/b --> ((a/1)*(1/b))-(1/b)

For code I am writing, I have a goal to change an expression such that all values can be represented as a simple fraction where 1 is either the numerator or denominator -- and each fraction cannot be separated by division. Sounds crazy, I know - this is more of an exercise than anything.

Is this even possible? For example:

(a-1)/b --> ((a/1)*(1/b))-(1/b)

I have found I am able to do this with a lot of algebraic expressions. However, if a + or - exists in a denominator, I don't seem to be able to break it out. For example:

a/(b-1)

The best I can do is: (a/1)*(1/(b-1))

Just fyi, right now I am not seeking to solve for log, exp, etc, just +-/* operators...

Thanks!

2. Hmmm...an answer is simply divide expression by 1;
[EXPRESSION] / 1

3. Originally Posted by Ethrex
For code I am writing, I have a goal to change an expression such that all values can be represented as a simple fraction where 1 is either the numerator or denominator -- and each fraction cannot be separated by division. Sounds crazy, I know - this is more of an exercise than anything.

Is this even possible? For example:

(a-1)/b --> ((a/1)*(1/b))-(1/b)

I have found I am able to do this with a lot of algebraic expressions. However, if a + or - exists in a denominator, I don't seem to be able to break it out. For example:

a/(b-1)

The best I can do is: (a/1)*(1/(b-1))

Just fyi, right now I am not seeking to solve for log, exp, etc, just +-/* operators...

Thanks!

a/(b-1) = 1/[(b-1)/a] = 1/[{(b/1)*(1/a) - (1/a)}]

4. Originally Posted by Ethrex
For code I am writing, I have a goal to change an expression such that all values can be represented as a simple fraction where 1 is either the numerator or denominator -- and each fraction cannot be separated by division. Sounds crazy, I know - this is more of an exercise than anything.
If you restrict yourself to using only fractions which have "1" as the numerator, you'll be in the Egyptian context. They may have figured out pyramids, but fractions were a bit of a struggle for them!

5. Thanks Subhotosh Khan, I think you got the right idea. You have successfully isolated the denominators from having addition/subtraction. Unfortunately the whole expression becomes a reciprocal itself. Is there any way to avoid that? I am trying to not have multiple layers of division, and in fact leave any division at the lowest layer (no more than a 1 or a variable in the numerator or denominator). I suspect it is not possible.

stapel, that was an interesting read for sure!

6. So I figured out this:

a/(b-1)
= a * (1/(b-1))
= a * ((b-1)^-1) // negative exponent

Is there any way to distribute the exponent to b and -1 to separate them?

#### Posting Permissions

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