Hidden WordScanner
Private scans · No account required

DuckieDai Quadratic Inequality Solver

Solve a quadratic inequality using its real roots, leading sign, and endpoint inclusion.

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 quadratic inequality using its real roots, leading sign, and endpoint inclusion.

  • Owner-tested on a TI calculator
  • Version 1.0.0
  • 3796 bytes
  • Uses math

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
  • The leading coefficient a is nonzero.
  • The program solves quadratics only; a zero leading coefficient is outside its supported input domain.
  • An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.

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 Quadratic Inequality Solver for TI-84 Plus CE Python."""
  2. from math import sqrt
  3. def duckiedai_intro(program_name, wait=True):
  4. title = program_name[:16]
  5. empty = 16 - len(title)
  6. left = empty // 2
  7. right = empty - left
  8. print("+----------------------+")
  9. print("| " + " " * left + title + " " * right + " |")
  10. print("| |")
  11. print("| __ |")
  12. print("| ___(o )> quack! |")
  13. print("| \\ <_. ) |")
  14. print("| `---' |")
  15. print("| by DuckieDai |")
  16. print("| hiddenwordscanner.com|")
  17. print("+----------------------+")
  18. print("Loading...")
  19. if wait:
  20. input("Press enter to start ")
  21. print("\n" * 8)
  22. def gcd(a,b):
  23. a=abs(a)
  24. b=abs(b)
  25. while b:
  26. a,b=b,a%b
  27. return a
  28. def rat(n,d):
  29. if d<0:
  30. n=-n
  31. d=-d
  32. g=gcd(n,d)
  33. n//=g
  34. d//=g
  35. if d==1:
  36. return str(n)
  37. return str(n)+"/"+str(d)
  38. def radroot(a,b,d,sgn):
  39. # simplify sqrt(d)
  40. k=1
  41. i=int(sqrt(d))
  42. while i>1:
  43. if d%(i*i)==0:
  44. k=i
  45. break
  46. i-=1
  47. r=d//(k*k)
  48. A=-b
  49. B=sgn*k
  50. C=2*a
  51. g=gcd(gcd(A,B),C)
  52. if g!=0:
  53. A//=g
  54. B//=g
  55. C//=g
  56. if C<0:
  57. A=-A
  58. B=-B
  59. C=-C
  60. if abs(B)==1:
  61. term="sqrt("+str(r)+")"
  62. else:
  63. term=str(abs(B))+"*sqrt("+str(r)+")"
  64. if A==0:
  65. if B<0:
  66. top="-"+term
  67. else:
  68. top=term
  69. else:
  70. if B<0:
  71. top=str(A)+"-"+term
  72. else:
  73. top=str(A)+"+"+term
  74. if C==1:
  75. return top
  76. return "("+top+")/"+str(C)
  77. duckiedai_intro("Quad Inequality")
  78. a=int(input("a: "))
  79. b=int(input("b: "))
  80. c=int(input("c: "))
  81. print("1 >0")
  82. print("2 >=0")
  83. print("3 <0")
  84. print("4 <=0")
  85. op=input("Choice: ")
  86. d=b*b-4*a*c
  87. if d>0:
  88. q=int(sqrt(d))
  89. if q*q==d:
  90. n1=-b-q
  91. n2=-b+q
  92. den=2*a
  93. v1=n1/den
  94. v2=n2/den
  95. s1=rat(n1,den)
  96. s2=rat(n2,den)
  97. else:
  98. v1=(-b-sqrt(d))/(2*a)
  99. v2=(-b+sqrt(d))/(2*a)
  100. s1=radroot(a,b,d,-1)
  101. s2=radroot(a,b,d,1)
  102. if v1>v2:
  103. v1,v2=v2,v1
  104. s1,s2=s2,s1
  105. print("Roots:")
  106. print(s1)
  107. print(s2)
  108. print("Solution:")
  109. if a>0:
  110. if op=="1":
  111. print("(-inf,"+s1+")")
  112. print("U ("+s2+",inf)")
  113. elif op=="2":
  114. print("(-inf,"+s1+"]")
  115. print("U ["+s2+",inf)")
  116. elif op=="3":
  117. print("("+s1+","+s2+")")
  118. else:
  119. print("["+s1+","+s2+"]")
  120. else:
  121. if op=="1":
  122. print("("+s1+","+s2+")")
  123. elif op=="2":
  124. print("["+s1+","+s2+"]")
  125. elif op=="3":
  126. print("(-inf,"+s1+")")
  127. print("U ("+s2+",inf)")
  128. else:
  129. print("(-inf,"+s1+"]")
  130. print("U ["+s2+",inf)")
  131. elif d==0:
  132. s=rat(-b,2*a)
  133. print("Root:",s)
  134. print("Solution:")
  135. if a>0:
  136. if op=="1":
  137. print("(-inf,"+s+")")
  138. print("U ("+s+",inf)")
  139. elif op=="2":
  140. print("ALL REAL")
  141. elif op=="3":
  142. print("EMPTY SET")
  143. else:
  144. print("{"+s+"}")
  145. else:
  146. if op=="1":
  147. print("EMPTY SET")
  148. elif op=="2":
  149. print("{"+s+"}")
  150. elif op=="3":
  151. print("(-inf,"+s+")")
  152. print("U ("+s+",inf)")
  153. else:
  154. print("ALL REAL")
  155. else:
  156. print("No real roots")
  157. print("Solution:")
  158. if a>0:
  159. if op=="1" or op=="2":
  160. print("ALL REAL")
  161. else:
  162. print("EMPTY SET")
  163. else:
  164. if op=="3" or op=="4":
  165. print("ALL REAL")
  166. else:
  167. print("EMPTY SET")
Filename
QINQS.py
Size
3796 bytes
SHA-256
90ff0c75184db4cc236faffc540e33191781c872370bbb558d78377f8051218b

Usage

Inputs

  • Integer coefficients a, b, and c for ax^2 + bx + c
  • One menu choice for strict or inclusive positive or negative results

Outputs

  • Roots in simplified rational or radical form
  • Interval, singleton, all-real, or empty-set solution

Units: Polynomial coefficients; no physical units.

Assumptions and limitations

Assumptions

  • The leading coefficient a is nonzero.

Constraints

  • The program solves quadratics only; a zero leading coefficient is outside its supported input domain.

Known failures

  • An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.
  • A menu choice other than 1 to 4 is treated as choice 4.
  • Non-integer 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
math
Suggested calculator name
QINQS — 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. QINQS 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.