Top Banner
Teach Math Thomas Risse IIA, HSB Professors Why Math Implications Students Conditions Observations Projects Research Conclusions SAGE Similarities & Differences Calculus (Symbolic) Linear Algebra Numerics ODEs Programming SAGE offers more than MATLAB Teaching Math to CS Students – Efforts, Experiences, Effects – Teaching Math Using SAGE Thomas Risse Institute for Informatics & Automation, IIA Faculty EEE & CS, Hochschule Bremen University of Applied Sciences [email protected] Presentation 19.8.2014 German Jordanian University
32

Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Aug 26, 2018

Download

Documents

hanhu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Teaching Math to CS Students– Efforts, Experiences, Effects –

Teaching Math Using SAGE

Thomas RisseInstitute for Informatics & Automation, IIAFaculty EEE & CS, Hochschule Bremen

University of Applied [email protected]

Presentation 19.8.2014German Jordanian University

Page 2: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Agenda1 Professors View

Why is Math Important to CS?

Implications to the Curricula

2 Students View

Learning PreConditions

Observations

3 Projects in the Context of Teaching

4 Math Related Research5 Conclusions

6 SAGE = System for Algebraic & Geometric Experimentation

Similarities & Differences

(Symbolic) Calculus

(Symbolic) Linear Algebra

Numerics

Ordinary Differential Equations

Programming

SAGE offers more than MATLAB

Page 3: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Why is Math Important to CS, toCS Students?

personal answer: one could not do without it . . .

some (optional) modules (in alphabetical order) with somerelevant math

• algorithms and their complexity

• cryptography (discrete math)

• error correcting codes (linear algebra, arithmetic in finite fields)

• generative computer graphics (homogenous coordinates,freeform surfaces: Bézier, B-spline, NURBS etc)

• image processing (discrete Fourier transform etc)

• scientific computing (linear algebra, analysis/calculus)

Page 4: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Why is Math Important to CS?

my colleagues teach for example

• metrology (stochastics)

• control (Laplace transform)

• modelling and simulation (differential equations)

I also teach computer architecture which links hardware tosoftware issues, i.e. machines to algorithms!

Page 5: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Implications to the CurriculaWe think math as important as to assign several modules to it:

TI,ISTI,MEI,DSInf MI IFI

1. linear algebra,analytical geome-try

analysis, linearalgebra, analyti-cal geometry

logic, sets, rela-tions, mappings,number systems

2. analysis & ode stochastic, diffe-rential geometry(parametric cur-ves and surfa-ces), numerics

linear algebra,analytical geo-metry, graphs,applied analysis,number theory

3. multidimensionalanalysis, stocha-stic

Math is the only module spanning two or even three semesters.

At the same time: we have to decide

• self contained math modules or

• modules with application specific math integrated

Page 6: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Students View

http://http:

//www.os-community.de/Gruppe/57555/Mathe_ist_

ein_Arschloch_und_Physik_sein_kleiner_Bruder

Page 7: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Learning PreConditions

There are more and more problems [5] like

• dubious competencies acquired in school• extremely vague• very unreliable• insecure knowledge• barely expressible, hardly applicable

• taking notes instead of following the argument

• exercises only for eager beavers . . . ’exercises have nothing to do with exams . . .

• engaging in, examining of, quarrelling with math• entrenchment of math in applications• fluency in dealing with math• sustained learning of math

• dubious time management, procrastination [8],start learning 5min before the exam

Page 8: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Observations

Growing deficits in basic competencies

• to read and to understand (long) text and formulae

• to write concise answers

• to do mental arithmetic

Growing difficulties

• to observe and to draw conclusions

• to identify (modelling, programming, ...) errors

• to check plausibility

• to model, to abstract, cp OO

The only problem solving strategy is trial and error . . .

Unwillingness to monitor the own learning process!

Page 9: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Why learn math?

http://www.glasbergen.com/wp-content/gallery/

math-cartoons/toon700.gif

Page 10: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

How to learn math?

http://www.glasbergen.com/wp-content/gallery/

math-cartoons/toon-1674.gif

Page 11: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

’in spite of hours of google nosolution found . . . ’

http:

//www.trottermath.net/humor/estimatedtime.gif

Page 12: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

in the light of [6] no 117

for example

already 1934http://www.openculture.

com/2014/01/

the-president-of-northwestern-university-predicts-online-learning-in-1934.

html

• http://AULIS.

hs-bremen.de

• http://weblearn.

hs-bremen.de/

risse/MAI/docs

