Sub topic 5
Negative and Fractional Inputs
What this chapter assumes
You should already be comfortable with the following:
- Integer, fraction, and decimal arithmetic.
- Order of operations (PEMDAS).
- Exponents.
- Solving one-variable linear equations.
- Substituting a value into a made-up operation such as a★b = 2a + b², which the previous chapters covered.
This chapter covers the inputs that cause most lost points on GRE defined-operation questions: negative numbers and fractions.
Why these inputs cause errors
The definition is the same whether you feed it 3 and 4 or −3/4 and 2/5. Only the arithmetic gets harder. Most wrong answers on these questions come from three habits:
- Dropping the sign of an input during substitution.
- Applying an exponent to part of a negative number.
- Mishandling a fraction in a division or a square.
The fix is one habit: substitute inside parentheses, then evaluate. Every input goes into the definition wrapped in its own pair of parentheses, whatever its sign or form.
Substitute with parentheses
Take the operation a★b = 2a + b². To compute (−2)★(−3), rewrite the rule with empty slots:
2( ) + ( )²
Then fill each slot:
2(−2) + (−3)² = −4 + 9 = 5
The parentheses make the squaring apply to the whole value −3. Without them, you might write −3² and get −9, which is a different number. By the standard convention, −3² means −(3²), so the minus sign is outside the square.
def star(a, b):
# Defined operation: a star b = 2a + b^2
return 2 * a + b ** 2
print(star(-2, -3)) # 2*(-2) + (-3)**2 = -4 + 9 = 5
print(-3 ** 2) # -9: the minus sign is NOT squared
print((-3) ** 2) # 9: parentheses make it part of the basePython follows the same convention as written math here, so running it shows the difference directly.
Negative inputs in detail
Negative inputs interact with a definition in a few specific ways.
Squares erase the sign
An even power of a negative number is positive. In 2a + b², a negative b contributes exactly what its positive twin would. Only a is sign-sensitive. So star(3, −4) and star(3, 4) are both 6 + 16 = 22.
Subtraction of a negative adds
Suppose a◆b = a² − 3b. For (−4)◆(−2), the second input is subtracted after being multiplied by 3:
(−4)² − 3(−2) = 16 − (−6) = 16 + 6 = 22
A frequent mistake is to write 16 − 6 = 10. Another is to write −4² = −16, which gives −16 + 6 = −10. The first mistake loses the double negative. The second loses the parentheses on the base. Both are plausible-looking wrong answers, and GRE answer choices often include them.
def diamond(a, b):
# Defined operation: a diamond b = a^2 - 3b
return a ** 2 - 3 * b
print(diamond(-4, -2)) # 16 - (-6) = 22
print(-4 ** 2 - 3 * -2) # -10: what you get if the parentheses are droppedA negative input can change which output is bigger
If a question asks whether x★y is greater than y★x, you can't assume the larger input wins. With 2a + b², we get star(−5, 1) = −10 + 1 = −9, while star(1, −5) = 2 + 25 = 27. The sign of an input in the "linear" position matters, and the sign in the "squared" position does not.
Fractional inputs in detail
Fractions follow the same substitution rule. The extra work is in the arithmetic, so keep fractions as fractions until the end.
Squaring a fraction
Square the numerator and the denominator separately: (−1/3)² = 1/9. Squaring a fraction between −1 and 1 makes it smaller in size. This is the opposite of what happens to integers.
For (1/2)★(−1/3) with a★b = 2a + b²:
2(1/2) + (−1/3)² = 1 + 1/9 = 10/9
Operations with a fraction bar
Some definitions contain a division, for example a⊕b = (a − b)/(a + b). Treat the numerator and the denominator as two separate computations. Then divide.
For (1/2)⊕(1/3):
- Numerator: 1/2 − 1/3 = 3/6 − 2/6 = 1/6.
- Denominator: 1/2 + 1/3 = 3/6 + 2/6 = 5/6.
- Result: (1/6)/(5/6) = (1/6)(6/5) = 1/5.
Dividing by a fraction means multiplying by its reciprocal. Do not divide the numerators and denominators in the wrong direction. The result 1/5 is a sanity check: the top is a small difference and the bottom is a larger sum, so the answer should be a small positive fraction.
Python's Fraction type performs exact fraction arithmetic, which is useful for checking your hand work.
from fractions import Fraction
def star(a, b):
return 2 * a + b ** 2
def oplus(a, b):
# Defined operation: a oplus b = (a - b) / (a + b)
return (a - b) / (a + b)
print(star(Fraction(1, 2), Fraction(-1, 3))) # 10/9
print(oplus(Fraction(1, 2), Fraction(1, 3))) # 1/5
print(oplus(Fraction(-2), Fraction(3))) # -5The last line checks a negative case: (−2 − 3)/(−2 + 3) = −5/1 = −5.
Decimals
Decimals behave like fractions. If a computation is easier with fractions (for example 0.25 is 1/4), convert. Otherwise keep decimals but watch place values when squaring: 0.3² = 0.09, not 0.9.
from fractions import Fraction
def star(a, b):
return 2 * a + b ** 2
print(star(Fraction("0.5"), Fraction("0.3"))) # 1 + 0.09 = 109/100Fraction("0.3") is exactly 3/10, so the result is exactly 109/100, which is 1.09.
When the result is undefined
A definition with a denominator or a square root only works for some inputs. On the GRE, numbers are real numbers, so these cases need a check:
- A denominator that equals zero is undefined. For a⊕b above, 2⊕(−2) has denominator 2 + (−2) = 0.
- A square root of a negative number is not a real number.
Quantitative Comparison questions sometimes depend on this. Before you commit to an answer, ask whether the given inputs could make the definition break.
from fractions import Fraction
def oplus(a, b):
return (a - b) / (a + b)
try:
print(oplus(Fraction(2), Fraction(-2)))
except ZeroDivisionError:
print("undefined: denominator is 0")A checking routine
Use the same sequence every time. It takes a few seconds and catches the common errors.
Step 5 is the most skipped and the most useful. Ask two questions:
- Does the sign make sense? If both squared terms are positive and the linear term is small, a large negative answer is suspicious.
- Is the size plausible? Squaring a fraction between −1 and 1 should shrink it.
Common traps
| Trap | Wrong work | Correct work |
|---|---|---|
| Unprotected negative base | (−3)² read as −3² = −9 | (−3)² = 9 |
| Double negative lost | 16 − 3(−2) = 10 | 16 − (−6) = 22 |
| Squaring only the numerator | (−1/3)² = 1/3 | (−1/3)² = 1/9 |
| Distributing a sign incorrectly | −(a − b) written as −a − b | −(a − b) = −a + b |
| Dividing by a fraction the wrong way | (1/6) ÷ (5/6) = 6/5 | (1/6) × (6/5) = 1/5 |
| Wrong slot | Putting the second input in the first slot | Match inputs to slots by position |
The last trap links to the next chapter, where argument order is the main topic. With negative and fractional inputs, a swapped slot is harder to notice because the numbers look unfamiliar.
Worked example, start to finish
Define x♦y = x² − 2xy, and find (−1/2)♦(3/4).
- Empty slots: ( )² − 2( )( ).
- Fill: (−1/2)² − 2(−1/2)(3/4).
- Exponent: (−1/2)² = 1/4.
- Product: 2(−1/2)(3/4) = (−1)(3/4) = −3/4.
- Subtract: 1/4 − (−3/4) = 1/4 + 3/4 = 1.
Check: the first term is small and positive, and the subtracted term is negative, so subtracting it adds. A result of 1 is reasonable.
from fractions import Fraction
def diamond2(x, y):
# Defined operation: x diamond y = x^2 - 2xy
return x ** 2 - 2 * x * y
print(diamond2(Fraction(-1, 2), Fraction(3, 4))) # 1Exercises
Exercise
Define a◆b = a² − 3b. What is (−1/2)◆(−2/3)?
Show answer
Substitute with parentheses: (−1/2)² − 3(−2/3). The square is 1/4. The product is 3(−2/3) = −2, and subtracting −2 adds 2. The result is 1/4 + 2 = 9/4.
Exercise
Define a⊕b = (a − b)/(a + b). Find 3⊕(−1/2), and say what value of b makes 3⊕b undefined.
Show answer
The numerator is 3 − (−1/2) = 7/2. The denominator is 3 + (−1/2) = 5/2. The result is (7/2)/(5/2) = 7/5. The operation is undefined when the denominator is 0, so 3 + b = 0, which gives b = −3.
Exercise
Define a★b = 2a + b². If a★(−3) = 1, what is a?
Show answer
Substitute b = −3 in parentheses: 2a + (−3)² = 2a + 9. Set it equal to 1: 2a + 9 = 1, so 2a = −8 and a = −4. Check: 2(−4) + 9 = 1.