Sagemath 2: Number Theory and RSA Cryptosystem

Total Page:16

File Type:pdf, Size:1020Kb

Sagemath 2: Number Theory and RSA Cryptosystem SageMath 2: Number Theory and RSA Cryptosystem Cheng-Hsin Hsu Na#onal Tsing Hua University Department of Computer Science CS3330 Scienfic Compung 1 Divisibility • a and b are integers, b divides a if there exists an integer q such that a=qb – b is a divisor of a – b is a factor of a – a is a mul>ple of b • Example – 12 divides 144, because 144 = 12 x 12 – Every integer divides 0 – 0 does not divide any integer, except 0 itself CS3330 Scienfic Compung 2 Modular Arithme>c • Example: 16 3=5 1 ÷ ··· Dividend Divisor Quo2ent Remainder • For any , there exist unique such a, b Z,b 0 q, r Z P ° P that a qb r, 0 r b “ ` § † – SageMath/Python: (i) is possible, and b<0 br 0, r < b ≥ | | | | • Modulo • 16 mod 3 = 1 • 12 mod 5 = 3 − CS3330 Scienfic Compung 3 Modular Arithme>c in SageMath q = a div b = a/b b c Quo2ent r = a mod b = a qb − Modulo a = qb + r Validaon CS3330 Scienfic Compung 4 Integers in Base Other than 10 • Write 6137 in the octal system (base 8). In other words, finds r0, r1, …, rk so that (6137)10=(rk…r2r1r0)8 • Write 3387 into binary (base 2) and hexadecimal (base 16) CS3330 Scienfic Compung 5 Convert Integers into Other Bases Validaon CS3330 Scienfic Compung 6 Exact Frac>ons: a Toy Problem • Start from our familiar 10-based (decimal) system, for a frac>on number p/q , we some>me can represent it exactly in two- decimal-place (or fewer) – 1/2 = 0.50 – 1/3 = 0.3333333333333333333333333333333 – 1/4 = 0.25 – 1/5 = 0.20 p 100p =0.01z z = q 100 • Any rules?? q à q à | CS3330 Scienfic Compung 7 Divisors of 100 • Turns out that if q | 100, we can write p/q as a two-decimal-place exact decimal! • Let’s use SageMath to find all divisors of 100 • When q is in {3, 6, 7, 8, 9}: two decimals are not enough! ß What does this mean? – Spling 10k TA salary among 3 students! CS3330 Scienfic Compung 8 How About Other Bases • Consider binary? • Base-20? • Base-60? 1, 2, 3, 4, 5, 6, 8, 9, 10, 12,... { } • 20 and 60 are highly composite numbers – Simplify coun>ng, e.g., with base-60 system, 1/3 can be easily wrigen! CS3330 Scienfic Compung 9 Who Use Base-20 Systems? Maya Numerals Source: hps://en.wikipedia.org/wiki/Maya_numerals CS3330 Scienfic Compung 10 How About Base-60 System? Babylonian Numerals • We s>ll see base-60 systems in trigonometry and >me metrics Source: hps://en.wikipedia.org/wiki/Babylonian_numerals CS3330 Scienfic Compung 11 Prime and Composite • Primes are integers (n>1) with exactly two posive divisors • All other integers (n>1) are called composite • n Z` If is composite, then there is a prime P p such that p n | • 0 and 1 are neither prime nor composite CS3330 Scienfic Compung 12 Fundamental Theorem of Arithme>c a, b Z` p ab p a or p b • If and P p is a prime, then | ñ | | – Can be generalized to n posi>ve integers • Any integer n>1 can be wrigen as a (unique) k product of primes a = pt1pt2 ptk = pti 1 2 ··· k i i=1 – Factorizaon: canonical representaon Y • Exercise: What is the prime factorizaon of 980? • Prove that 17|n given 10 9 8 7 6 5 4 3 2 n 21 20 19 18 17 16 15 14 ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ CS3330 Scienfic Compung ¨ “ ¨ ¨ ¨ ¨ ¨ ¨ 13 ¨ Prime Related Fun Func>ons CS3330 Scienfic Compung 14 Prime Related Fun Func>ons (cont.) CS3330 Scienfic Compung 15 Common Divisors • For , is a common divisor of a, b Z c 0 a and b if P ° c a and c b | | • Let , where . Then is a a, b a 0 or b 0 c ` Z ‰ ‰ Z greatest common divisor (P gcd) of a and P b if – c a, c b | | – For any common divisor d of a and b, we know d c | • a, b Z` For all , there exists a unique greatest P common divisor of a and b, wrigen as gcd(a,b) – it is actually the smallest posi>ve integer that is a linear combinaon of a and b gcd(a, b)=ax + by CS3330 Scienfic Compung 16 Common Mul>ples • Let . a, b Z` c is a common mulple of a and b. P c is the least common mul>ple if it is the smallest posi>ve common mul>ple of a, b, we write c=lcm(a,b) • If and . For any a, b Z` c lcm a, b d that is a P “ p q common mulple of a and b, we know c|d • For all , a, b Z` ab=lcm(a,b)gcd(a,b) P CS3330 Scienfic Compung 17 Systemac Way to Find GCD and LCM • Exercise: Count the # of posi>ve divisors of 360 – Find 2 ways to do this in SageMath, hint: factor(.) and divisors(.) e1 e2 et f1 f2 ft e ,f 0, e ,f • Let , with m p p pt ,n p p pt i i i i “ 1 2 ¨¨¨ “ 1 2 ¨¨¨ • @ we have t t ai bi gcd m, n pi , and lcm m, n pi , p q“i 1 p q“i 1 π“ π“ where ai min ei,fi ,bi max ei,fi “ p q “ 3 3 p2 2 q1 2 – Find the gcd and lcm of 491891400 2 3 5 7 11 13 2 2 1 2 3 “1 and 1138845708 2 3 7 11 13 17 “ CS3330 Scienfic Compung 18 GCD and LCM Related Func>ons CS3330 Scienfic Compung 19 Euclidean Algorithm • Compute gcd(a,b) – r0=a, r1 = b – For i >= 1, stop when rn = 0 • ri+1 = ri mod ri-1 – gcd(a,b) = rn-1 • Example: gcd (1650, 2420) = 110 CS3330 Scienfic Compung 20 Extended Euclidean Algorithm • Compute x, y for gcd(a,b) = ax + by – r0=a, x0=1, y0=0 – r1= b, x0=0, y0=1 Example: a=2420, b=1650 – For i >= 1, stop when rn = 0 • qi=ri-1 div ri • xi+1 = xi-1 - qixi • yi+1 = yi-1 - qiyi • ri+1 = ri-1 - qiri – x=xi-1, y=yi-1, CS3330 Scienfic Compung 21 Linear Diophan>ne Equaons • For two non-zero integers a and b • There exist integer solu>ons for gcd(x,y)=ax +by ß extended Euclidean algorithm • ax+by=c has integer solu>ons iff gcd(a,b) | c • ax+by=1 has integer solu>ons iff gcd(a,b) = 1 – Relave prime (or co-prime) CS3330 Scienfic Compung 22 Congruence • If a and b have the same remainder upon division by n, a is congruent to b modulo n – Wrigen as a b (mod n) ⌘ – That is n (a b) | − • Example – 5 (23 8) | − – 23 8 (mod 5) • Congruence is ⌘ compable with addi>ons and mul>plicaons: and a b (mod n) c d (mod n) ⌘ ⌘ imply and a + c b + d (mod n) ac bd (mod n) ⌘ ⌘ CS3330 Scienfic Compung 23 Why Congruence is Useful? • Compute 122016 (mod 19) • Steps: 1. 12 2 = 144 11 (mod 19) ⌘ 2. 12 3 = 11 12 = 132 18 (mod 19) ⇥ ⌘ 3. 12 4 = 18 12 = 216 7 (mod 19) ⇥ ⌘ 4. 12 5 =7 12 = 84 8 (mod 19) ⇥ ⌘ 5. 12 6 =8 12 = 96 1 (mod 19) ⇥ ⌘ • We know 2016 = 6 x 336, what’s the answer? CS3330 Scienfic Compung 24 Linear Congruence • Linear congruence refers to an equaon ax b (mod m) ⌘ • m ax b It is the same as: , meaning that there | − ax b = my exists an y, so that − – Equivalent to ax my = b − • gcd(a, m) b The linear congruence has a solu>on iff | Slide 22 CS3330 Scienfic Compung 25 ax b (mod m) Solving Linear Congruence ⌘ • First, we apply the extended Euclidean algorithm to find u, v so that au + mv = gcd(a, m) • If , we have a gcd(a, m) b soluon x = ub/gcd(a,m) | aub 0 ß m b validate: show ?gcd(a, m) − • There are more solu>ons: ub m + i , where i =0, 1,...,gcd(a, m) 1 gcd(a, m) gcd(a, m) − m | (a/gcd(a,m)) im CS3330 Scienfic Compung 26 35x 10 (mod 240) ⌘ Example of Linear Congruence • Use extended Euclidean algorithm to get: 35 ( 41) + 240 6 = 5 = gcd(35, 240) ⇥ − ⇥ • One soluon: x = ub / gcd(35, 240) = (-41 x 10)/5 =-82 ß 158 (mod 240) • Step size: 240/5 = 48, then we have the following soluons {158, 158 + 48, 158 + 2 x 48, 158 + 3 x 48, 158 + 4 x 48} = {158, 206, 14, 62, 110} under (mod 240) CS3330 Scienfic Compung 27 Mul>plicave Inverse Modulo m • a is inverble modulo m is there is an inverse x so that ax 1 (mod m) ⌘ – a is inver>ble iff gcd(a, m)=1 • x is unique, and is denoted as a-1, where 0 <= a-1 < |m| • Example: Find the inverse of 65 mod 321 (if exists) – First, we have: 65 ( 79) + 321 16 = 1 ⇥ − ⇥ – Then, we have a-1 = -79 mod 321 ß what’s the ans? CS3330 Scienfic Compung 28 Congruence Classes • The congruence classes of mod m are: [a]= x a (mod m),x Z , where a =1, 2,...,m 1 {8 ⌘ 2 } − – Equivalent classes: reflec>ve, symmetric, and transi>ve – Note that [10] = [4] (mod 6) • The set of congruence classes mod m is wrigen as: Z/mZ = [0], [1],...,[m 1] { − } – Addi>ons and mul>plicaons are well defined ß see the next slide CS3330 Scienfic Compung 29 Operaons on Z/mZ • Two operaons: + and – [a] + [b] = [a+b] – [a][b] = [ab] • ( , +, Z/mZ ) is a commutave ring – + and are: commutave, associave, is distribu>ve w.r.t +, 1 is the iden>ty of mul>plicaon – [a] may not have inverse, only if gcd(a,m)=1 Hence, it’s not a field CS3330 Scienfic Compung 30 Euler’s Phi Funcon • φ(n) 1 z n We define as the number of , where gcd(z,n)=1 – What is ? φ(10) • Write code to compute phi func>on CS3330 Scienfic Compung 31 Euler’s Phi Func>on (cont.) • Try other x values for φ(x) • Suppose x and y are two dis>nct primes, what are the relaon among ? φ(x), φ(y), and φ(x y) ⇥ – Why? – In fact, as long as x and y are co-prime, the above discussion holds! • SageMath has phi built-in CS3330 Scienfic Compung 32 Divisors of an Integer • We define be the number of divisors of ⌧(x) x • We define be the sum of all the divisors of σ(x) x ⌧(250) σ(250) CS3330 Scienfic Compung 33 Built-in Sigma Func>on • Again, actually SageMath has a sigma func>on 1 + 3 + 5 + 9 + 15 + 45 = 78 12 +32 +52 +92 + 152 + 452 = 2366 10 +30 +50 +90 + 150 + 450 =6 What is this? CS3330 Scienfic Compung 34 Amicable Pairs of Numbers • An interes>ng Arab tradi>on: put two numbers 220 and 284 on their rings and give them to their spouses divisors(220) = 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110, 220 { } 1 + 2 + 4 + 5 + 10 + 11 + 20 + 22 + 44 + 55 + 110 = 284 divisors(284) = 1, 2, 4, 71, 142, 284 { } 1 + 2 + 4 + 71 + 142 = 220 CS3330 Scienfic Compung 35 Summary (So Far) • We introduced various number theory func>ons in SageMath • We will use them to introduce some cryptography results • References: – hgp://www.sagemath.org ß Official Web and resources – hgp://www.gregorybard.com/SAGE.html ß Our textbook CS3330 Scienfic Compung 36 How to Secretly Send Messages • Plaintext: human-readable messages • Ciphertext: scrambled message • Encrypon: plaintext à ciphertext • Decrypon: ciphertext à plaintext Encrypt Decrypt Plaintext Ciphertext Plaintext CS3330 Scienfic Compung 37 Naïve Way: ASCII Encoding • Let be the English ⌃ = A, B, .
Recommended publications
  • Ordinary Differential Equations (ODE) Using Euler's Technique And
    Mathematical Models and Methods in Modern Science Ordinary Differential Equations (ODE) using Euler’s Technique and SCILAB Programming ZULZAMRI SALLEH Applied Sciences and Advance Technology Universiti Kuala Lumpur Malaysian Institute of Marine Engineering Technology Bandar Teknologi Maritim Jalan Pantai Remis 32200 Lumut, Perak MALAYSIA [email protected] http://www.mimet.edu.my Abstract: - Mathematics is very important for the engineering and scientist but to make understand the mathematics is very difficult if without proper tools and suitable measurement. A numerical method is one of the algorithms which involved with computer programming. In this paper, Scilab is used to carter the problems related the mathematical models such as Matrices, operation with ODE’s and solving the Integration. It remains true that solutions of the vast majority of first order initial value problems cannot be found by analytical means. Therefore, it is important to be able to approach the problem in other ways. Today there are numerous methods that produce numerical approximations to solutions of differential equations. Here, we introduce the oldest and simplest such method, originated by Euler about 1768. It is called the tangent line method or the Euler method. It uses a fixed step size h and generates the approximate solution. The purpose of this paper is to show the details of implementing of Euler’s method and made comparison between modify Euler’s and exact value by integration solution, as well as solve the ODE’s use built-in functions available in Scilab programming. Key-Words: - Numerical Methods, Scilab programming, Euler methods, Ordinary Differential Equation. 1 Introduction availability of digital computers has led to a Numerical methods are techniques by which veritable explosion in the use and development of mathematical problems are formulated so that they numerical methods [1].
    [Show full text]
  • Numerical Methods for Ordinary Differential Equations
    CHAPTER 1 Numerical Methods for Ordinary Differential Equations In this chapter we discuss numerical method for ODE . We will discuss the two basic methods, Euler’s Method and Runge-Kutta Method. 1. Numerical Algorithm and Programming in Mathcad 1.1. Numerical Algorithm. If you look at dictionary, you will the following definition for algorithm, 1. a set of rules for solving a problem in a finite number of steps; 2. a sequence of steps designed for programming a computer to solve a specific problem. A numerical algorithm is a set of rules for solving a problem in finite number of steps that can be easily implemented in computer using any programming language. The following is an algorithm for compute the root of f(x) = 0; Input f, a, N and tol . Output: the approximate solution to f(x) = 0 with initial guess a or failure message. ² Step One: Set x = a ² Step Two: For i=0 to N do Step Three - Four f(x) Step Three: Compute x = x ¡ f 0(x) Step Four: If f(x) · tol return x ² Step Five return ”failure”. In analogy, a numerical algorithm is like a cook recipe that specify the input — cooking material, the output—the cooking product, and steps of carrying computation — cooking steps. In an algorithm, you will see loops (for, while), decision making statements(if, then, else(otherwise)) and return statements. ² for loop: Typically used when specific number of steps need to be carried out. You can break a for loop with return or break statement. 1 2 1. NUMERICAL METHODS FOR ORDINARY DIFFERENTIAL EQUATIONS ² while loop: Typically used when unknown number of steps need to be carried out.
    [Show full text]
  • Getting Started with Euler
    Getting started with Euler Samuel Fux High Performance Computing Group, Scientific IT Services, ETH Zurich ETH Zürich | Scientific IT Services | HPC Group Samuel Fux | 19.02.2020 | 1 Outlook . Introduction . Accessing the cluster . Data management . Environment/LMOD modules . Using the batch system . Applications . Getting help ETH Zürich | Scientific IT Services | HPC Group Samuel Fux | 19.02.2020 | 2 Outlook . Introduction . Accessing the cluster . Data management . Environment/LMOD modules . Using the batch system . Applications . Getting help ETH Zürich | Scientific IT Services | HPC Group Samuel Fux | 19.02.2020 | 3 Intro > What is EULER? . EULER stands for . Erweiterbarer, Umweltfreundlicher, Leistungsfähiger ETH Rechner . It is the 5th central (shared) cluster of ETH . 1999–2007 Asgard ➔ decommissioned . 2004–2008 Hreidar ➔ integrated into Brutus . 2005–2008 Gonzales ➔ integrated into Brutus . 2007–2016 Brutus . 2014–2020+ Euler . It benefits from the 15 years of experience gained with those previous large clusters ETH Zürich | Scientific IT Services | HPC Group Samuel Fux | 19.02.2020 | 4 Intro > Shareholder model . Like its predecessors, Euler has been financed (for the most part) by its users . So far, over 100 (!) research groups from almost all departments of ETH have invested in Euler . These so-called “shareholders” receive a share of the cluster’s resources (processors, memory, storage) proportional to their investment . The small share of Euler financed by IT Services is open to all members of ETH . The only requirement
    [Show full text]
  • Freemat V3.6 Documentation
    FreeMat v3.6 Documentation Samit Basu November 16, 2008 2 Contents 1 Introduction and Getting Started 5 1.1 INSTALL Installing FreeMat . 5 1.1.1 General Instructions . 5 1.1.2 Linux . 5 1.1.3 Windows . 6 1.1.4 Mac OS X . 6 1.1.5 Source Code . 6 2 Variables and Arrays 7 2.1 CELL Cell Array Definitions . 7 2.1.1 Usage . 7 2.1.2 Examples . 7 2.2 Function Handles . 8 2.2.1 Usage . 8 2.3 GLOBAL Global Variables . 8 2.3.1 Usage . 8 2.3.2 Example . 9 2.4 INDEXING Indexing Expressions . 9 2.4.1 Usage . 9 2.4.2 Array Indexing . 9 2.4.3 Cell Indexing . 13 2.4.4 Structure Indexing . 14 2.4.5 Complex Indexing . 16 2.5 MATRIX Matrix Definitions . 17 2.5.1 Usage . 17 2.5.2 Examples . 17 2.6 PERSISTENT Persistent Variables . 19 2.6.1 Usage . 19 2.6.2 Example . 19 2.7 STRING String Arrays . 20 2.7.1 Usage . 20 2.8 STRUCT Structure Array Constructor . 22 2.8.1 Usage . 22 2.8.2 Example . 22 3 4 CONTENTS 3 Functions and Scripts 25 3.1 ANONYMOUS Anonymous Functions . 25 3.1.1 Usage . 25 3.1.2 Examples . 25 3.2 FUNCTION Function Declarations . 26 3.2.1 Usage . 26 3.2.2 Examples . 28 3.3 KEYWORDS Function Keywords . 30 3.3.1 Usage . 30 3.3.2 Example . 31 3.4 NARGIN Number of Input Arguments . 32 3.4.1 Usage .
    [Show full text]
  • A Case Study in Fitting Area-Proportional Euler Diagrams with Ellipses Using Eulerr
    A Case Study in Fitting Area-Proportional Euler Diagrams with Ellipses using eulerr Johan Larsson and Peter Gustafsson Department of Statistics, School of Economics and Management, Lund University, Lund, Sweden [email protected] [email protected] Abstract. Euler diagrams are common and user-friendly visualizations for set relationships. Most Euler diagrams use circles, but circles do not always yield accurate diagrams. A promising alternative is ellipses, which, in theory, enable accurate diagrams for a wider range of input. Elliptical diagrams, however, have not yet been implemented for more than three sets or three-set diagrams where there are disjoint or subset relationships. The aim of this paper is to present eulerr: a software package for elliptical Euler diagrams for, in theory, any number of sets. It fits Euler diagrams using numerical optimization and exact-area algorithms through a two-step procedure, first generating an initial layout using pairwise relationships and then finalizing this layout using all set relationships. 1 Background The Euler diagram, first described by Leonard Euler in 1802 [1], is a generalization of the popular Venn diagram. Venn and Euler diagrams both visualize set relationships by mapping areas in the diagram to relationships in the data. They differ, however, in that Venn diagrams require all intersections to be present| even if they are empty|whilst Euler diagrams do not, which means that Euler diagrams lend themselves well to be area-proportional. Euler diagrams may be fashioned out of any closed shape, and have been implemented for triangles [2], rectangles [2], ellipses [3], smooth curves [4], poly- gons [2], and circles [5, 2].
    [Show full text]
  • The Python Interpreter
    The Python interpreter Remi Lehe Lawrence Berkeley National Laboratory (LBNL) US Particle Accelerator School (USPAS) Summer Session Self-Consistent Simulations of Beam and Plasma Systems S. M. Lund, J.-L. Vay, R. Lehe & D. Winklehner Colorado State U, Ft. Collins, CO, 13-17 June, 2016 Python interpreter: Outline 1 Overview of the Python language 2 Python, numpy and matplotlib 3 Reusing code: functions, modules, classes 4 Faster computation: Forthon Overview Scientific Python Reusing code Forthon Overview of the Python programming language Interpreted language (i.e. not compiled) ! Interactive, but not optimal for computational speed Readable and non-verbose No need to declare variables Indentation is enforced Free and open-source + Large community of open-souce packages Well adapted for scientific and data analysis applications Many excellent packages, esp. numerical computation (numpy), scientific applications (scipy), plotting (matplotlib), data analysis (pandas, scikit-learn) 3 Overview Scientific Python Reusing code Forthon Interfaces to the Python language Scripting Interactive shell Code written in a file, with a Obtained by typing python or text editor (gedit, vi, emacs) (better) ipython Execution via command line Commands are typed in and (python + filename) executed one by one Convenient for exploratory work, Convenient for long-term code debugging, rapid feedback, etc... 4 Overview Scientific Python Reusing code Forthon Interfaces to the Python language IPython (a.k.a Jupyter) notebook Notebook interface, similar to Mathematica. Intermediate between scripting and interactive shell, through reusable cells Obtained by typing jupyter notebook, opens in your web browser Convenient for exploratory work, scientific analysis and reports 5 Overview Scientific Python Reusing code Forthon Overview of the Python language This lecture Reminder of the main points of the Scipy lecture notes through an example problem.
    [Show full text]
  • Freemat V4.0 Documentation
    FreeMat v4.0 Documentation Samit Basu October 4, 2009 2 Contents 1 Introduction and Getting Started 39 1.1 INSTALL Installing FreeMat . 39 1.1.1 General Instructions . 39 1.1.2 Linux . 39 1.1.3 Windows . 40 1.1.4 Mac OS X . 40 1.1.5 Source Code . 40 2 Variables and Arrays 41 2.1 CELL Cell Array Definitions . 41 2.1.1 Usage . 41 2.1.2 Examples . 41 2.2 Function Handles . 42 2.2.1 Usage . 42 2.3 GLOBAL Global Variables . 42 2.3.1 Usage . 42 2.3.2 Example . 42 2.4 INDEXING Indexing Expressions . 43 2.4.1 Usage . 43 2.4.2 Array Indexing . 43 2.4.3 Cell Indexing . 46 2.4.4 Structure Indexing . 47 2.4.5 Complex Indexing . 49 2.5 MATRIX Matrix Definitions . 49 2.5.1 Usage . 49 2.5.2 Examples . 49 2.6 PERSISTENT Persistent Variables . 51 2.6.1 Usage . 51 2.6.2 Example . 51 2.7 STRUCT Structure Array Constructor . 51 2.7.1 Usage . 51 2.7.2 Example . 52 3 4 CONTENTS 3 Functions and Scripts 55 3.1 ANONYMOUS Anonymous Functions . 55 3.1.1 Usage . 55 3.1.2 Examples . 55 3.2 FUNCTION Function Declarations . 56 3.2.1 Usage . 56 3.2.2 Examples . 57 3.3 KEYWORDS Function Keywords . 60 3.3.1 Usage . 60 3.3.2 Example . 60 3.4 NARGIN Number of Input Arguments . 61 3.4.1 Usage . 61 3.4.2 Example . 61 3.5 NARGOUT Number of Output Arguments .
    [Show full text]
  • MATHCAD's PROGRAM FUNCTION and APPLICATION in TEACHING of MATH
    MATHCAD'S PROGRAM FUNCTION and APPLICATION IN TEACHING OF MATH DE TING WU Depart of Math Morehouse College Atlanta, GA.30314, USA [email protected] 1. Introduction 1.1 About Mathcad Mathcad is one of popular computer algebra system (math software) in the world. Like other CAS's, it has the capabilities to perform algebraic operations, calculus operations and draw graph of 2 or 3 dimensions. We can use it to get numerical, symbolic and graphic solution of math problem. Besides above common capabilities, it has some feature: its words processor function is better than other CAS. This feature makes it look like a scientifical words processor and it easy to create a woksheet. Following current trend to add program function to math software, it added program function to itself , started in Mathcad V7. This improvement makes its function more complete and more powerful. 1.2 Role of program function in teac hing of Math. Without doubt, math softwares and technology are helpful aide in teaching of Math. They are effecting the teaching of Math profoundly and it can be expected the emerging newer technologies will penetrate and reconfigure the teaching of Math. The program function is a new function of math software. It is natural we want to know whether or not it is useful in teaching of Math? I think: although for most problems we meet in teaching of Math it is enough to use computation ability, in certain cases the program function becomes necessary and very helpful. For example, for Numerical Analysis the program function is very useful but for Abstract Algebra it is less necessary.
    [Show full text]
  • Programming for Computations – Python
    15 Svein Linge · Hans Petter Langtangen Programming for Computations – Python Editorial Board T. J.Barth M.Griebel D.E.Keyes R.M.Nieminen D.Roose T.Schlick Texts in Computational 15 Science and Engineering Editors Timothy J. Barth Michael Griebel David E. Keyes Risto M. Nieminen Dirk Roose Tamar Schlick More information about this series at http://www.springer.com/series/5151 Svein Linge Hans Petter Langtangen Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python Svein Linge Hans Petter Langtangen Department of Process, Energy and Simula Research Laboratory Environmental Technology Lysaker, Norway University College of Southeast Norway Porsgrunn, Norway On leave from: Department of Informatics University of Oslo Oslo, Norway ISSN 1611-0994 Texts in Computational Science and Engineering ISBN 978-3-319-32427-2 ISBN 978-3-319-32428-9 (eBook) DOI 10.1007/978-3-319-32428-9 Springer Heidelberg Dordrecht London New York Library of Congress Control Number: 2016945368 Mathematic Subject Classification (2010): 26-01, 34A05, 34A30, 34A34, 39-01, 40-01, 65D15, 65D25, 65D30, 68-01, 68N01, 68N19, 68N30, 70-01, 92D25, 97-04, 97U50 © The Editor(s) (if applicable) and the Author(s) 2016 This book is published open access. Open Access This book is distributed under the terms of the Creative Commons Attribution-Non- Commercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, duplication, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, a link is provided to the Creative Commons license and any changes made are indicated.
    [Show full text]
  • CAS Maxima Workbook
    CAS Maxima Workbook Roland Salz January 7, 2021 Vers. 0.3.6 This work is published under the terms of the Creative Commons (CC) BY-NC-ND 4.0 license. You are free to: Share — copy and redistribute the material in any medium or format Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. As an exception to the above stated terms, the Maxima team is free to incorporate any material from this work into the official Maxima manual, and to remix, transform, or build upon this material within the official Maxima manual, to be published under its own license terms. No attribution is required in this case. Copyright © Roland Salz 2018-2021 No warranty whatsoever is given for the correctness or completeness of the information provided. Maple, Mathematica, Windows, and YouTube are registered trademarks. This project is work in progress. Comments and suggestions for improvement are welcome. Roland Salz Braunsberger Str. 26 D-44809 Bochum [email protected] i In some cases the objective is clear, and the results are surprising. Richard J. Fateman ii Preface Maxima was developed from 1968-1982 at MIT (Massachusetts Institute of Tech- nology) as the first comprehensive computer algebra system (CAS).
    [Show full text]
  • Application of the Maxima in the Teaching of Science Subjects at Different Levels of Knowledge
    Advances in Science and Technology Research Journal Volume 8, No. 24, Dec. 2014, pages 44–50 Original Article DOI: 10.12913/22998624/566 APPLICATION OF THE MAXIMA IN THE TEACHING OF SCIENCE SUBJECTS AT DIFFERENT LEVELS OF KNOWLEDGE Anna Makarewicz1 1 Department of Applied Mathematics, Lublin University of Technology, Nadbystrzycka 38, 20-618 Lublin, Poland, e-mail: [email protected] Received: 2014.10.18 ABSTRACT Accepted: 2014.11.12 In this paper I present a program Maxima, which is one of the best computer algebra Published: 2014.12.01 system (CAS). The program is easy to use and offers many possibilities. In the text the interface, basic commands, and various examples to facilitate complex calculations in almost every field of mathematics are preented. I prove that the program can be used in secondary schools, upper secondary schools and college. Program’s capabilities are presented, including, among others, differentiation and symbolic integration, symbol- ic solving equations (including differential), simplifying algebraic expressions, matrix operations, the possibility of drawing graphs of 2D / 3D and others. Keywords: computer program, numerical computation, symbolic computation, sym- bolic differentiation, symbolic integration, graph, graph three-dimensional, function. INTRODUCTION • symbolic solving equations (including differ- ential), Maxima is a computer program, performing • symbolic solving systems of equations, mathematical calculations, both symbolic and nu- • symbolic differentiation and integration, meric. The use of symbolic computation allows to • matrix operations, solve many mathematical problems in an accurate • drawing graphs of functions, manner. Maxima can work as a calculator, which • perform calculations in the field of probability can be used in secondary schools.
    [Show full text]
  • Maple 12 Tutorial
    Maple 12 Tutorial Updated: August 2012 Maple 12 Tutorial Table of Contents SECTION 1. INTRODUCTION...................................................................................... 3 ABOUT THE DOCUMENT .................................................................................................. 3 MAPLE INTRODUCTION .................................................................................................... 3 ACCESS TO MAPLE ........................................................................................................... 3 GETTING STARTED ........................................................................................................... 4 THE MAPLE APPLICATION INTERFACE ............................................................................. 5 THE HELP WINDOW ......................................................................................................... 7 BASIC CONVENTIONS IN MAPLE ...................................................................................... 8 BASIC DATA STRUCTURES IN MAPLE ............................................................................ 11 SECTION 3. NUMERICAL COMPUTATION........................................................... 12 FLOATING POINT NUMBER COMPUTATION .................................................................... 12 INTEGER COMPUTATIONS ............................................................................................... 13 COMPLEX NUMBER COMPUTATION ..............................................................................
    [Show full text]