• WWW with e.g.http://de.

wikipedia.org

• http://youtube.de

with Jörn’s chanel

• MOOCs likehttp://www.

openculture.com/

math_free_courses

• http://www.

wolframalpha.com

Page 13: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Teaching Related ProjectsBesides the yearly preparatory courses (WS14/15: with OMB[4]) for the new students

1 integration of text and algorithm: documents whichcompute, see [6] no 53,55,76

• numerik.pdf, numerics.pdf: basic numericalgorithms, CORDIC ([6] no 66,67,68)

• puzzles.pdf, ePuzzles.pdf: some riddles, primenumbers, finite fields GF(pm), cryptography (DES, AES,RSA, ECC), compression, intuition and probability

• heath.pdf: addons to M.T.Heath: Scientific Computing

2 Känguru competitions in 2001–2004 and collections ofKänguru problems with solutions since 1998 http:

//www.weblearn.hs-bremen.de/risse/MAI/docs/Kanguru/

3 televise – a notebook university project, see [6] no 59–65• database of exercises⇒ LOSPN, see [6] no 69,71,72• tutors provide online support when students work on

assignments

Page 14: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Teaching Related Projects’

4 self organized learning, cp [3], see [6], no 82,85,86

5 graphical inputs in exams, e.g. sketch a normal parabola,see [6] no 74,75,77,78

6 Fit in Math, FiM, uses CAS• to pose questions on ILIAS• to evaluate the answers of the learners• to provide feedback

in drill/self-test/exam mode, see [6] no 88,93,103,106

7 learning math3 in projects, SS12: Systems of Springsand WS12/13: Baumgartner up/down, many bodies,see [6] no 120,124,125

8 collaborative coaching, WS13/14, see [6] no 131• weekly obligatory homework• support when working on homework• relate/integrate math3 and metrology

Page 15: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Teaching Related Projects”

9 flipped classroom in physics, SS13, SS14, cp [3], [2]10 reflections on observations of the learning behaviour of

my students• pocket calculators, see [6] no 102,107• first year students attitude, see [6] no 121• students being online all the time, see [6] no 117

11 orientation• How much numerics is needed? see [6] no 70• Math in relation to Science: Body and Soul framework,

see [6] no 95,98

12 political demands• pocket calculators, see [6] no 90,104,105• advisory opinion, petition, see http:

//www.weblearn.hs-bremen.de/risse/papers/GTR/

Page 16: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Math Related Research

• eLearning, eTests, see [6] no 49–52,56–58,74,75,77,78,FiM 87,88,93,103,106

• CORDIC algorithms, see [6] no 66,67,68

• The Non-Intuitive in Mathematics, see [6] no 79,80,81

• Elliptic Curve Cryptography, ECC, see [6] no 83,84,89

• Markov chains, see [6] no 91,92,94

• Zernike polynomials, see [6] no 119

• SAGE, see [6] no 108,110–116,118,122

• Goppa Codes, see [6] no 109,115,116,126

• Random Numbers, see [6] no 127,130,132

• System for Teaching and Assessment using a Computeralgebra Kernel, STACK, http://www.stack.bham.ac.uk/,see FiM and [6] no 123,128,134

Page 17: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Some Concluding Remarks

• growingly firm conviction of the importance of math forCS⇒ no progress without mathI’m not alone: just google ’math computer science’:the first hits are from Princeton (LL), MIT (open courseware: discrete math, algorithms), Oxford (stressinginterdependence), Imperial College (’jointly’), Yale(interdepartmental major), CalTech (Computing +Mathematical Sciences) . . .

• growingly firm conviction that students learn more if theyare asked to solve problems from all parts of science likee.g. those inSteven C. Chapra: Applied Numerical Methodsusing some CAS, e.g. the open source SAGE, Systemfor Algebraic and Geometric Experimentation.

• if one really wants to integrate research and teaching(cp my research) then students need even more math . . .

Page 18: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

SAGE = System for Algebraic and Geometric Experimentation

vs MATLAB&SMT or Octave&GinaCSimilarities

both are CASs (Symbolic Math Toolbox incl.), command lineoriented, programmable, problem oriented, extendable etc.both feature graphical capabilities, different workspaces,interpreted, precompiled, object orientation etc.

DifferencesSAGE MATLABlocal implementation local implementation& web interfacePython m-filesmany predefined data types few predefined data typesobjects handlesmodules toolboxesopen source proprietary/open sourcebrowser installation

Page 19: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

(Symbolic) Calculus

