Hidden WordScanner
Private scans · No account required

DuckieDai Inequality From Roots

Solve a polynomial inequality from zeros you already know: enter each distinct zero with its multiplicity and the leading sign, and read the solution intervals.

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

Solve a polynomial inequality from zeros you already know: enter each distinct zero with its multiplicity and the leading sign, and read the solution intervals.

  • Owner-tested on a TI calculator
  • Version 1.0.0
  • 2795 bytes
  • No imports

Before you run it

  • TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
  • TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
  • Every real zero of the polynomial is entered once with its correct multiplicity.
  • Any factor without real zeros is positive, so the leading sign describes the far right of the graph.
  • The program does not find zeros; use a zero finder or factoring first.

Try the DuckieDai calculator screen

Follow the program's prompts and result 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.

Exact reviewed bytes

Source code

Download .py

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

  1. """DuckieDai Inequality From Roots 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" * 8)
  21. def frac(x):
  22. for d in range(1,101):
  23. n=round(x*d)
  24. if abs(x-n/d)<0.000001:
  25. if d==1:
  26. return str(n)
  27. return str(n)+"/"+str(d)
  28. return str(round(x,4))
  29. def getroot():
  30. print("1 whole")
  31. print("2 fraction")
  32. t=input("Type: ")
  33. if t=="2":
  34. num=int(input("numerator: "))
  35. den=int(input("denominator: "))
  36. return num/den
  37. else:
  38. return float(input("value: "))
  39. duckiedai_intro("Ineq From Roots")
  40. n=int(input("Distinct roots: "))
  41. roots=[]
  42. mult=[]
  43. for i in range(n):
  44. print("Root",i+1)
  45. roots.append(getroot())
  46. mult.append(int(input("multiplicity: ")))
  47. # Sort roots and multiplicities together
  48. for i in range(n):
  49. for j in range(i+1,n):
  50. if roots[i]>roots[j]:
  51. roots[i],roots[j]=roots[j],roots[i]
  52. mult[i],mult[j]=mult[j],mult[i]
  53. print("Leading sign:")
  54. print("1 positive")
  55. print("-1 negative")
  56. lead=int(input("Sign: "))
  57. print("1 >0")
  58. print("2 >=0")
  59. print("3 <0")
  60. print("4 <=0")
  61. op=input("Choice: ")
  62. sign=[0]*(n+1)
  63. if lead>0:
  64. sign[n]=1
  65. else:
  66. sign[n]=-1
  67. for i in range(n-1,-1,-1):
  68. sign[i]=sign[i+1]
  69. if mult[i]%2==1:
  70. sign[i]=-sign[i]
  71. want=1
  72. if op=="3" or op=="4":
  73. want=-1
  74. include=(op=="2" or op=="4")
  75. print("Solution:")
  76. found=False
  77. for i in range(n+1):
  78. if sign[i]==want:
  79. found=True
  80. if i==0:
  81. left="-inf"
  82. lb="("
  83. else:
  84. left=frac(roots[i-1])
  85. if include:
  86. lb="["
  87. else:
  88. lb="("
  89. if i==n:
  90. right="inf"
  91. rb=")"
  92. else:
  93. right=frac(roots[i])
  94. if include:
  95. rb="]"
  96. else:
  97. rb=")"
  98. print(lb+left+","+right+rb)
  99. if include:
  100. for i in range(n):
  101. leftok=sign[i]==want
  102. rightok=sign[i+1]==want
  103. if not leftok and not rightok:
  104. found=True
  105. s=frac(roots[i])
  106. print("["+s+","+s+"]")
  107. if not found:
  108. print("EMPTY SET")
Filename
cubsolv.py
Size
2795 bytes
SHA-256
8a167b5abfe8bbc72c6bcda3efe79c2f62b42ac29a05d09fdd0c303456753463

Usage

Inputs

  • How many distinct zeros the polynomial has
  • Each zero as a decimal or as a numerator and denominator, with its multiplicity
  • Leading sign: 1 for positive, -1 for negative
  • One menu choice: 1 greater than zero, 2 greater than or equal, 3 less than zero, 4 less than or equal

Outputs

  • Solution intervals written with fractions where possible
  • Single points for the or-equal choices when an even-multiplicity zero touches the axis
  • EMPTY SET when nothing satisfies the inequality

Units: Polynomial zeros and coefficients; no physical units.

Assumptions and limitations

Assumptions

  • Every real zero of the polynomial is entered once with its correct multiplicity.
  • Any factor without real zeros is positive, so the leading sign describes the far right of the graph.

Constraints

  • The program does not find zeros; use a zero finder or factoring first.
  • Signs flip at odd multiplicities and stay the same at even multiplicities.

Known failures

  • A fraction with a zero denominator stops with a division-by-zero error.
  • A negative count of zeros stops with an index error.
  • A menu choice other than 1 to 4 is treated as choice 1.
  • Non-numeric input uses the calculator Python input error path.

Compatibility and review

Review status
Owner-tested on a TI calculator
Tested on
Owner reports personally testing this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
What happened
Owner reported pass on the calculator before the DuckieDai opening screen and website line were added. The steps after the opening screen are unchanged and were compared with the owner's file on desktop; this exact file has not yet been rerun on a calculator.
Dependencies
No imports
Suggested calculator name
CUBSOLV — 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

  1. Confirm that your calculator is the Python-capable model named above. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. CUBSOLV is a suggested name; you may choose another valid, unique calculator name.
  4. Open the Python App, select the program, and check sample inputs before relying on other results.

Read the complete installation, launch, troubleshooting, and removal guide.

Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.

Version history

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.

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. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.