rational functions · MIT License
Overview
Classify a rational function as having y-axis symmetry, origin symmetry, or neither by comparing numerator and denominator coefficients under x replaced by negative x.
- Tested on a TI calculator
- Downloaded 44 times
- Version 1.0.0
- 1549 bytes
- No imports
Tried it? Did this program work on your calculator?
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
- Coefficients are entered from the highest power down to the constant term.
- The program tests symmetry from entered coefficients; it does not factor or simplify the rational function.
- Equivalent expressions can appear different until common factors are simplified first.
Try the DuckieDai calculator screen
Follow the reviewed program prompts and calculation flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How symmetry of a rational function works
The idea
Some graphs are mirror images across the y-axis and some look the same after a half turn about the origin. You test for this by replacing x with -x.
If nothing changes, the function is even. If every sign flips, it is odd.
The formula
f(-x) = f(x): y-axis symmetry (even)
f(-x) = -f(x): origin symmetry (odd)
f(-x)- the function with x replaced by -x
Using the program
- Enter the degree of the top and each of its coefficients, then the same for the bottom.
- The program reports Y-AXIS, ORIGIN, or NEITHER.
Worked example
Check x/(x^2 + 1). Enter top degree 1 with coefficients 1 and 0, then bottom degree 2 with coefficients 1, 0, and 1.
The program shows ORIGIN: replacing x with -x flips the sign of the whole fraction.
Tips and common mistakes
- Enter a 0 for any missing power.
- Most functions have neither symmetry.
- Knowing the symmetry lets you plot half the graph and reflect it.
Where this comes up
Even and odd functions are taught in algebra 2 and precalculus when graphing, and the idea is used in calculus and physics to simplify integrals and wave problems.
Exact reviewed bytes
Source code
"""DuckieDai Rational Symmetry Checker for TI-84 Plus CE Python."""def duckiedai_intro(program_name,wait=True):title=program_name[:16];e=16-len(title);l=e//2;r=e-lprint("+----------------------+\n| "+" "*l+title+" "*r+" |\n| |\n| __ |\n| ___(o )> quack! |\n| \\ <_. ) |\n| `---' |\n| by DuckieDai |\n+----------------------+\nLoading...")if wait:input("Press enter to start ");print("\n"*8)def clear_screen():print("\n"*8)def number(prompt):while True:try:return float(input(prompt))except ValueError:print("Enter a number")def read_poly(name):clear_screen();print(name+"\n");degree=int(number("Degree: "));values=[]for power in range(degree,-1,-1):values.append(number("Const: " if power==0 else "x: " if power==1 else "x^"+str(power)+": "))return degree,valuesdef run_test():nd,n=read_poly("NUMERATOR");dd,d=read_poly("DENOMINATOR")flip=lambda degree,values:[-v if (degree-i)%2 else v for i,v in enumerate(values)]nn=flip(nd,n);dn=flip(dd,d);same=lambda a,b:all(abs(x-y)<.0000001 for x,y in zip(a,b));neg=lambda a,b:all(abs(x+y)<.0000001 for x,y in zip(a,b))clear_screen();print("SYMMETRY\n--------")if (same(nn,n)and same(dn,d))or(neg(nn,n)and neg(dn,d)):print("Y-AXIS")elif (neg(nn,n)and same(dn,d))or(same(nn,n)and neg(dn,d)):print("ORIGIN")else:print("NEITHER")duckiedai_intro("Rational Sym")while True:run_test();print("")if input("Again? y/n: ").lower()!="y":breakclear_screen();print("DuckieDai says: done!")
- Filename
SYMCKR.py- Size
- 1549 bytes
- SHA-256
57b36b2aa18b189807704db92a5d501f50e5ba80ec683923f3b4d52003bbffdf
Usage
Inputs
- Numerator polynomial degree and coefficients
- Denominator polynomial degree and coefficients
Outputs
- Y-axis symmetry, origin symmetry, or neither
Units: Polynomial coefficients and degrees; no physical units.
Assumptions and limitations
Assumptions
- Coefficients are entered from the highest power down to the constant term.
Constraints
- The program tests symmetry from entered coefficients; it does not factor or simplify the rational function.
Known failures
- Equivalent expressions can appear different until common factors are simplified first.
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 Rational Symmetry Checker program on a TI 84 Plus CE Python calculator.
- Dependencies
- No imports
- Suggested calculator name
SYMCKR— 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 SYMCKR 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
- 1.0.0 — current version, published . Download this reviewed version
Related learning
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.