visualisationplot(sin(x)) ezplot('sin(x)')

plot(sin(x),-3,3) ezplot('sin(x)',-3,3)

p=plot(sin(x),-3,3, \color='red');

q=plot(cos(x),-3,3, \color='blue');

show(p+q);

hdl=ezplot('sin(x)',-3,3);

set(hdl,'color','r');

hold on;

hdl=ezplot('cos(x)',-3,3);

set(hdl,'color','b');

hold off;

plot(1/x,detect_poles=True) ezplot('1/x',-1,1)

Page 20: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

(Symbolic) Calculus

Differentiation and Integration

diff(sin(x)/x,x) diff(sin(x)/x,x)

integral(x*sin(x),x) int(x*sin(x),x)

integral(exp(-x∧2/2),x,0,1) int(exp(-x∧2/2),x,0,1)

of course, with numerical evaluation, e.g.

N(integral(sin(x)/x,x,0,1)) N(int(sin(x)/x,x,0,1))

e.g. one of my GJU students asked for power and Taylor series

f.taylor(x,xo,ord) taylor(f,x,xo,...)

Page 21: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Solving equations symbolically

e.g. linear (systems)

vrs=var('a b c d e f x y');

solve([ \a*x+b*y==c, \d*x+e*y==f],x,y)

syms a b c d e f x y;

[x y] = solve( ...

'a*x+b*y-c', ...

'd*x+e*y-f',x,y)

e.g. non-linear

vars=var('a b c d x');

solve( \a*x∧3+b*x∧2+c*x+d==0,x)

syms a b c d x;

solve( ...

'a*x∧3+b*x∧2+c*x+d')

e.g. differential

t = var('t');

x = function('x',t);

desolve(diff(x,t)+x==1,[x,t])

% t is independent

% var by default

dsolve('Dx+x=1')

Page 22: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Linear Algebra

vectors & matricespnts = [(random(),random())\for _ in range(5)];

p = line(pnts);

c = cos(pi/4);

s = sin(pi/4);

R=N(matrix([[c,s],[-s,c]]));

pnts = matrix(pnts)*R;

q=line([(pnts[i,0],pnts[i,1])\for i in range(5)],\color='red');

(p+q).show()

plgn = rand(2,5);

plot(plgn(1,:), ...

plgn(2,:));

hold on;

c=cos(pi/4);

s=sin(pi/4);

R = [c s;-s c];

plgn = R*plgn;

plot(plgn(1,:), ...

plgn(2,:),'r');

hold off;

Page 23: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

(Symbolic) Linear Algebra

linear equations

vars = var('a,b,c,d,e,f');

A = matrix([[a,b],[c,d]]);

b = vector([e,f]); A\b

syms a b c d e f;

A = [a b;c d];

b = [e;f]; A\b

or again, also symbolically

A = matrix([[1,2,3], \[3,2,1],[1,1,1]]);

b =vector([0,-4,-1]); A\b

A = sym([1,2,3; ...

3,2,1;1,1,1]);

b =sym([0;-4;-1]); A\b

eigenvalues & eigenvectors

A = matrix([[1,2,3], \[3,2,1],[1,1,1]]);

A.eigenvalues(); # or

A.eigenvectors_right();

A = sym([1,2,3; ...

3,2,1;1,1,1]);

eig(A) % or

[V,D] = eig(A);

Page 24: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Numerics

both CASs based on based on BLAS or LAPACK routines

• solving linear equations by decomposition:LU, Cholesky, Schur, SVD

• least squares, eigenvalues & eigenvectors

• solving non-linear equations

• quadrature, double/tripple quadrature

• solving ordinary differential equations

x = var('x');

find_root( \cos(x)==sin(x),0,pi/2)

% x0 is start guess

% or start intervall

fzero( ...

@(x)(cos(x)-sin(x)), x0)

Page 25: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Ordinary Differential Equations – IVP

Volterra-Lottka IVP model y′ =(

y1(a− by2)y2(−c + dy1)

)for

t ∈ [0, 25] and for two populations y1(t) and y2(t).

# initialize

# a,b,c,d,y0[0],y0[1]

def odefun(y,t):

return [ \y[0]*(a-b*y[1]), \y[1]*(-c+d*y[0])];

t = srange(0,25,0.01);

y = odeint(odefun,y0,t)

% initialize

% a,b,c,d,y0(1),y0(2)

function fvl = odef(t,y)

fvl=[y(1)*(a-b*y(2));...

y(2)*(-c+d*y(1))];

end

tspan = [0 25];

