Hidden WordScanner
Private scans · No account required

DuckieDai Rational Zero Finder

List possible rational zeros from a polynomial's constant and leading coefficients using the Rational Root Theorem.

Using the full toolkit? Read the step-by-step Polynomial Toolkit guide for quartic, cubic, and quadratic workflows, worked examples, and a reminder to keep every root you find.

algebra · MIT License

Overview

List possible rational zeros from a polynomial's constant and leading coefficients using the Rational Root Theorem.

  • Tested on a TI calculator
  • Downloaded 73 times
  • Version 1.0.1
  • 1757 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
  • The program lists candidates, not confirmed roots.
  • The leading coefficient cannot be zero.
  • A zero constant produces no plus/minus factor list; treat zero as a root separately.

Try the DuckieDai calculator screen

A browser implementation of the documented calculation flow. It does not execute the downloaded Python.

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 the Rational Zero Theorem works

The idea

The Rational Zero Theorem narrows down where to look for a polynomial's fraction or whole-number zeros. Every such zero must be a factor of the constant term divided by a factor of the leading coefficient.

It gives a list of candidates, not answers. You still test each one.

The formula

possible zeros = +/- (factors of constant)/(factors of leading coefficient)

constant
the term with no x
leading coefficient
the number in front of the highest power of x

Using the program

Worked example

For 2x^3 + x^2 - 7x - 6, enter a constant of 6 and a leading coefficient of 2.

The program lists +/- 1, +/- 1/2, +/- 2, +/- 3, +/- 3/2, and +/- 6. Test them with the Cubic Zero Tester.

Tips and common mistakes

Where this comes up

The Rational Zero Theorem is part of the polynomial functions unit of algebra 2, precalculus, and college algebra, as the first step in finding the zeros of a cubic or quartic.

Go further: How to Find All the Zeros of a Polynomial

Exact reviewed bytes

Source code

Download .py

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

  1. """DuckieDai Rational Zero Finder for TI-84 Plus CE Python."""
  2. def duckiedai_intro(program_name, wait=True):
  3. title = program_name[:16]
  4. empty = 16 - len(title)
  5. left = empty // 2
  6. right = empty - left
  7. print("+----------------------+")
  8. print("| " + " " * left + title + " " * right + " |")
  9. print("| |")
  10. print("| __ |")
  11. print("| ___(o )> quack! |")
  12. print("| \\ <_. ) |")
  13. print("| `---' |")
  14. print("| by DuckieDai |")
  15. print("| hiddenwordscanner.com|")
  16. print("+----------------------+")
  17. print("Loading...")
  18. if wait:
  19. input("Press enter to start ")
  20. print("\n" * 6)
  21. def gcd(a, b):
  22. while b != 0:
  23. a, b = b, a % b
  24. return a
  25. duckiedai_intro("Rational Zeros")
  26. constant = int(input("Constant: "))
  27. lead = int(input("Leading coeff: "))
  28. if constant < 0:
  29. constant = -constant
  30. if lead < 0:
  31. lead = -lead
  32. p_factors = []
  33. q_factors = []
  34. for i in range(1, constant + 1):
  35. if constant % i == 0:
  36. p_factors.append(i)
  37. for i in range(1, lead + 1):
  38. if lead % i == 0:
  39. q_factors.append(i)
  40. zeros = []
  41. for p in p_factors:
  42. for q in q_factors:
  43. g = gcd(p, q)
  44. num = p // g
  45. den = q // g
  46. pair = (num, den)
  47. if pair not in zeros:
  48. zeros.append(pair)
  49. print()
  50. print("Possible zeros:")
  51. print("Use +/-")
  52. count = 0
  53. for pair in zeros:
  54. num = pair[0]
  55. den = pair[1]
  56. if den == 1:
  57. print("+/-", num)
  58. else:
  59. print("+/-", str(num) + "/" + str(den))
  60. count += 1
  61. if count % 5 == 0:
  62. if count < len(zeros):
  63. input("Enter for more ")
  64. print()
  65. print("DuckieDai says: done!")
Filename
P1RZERO.py
Size
1757 bytes
SHA-256
14bbbefbcb953e9287539001278b99f5b6e97c3efc8c2551d346757052cb5b07

Usage

Inputs

  • Constant coefficient
  • Leading coefficient

Outputs

  • Unique positive rational-factor pairs; use plus or minus for each candidate

Units: Coefficients are integers.

Assumptions and limitations

Assumptions

  • The program lists candidates, not confirmed roots.

Constraints

  • The leading coefficient cannot be zero.

Known failures

  • A zero constant produces no plus/minus factor list; treat zero as a root separately.

Compatibility and review

Review status
Tested on a TI calculator
Tested on
Owner-tested TI-84 Plus CE Python calculator; exact branded .py transferred and launched individually
What happened
Passed: owner tested the exact 1.0.1 branded source bytes on a TI 84 Plus CE Python calculator.
Dependencies
No imports
Suggested calculator name
P1RZERO — 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 P1RZERO 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.