.
1 / 151
. 1 / 151 Computer Algebra Basic Information Working defjnition - - PowerPoint PPT Presentation
. 1 / 151 Computer Algebra Basic Information Working defjnition of Computer Algebra: Algorithms, techniques and tools to assist with mathematical work (not just numerical). Syllabus lecture log for details). 2. Basic Structures and
1 / 151
▶ Lecture log here.
2 / 151
▶ A timetabled way for you to get to know the system. ▶ Write some simple code.
▶ Key practical showing connection of abstract ideas with
▶ Write some code. ▶ Some pencil and paper parts also.
▶ Uses ideas from the course with Axiom facilities as tools. ▶ Do some calculations with Axiom (on ideals). ▶ Some pencil and paper parts. ▶ Do a past exam. 3 / 151
4 / 151
5 / 151
6 / 151
7 / 151
8 / 151
9 / 151
10 / 151
11 / 151
cauchy(p:POLY(FRAC(INT))):Float== local V,x,n V:=variables(p) if #(V)>1 then error "The input must be a univariate polynomial" else if #(V)=1 then x:=V.1 if leadingCoefficient(p)<0 then p:=-p C:=coefficients(p) n:=0 for c in C repeat if c<0 then n:=n+1 if n=0 then error "The polynomial has no positive roots" else m:=degree(p,V).1 lc:=leadingCoefficient(p) Blist:=[]::List(AlgebraicNumber) for i in 0..m-1 repeat coeff:=coefficient(p,x,i) if coeff<0 then Blist:=cons((-n*coeff/lc)^(1/(m-i)),Blist) B:=map(r+->r::Float,Blist) mx:=B.1::Float for v in B repeat if v::Float>mx then mx:=v::Float mx 12 / 151
13 / 151
14 / 151
15 / 151
16 / 151
17 / 151
18 / 151
▶ Write
19 / 151
▶ Addition is symmetric difgerence, i.e., A + B is A ∪ B − A ∩ B. ▶ Multiplication is intersection, i.e., A ∗ B is A ∩ B.
20 / 151
21 / 151
22 / 151
23 / 151
24 / 151
25 / 151
▶ Each object has exactly one representation.
▶ This means that we can test objects for equality.
26 / 151
27 / 151
28 / 151
29 / 151
30 / 151
31 / 151
32 / 151
33 / 151
34 / 151
35 / 151
36 / 151
37 / 151
38 / 151
39 / 151
40 / 151
41 / 151
42 / 151
43 / 151
44 / 151
45 / 151
46 / 151
47 / 151
48 / 151
49 / 151
50 / 151
51 / 151
52 / 151
53 / 151
54 / 151
▶ L.h.s. needs less than 10 bytes. ▶ R.h.s. needs well over a 1,000,000 bytes!
55 / 151
56 / 151
57 / 151
58 / 151
59 / 151
60 / 151
61 / 151
62 / 151
63 / 151
64 / 151
65 / 151
66 / 151
67 / 151
68 / 151
69 / 151
70 / 151
71 / 151
72 / 151
73 / 151
74 / 151
75 / 151
76 / 151
77 / 151
▶ This is critical. ▶ p not a prime means Zp is not an ID, gcd’s need not exist in
▶ Example: in Z6[x] we have
78 / 151
79 / 151
80 / 151
81 / 151
82 / 151
Res(A, B) =
am−1 . . . a0 am am−1 . . . a0 · · · · · · · · am am−1 . . . a0 bn bn−1 . . . b0 bn bn−1 . . . b0 · · · · · · · · bn bn−1 . . . b0
83 / 151
84 / 151
85 / 151
86 / 151
87 / 151
88 / 151
89 / 151
90 / 151
91 / 151
92 / 151
93 / 151
94 / 151
95 / 151
96 / 151
97 / 151
98 / 151
99 / 151
100 / 151
101 / 151
102 / 151
103 / 151
104 / 151
105 / 151
106 / 151
107 / 151
108 / 151
109 / 151
110 / 151
111 / 151
112 / 151
113 / 151
114 / 151
115 / 151
116 / 151
117 / 151
118 / 151
119 / 151
120 / 151
121 / 151
122 / 151
123 / 151
124 / 151
125 / 151
126 / 151
127 / 151
128 / 151
129 / 151
130 / 151
131 / 151
ISOL(p(x), a, b) → [E, A] (p(x) is square free. E is a list of (some of the) exact roots of p(x) which lie in (a, b) and A is a list of isolating intervals for the rest of the roots of p(x) in (a, b).) 1. E := [ ]; A := [ ]; r := RCOUNT(p(x), a, b); 2. if r = 0 then return [[ ], [ ]] elif r = 1 then return [[ ], [(a, b)]] fj; 3. W := [[a, b, r]]; (to be explored further) 4. while W ̸= [ ] do remove the fjrst element [c, d, r] from W; m := (c + d)/2; if p(m) = 0 then E := [op(E), m]; p(x) := p(x)/(x − m) fj; r := RCOUNT(p(x), a, m); if r = 1 then A := [op(A), (a, m)] elif r > 1 then W := [op(W), [a, m, r]] fj; r := RCOUNT(p, m, b); if r = 1 then A := [op(A), (m, b)] elif r > 1 then W := [op(W), [m, b, r]] fj;
132 / 151
133 / 151
134 / 151
135 / 151
136 / 151
137 / 151
138 / 151
139 / 151
140 / 151
141 / 151
w3 + w2 − 2w − 1 w3 + 2w2 − w − 1 z3 − z2 − 2z + 1 z3 + 6z2 + 5z + 1 y3 + 3y2 − 4y + 1 7y3 + 14y2 + 7y + 1 x3 − 7x + 7 T I T I T I
142 / 151
143 / 151
144 / 151
145 / 151
146 / 151
147 / 151
3. while T ̸= [ ] do remove the fjrst element [pM(x), M(x), vM] from T; b := LBPR(pM(x)); if b ≥ 1 then pM(x) := Moebius(pM(x), b + x); M(x) := M(b + x); if pM(0) = 0 then E := [op(E), M(0)]; pM(x) := pM(x)/x fj; fj; v1 := vM; pM1 := Moebius(pM(x), 1 + x); M1 := M(1 + x); if pM1 (0) = 0 then E := [op(E), M1(0)]; pM1 (x) := pM1 (x)/x fj; vM1 := VAR(pM1 ); if vM1 > 1 then T := [[pM1 (x), M1(x), vM1 ], op(T)] elif vM1 = 1 then A := [op(A), make_interval(pM1 (x), M1(x))] fj; if v1 ̸= vM1 then (pM(x) might have roots in (0, 1)) pI(x) := Moebius(pM(x), 1/x); if lc(pI(x)) < 0 then pI(x) := −pI(x) fj; MI := M(1/x); pM1 := Moebius(pI(x), 1 + x); M1 := MI(1 + x); vM1 := VAR(pM1 (x); if vM1 > 1 then T := [[pM1 (x), M1(x), vM1 ], op(T)] elif vM1 = 1 then A := [op(A), make_interval(pM1 (x), M1(x))] fj fj
148 / 151
200 400 600 800 1000 500000 1x106 1.5x106 2x106
149 / 151
200 400 600 800 5x108 1x109 1.5x109 2x109
150 / 151
200 400 600 800 1000 5x108 1x109 1.5x109 2x109
151 / 151