[t y_ode45] = ...

ode45(@odef,tspan,y0);

Page 26: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Ordinary Differential Equations – BVP

Some BVP u′′ + 2u′ + u = 0 for 0 ≤ x ≤ π2 with

u(0) = 3, u(π2 ) = 2 is equivalent to y′ =(

y2

−2y2 − y1

)vars = var('x');

de = diff(y,x,2)+ \2*diff(y,x)+y==0;

sln = desolve(de, \y,[0,3,pi/2,2]);

plot(sln(x),(x,0,pi/2));

# there are packages

# like the numerical

# scikits.bvp_solver

# also ...

f = @(x,y) [y(2); ...

-y(2)-y(1)];

g = @(ya,yb)[ya(1)-3; ...

yb(1)-2];

x = linspace(0,pi/2,10)';

yguess=@(x)[3-2*x/pi; ...

-2/pi];

init = bvpinit(x,yguess);

sln = bvp4c(f,g,init);

xp = 0:0.01:pi/2;

plot(xp,deval(sln,xp,1));

Page 27: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Animations

anmt = animate( \[point([ \2*sin(pi/8*cos(t)),\2*(1-cos(pi/8*cos(t)))])\for t in \srange(0,11,0.1)],\xmin=-1,xmax=1, \ymin=0,ymax=2)

anmt.show()

plot([-2,2,0,0], ...

[0,0,0,2],'k');

hold on;

h=plot(0,0,'.k');

while true

set(h,'xData', ...

2*sin(pi/8*cos(t)));

set(h,'yData', ...

2-2*cos(pi/8*cos(t)));

drawnow;

end; hold off;

Page 28: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

Interactions

@interact

def NN(a=(0,2), \b=1, c=[0,2,4])

p=plot( \a*x∧2+b*x+c,\

-2,2);

p.show();

% begin code snippet

a = get(ha,'Value');

b=double(get(hb,'String'));

c = get(hc,'Value');

f = @(x) a*x.∧2+b*x+c;ezplot(f);

% end code snippet

Page 29: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

SAGE offers more than MATLAB

in the face of a reference manualhttp://www.sagemath.org/doc/reference/

with more than 8000 pages I can give some examples only:

• Discrete Mathematics, e.g.• arithmetic in any finite fields, cp my error correcting codes• partitions, cp Ala’a problem• graph theory, cp my scheduling problems• combinatorics

• Rings, Fields, Algebras

• Groups, Monoids, Matrices, Modules

• e.g. Combinatorial Geometry, Cell Complexes and theirHomology, Differential Forms, Parametrized Surfaces

• Number Theory, Algebraic Geometry, cp my ECC

• . . .

Page 30: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

My Personal Outlook

http://www.sciencecartoonsplus.com/gallery/

math/math155_public-spirited-mathematician.gif

Page 31: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

References

[1] Sidney Harris: Math Cartoons;http://www.sciencecartoonsplus.com/gallery/math/index.php

http://www.sciencecartoonsplus.com/gallery/math/

math115_you-cant-be-a-mathematician.gif

[2] Jörn Loviscach: Didactics and Technology;http://www.j3l7h.de/videotech.html

Page 32: Teaching Math to CS Students – Efforts, Experiences, … · vs MATLAB&SMT or Octave&GinaC Similarities both are CASs (Symbolic Math Toolbox incl.), command line oriented, programmable,

Teach Math

Thomas RisseIIA, HSB

ProfessorsWhy Math

Implications

StudentsConditions

Observations

Projects

Research

Conclusions

SAGESimilarities & Differences

Calculus

(Symbolic) Linear Algebra

Numerics

ODEs

Programming

SAGE offers more than MATLAB

References’

[3] Jörn Loviscach: Das Inverted Classroom Model;https://www.youtube.com/watch?v=Ob8yyXf2tOU

[4] MUMIE – Multimediale Mathematikausbildung: Online MathematikBrückenkurs; https://www.om-bridge.de/

[5] Ben Orlin: What It Feels Like to Be Bad at Math – My hazy, anxious,defensive procrastination made me a better teacher.http://www.slate.com/articles/health_and_science/science/

2013/04/math_teacher_explains_math_anxiety_and_

defensiveness_it_hurts_to_feel_stupid.single.html

[6] Thomas Risse: papershttp://www.weblearn.hs-bremen.de/risse/papers/papers.htm

[7] William Stein et al: SAGE www.sagemath.org

[8] David Weigert: The Day Before;http://davidweigert.com/The-Day-Before