Hidden WordScanner
Private scans · No account required

DuckieDai Fraction Simplifier

Reduce an integer fraction to lowest terms and normalize a negative denominator.

rational functions · MIT License

Overview

Reduce an integer fraction to lowest terms and normalize a negative denominator.

  • Tested on a TI calculator
  • Downloaded 46 times
  • Version 1.0.0
  • 1373 bytes
  • No imports

Before you run it

  • TI-84 Plus CE Python · tested on OS 5.8.3, Python App 5.8.3.0048
  • TI Connect CE .py conversion to a Python AppVar in RAM; physically tested one program at a time
  • Inputs represent a fraction.
  • The denominator cannot be zero.
  • Non-integer input is rejected by the calculator conversion.

Try the DuckieDai calculator screen

Follow the reviewed program prompts and calculation flow before downloading.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

Learn the math

How reducing a fraction works

The idea

A fraction is in lowest terms when the top and bottom share no factor other than 1. To get there, divide both by their greatest common divisor.

The formula

a/b = (a / gcd)/(b / gcd)

a
numerator
b
denominator, not 0
gcd
the largest whole number that divides both

Using the program

Worked example

Reduce 18/24. Enter 18 and 24.

gcd(18, 24) = 6, so 18/24 = 3/4

The program shows 3/4.

Doing it by hand

The greatest common divisor is easy to spot for small numbers and hard for large ones. Euclid's algorithm finds it without any guessing: divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and that remainder until the remainder is 0. The last divisor is the greatest common divisor.

Reduce 84/126 this way.

126 = 1 x 84 + 42

84 = 2 x 42 + 0

The last divisor is 42, so divide the top and bottom by 42: 84/126 = 2/3.

Reducing first pays off in later steps. Fractions in lowest terms are easier to compare, and when you add or multiply them the numbers stay small enough to check in your head.

Tips and common mistakes

Where this comes up

Reducing fractions is used at every level, from pre-algebra to calculus. It matters most when an answer must be exact and a decimal will not do.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. """DuckieDai Fraction Simplifier for TI-84 Plus CE Python."""
  2. def duckiedai_intro(program_name, wait=True):
  3. title=program_name[:16]; empty=16-len(title); left=empty//2; right=empty-left
  4. print("+----------------------+"); print("| "+" "*left+title+" "*right+" |"); print("| |"); print("| __ |"); print("| ___(o )> quack! |"); print("| \\ <_. ) |"); print("| `---' |"); print("| by DuckieDai |"); print("+----------------------+"); print("Loading...")
  5. if wait: input("Press enter to start "); print("\n"*8)
  6. def clear_screen(): print("\n"*8)
  7. def gcd(a,b):
  8. a=abs(a); b=abs(b)
  9. while b!=0: a,b=b,a%b
  10. return a
  11. def run_solver():
  12. clear_screen(); print("FRACTION SIMPLIFY"); print("-----------------"); print("")
  13. top=int(input("Numerator: ")); bottom=int(input("Denominator: "))
  14. if bottom==0: clear_screen(); print("INVALID"); print("Denominator"); print("cannot be 0"); return
  15. if bottom<0: top=-top; bottom=-bottom
  16. common=gcd(top,bottom); top//=common; bottom//=common
  17. clear_screen(); print("SIMPLIFIED"); print("----------"); print(top if bottom==1 else str(top)+"/"+str(bottom))
  18. duckiedai_intro("Fraction Simpl")
  19. while True:
  20. run_solver(); print("")
  21. if input("Again? y/n: ").lower()!="y": break
  22. clear_screen(); print("DuckieDai says: done!")
Filename
FRCSIM.py
Size
1373 bytes
SHA-256
0171deb2669e9b8c8d0cd2bc2ac46ca48ad63f4f913e5214a6bb81af044da301

Usage

Inputs

  • Integer numerator
  • Nonzero integer denominator

Outputs

  • Fraction in lowest terms

Units: Integers; no physical units.

Assumptions and limitations

Assumptions

  • Inputs represent a fraction.

Constraints

  • The denominator cannot be zero.

Known failures

  • Non-integer input is rejected by the calculator conversion.

Compatibility and review

Review status
Tested on a TI calculator
Tested on
Creator-owned TI-84 Plus CE Python calculator; exact .py transferred and launched individually
What happened
Passed: creator personally tested the exact Fraction Simplifier program on a TI 84 Plus CE Python calculator.
Dependencies
No imports
Suggested calculator name
FRCSIM — you can give it another valid, unique name when you transfer it
Desktop test cases
Not available for this interactive-only source

This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.

Transfer and launch

Download the .py file, send it to your calculator with TI Connect CE as FRCSIM or another name, then open the Python App and try the worked example on this page first.

Full installation and troubleshooting guide. Check your teacher's or exam's rules before using any program.

Version history

Did a DuckieDai program help with your homework? Every program here is free. If you would like to say thanks, you can leave a tip on Cash App ($duckiedai214) or read what tips pay for.

Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.

Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters, and so does a Yes or No answer about whether the program worked. Your browser notes that you answered; that note is never sent to the site. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.