# Reducing Fractions with GeoGebra

When GeoGebra 3.1 is released (it is in Future - Pre-release, all is much simpler - See here!

Cases:

 ALL CASES 1. You have your numerator and denominator, e.g.: numer=-2 and denom=4.2. a. To get the GCD of the numerator and denominator - Input: GCDnd=Max[Sequence[If[Mod[abs(numer), i] + Mod[abs(denom), i] ≟ 0, i, -1], i, 1, Min[{abs(numer), abs(denom)}]]].b. You have your reductions with absolute value - Input: numerR=abs(numer/GCDnd) and denomR=abs(denom/GCDnd).

 1st case: You want the number, but the sign only if the number is negative .3. You find sign of your fraction: textSignN=If[sgn(numer/denom)>0,"","-"].4. You create your list- Input: RF={"\frac{" +textSignN+ numerR + "}{" + denomR + "}", textSignN+"{}" + numerR}==Element 1 is: If the reduced denominator (denomR) is not 1, we want the fraction: numerR/denomR. ==Element 2 is: Else we just want reduced numerator (numerR). (Right-click and deselect "Show object".)5. Now here comes the slightly tricky part (thanks Zen!). In order to put an IF command in text, it must be entered in the input field. However, we also need the text to be LaTex.== a. First create a text object either using the input field or the text icon, e.g. frac="hello".== b. Right-click on frac, select Properties, the Text tab, select LaTex, click on Apply and then on Close.== c. In the input field type: frac=If[denomR ≟ 1, Element[RF, 2], Element[RF, 1]].
see: fractions_reduced.ggb

Coefficients

 2nd case: You want sign and number (e.g. it is a constant coefficent)3. You find sign of your fraction: textSign=If[sgn(numer/denom)>0,"+","-"]. 4. You create your list RFCC={textSign+"\frac{" + numerR + "}{" + denomR + "}", textSign+"{}" + numerR}The idea here is same as in 1 except you always want sign.5. a. First create a text object either using the input field or the text icon, e.g. fracCC="hello".== b. Right-click on fracCC, select Properties, the Text tab, select LaTex, click on Apply and then on Close.== c. In the input field type fracCC=If[denomR ≟ 1, Element[RFCC, 2], Element[RFCC, 1]].----

 3rd case: You want sign, but the number only if different from 1 (e.g. it is a middle coefficent).3. (same as case 2) You find sign of your fraction: textSign=If[sgn(numer/denom)>0,"+","-"]. 4. You create your list RFMC={textSign+"\frac{" + numerR + "}{" + denomR + "}", textSign+"{}" + numerR, textSign}==Element 3 is: If the reduced fraction is 1, just the sign - without the number 1.5. a. First create a text object either using the input field or the text icon, e.g. fracMC="hello".== b. Right-click on fracMC, select Properties, the Text tab, select LaTex, click on Apply and then on Close.== c. In the input field type fracMC=If[denomR ≟ 1, If[numerR ≟ 1, Element[RFMC, 3], Element[RFMC, 2]], Element[RFMC, 1]].----

 4th case: You want sign if negative and number if different than 1(e.g. it is first coefficent)3. (same as case 1) You find sign of your fraction: textSignN=If[sgn(numer/denom)>0,"","-"].4. You create your list RFFC={"\frac{" +textSignN+ numerR + "}{" + denomR + "}", textSignN+"{}" + numerR,textSignN}==Element 3 is: If the reduced fraction is 1, just the sign and only if it is minus.5. a. First create a text object either using the input field or the text icon, e.g. fracFC="hello"== b. Right-click on fracFC, select Properties, the Text tab, select LaTex, click on Apply and then on Close.== c. In the input field type fracFC=If[denomR ≟ 1, If[numerR ≟ 1, Element[RFFC, 3], Element[RFFC, 2]], Element[RFFC, 1]]. see: fractions&coefficients.ggb

Related Topics

geogebra help fraction reduce coefficient