SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Programming
linear algebra
things in python
-How to comprehend in it
-Why should this matter
Linear algebra is integral to most calculations
• This field is where one would study a
line, a plane, a subspace, a point, and
somehow figure out the correlation of
one image to another
• An intense change in intensity between
pixels would be considered an edge and
this observation is key in image recognition
software today
• No calculus required!
• But if you did learn Calculus(basic
differentiation), you could solve such
problems as the Schrodinger equation
What could I possibly use Python for?
• Easy to learn language, extendable, no semicolons!
• Visualize data with one of Python’s various modules(
Scipy, Numpy, Matplotlib etc)
• Numpy’s built-in ndarray allows for powerful, fast matrix
processing for multi-dimensional homogenous data types
• http://numpy.scipy.org/
• (Nd-array) N-dimensional array of square-like data
• UFUNC(Universal functions)- Allow for broadcasting,
processing matrices
• Among other things like typecasting
What is vector?
• Essential to linear algebra, the vector describes point
and direction of data, this is usually finitary in linear
algebra, usually described as 𝑖 𝑙𝑖𝑘𝑒 𝑥 , 𝑗(𝑙𝑖𝑘𝑒 𝑦)
•
𝑖
𝑗
are known as the basis vectors in 2d space, like the origin
• The Tail the vector’s point of origin, the head when it ends
• Magnitude of |a| is (𝑎1∗ 𝑎2)/2.
•
𝑖
𝑗
2
1
would be the vector sum, 2,1 is scalar
Head
Tail
What about matrix?
• A set of numerical data, expressions, or
symbols arranged in rows(m) and
columns(n)
• Can be described as an array of data
• Can be built off of vectors
The array information is stored in a
cache and these commands extract
commands from the header of the data
Numpy
>>> a = array([0,1,2,3])
>>> a
array([0, 1, 2, 3])
>>> type(a)
<type 'array'>
>>> a.dtype
dtype(‘int32’)
Describing a 1x4 array
Since python knows previously
described array, it prints it out
Ex: Assigning a float to into # an
int32 array will truncate decimal part.
>>> a[0] = 10.6
>>> a
[10, 1, 2, 3]
Coercion in code
Matplotlib- Fast, on-the-go data visualization
• import matplotlib.pyplot as plt
• X= ([1,2,3,4])
• plt.plot(x)
• plt.ylabel(' numbers')
• plt.show()
Why learn this?
Physics: If you don't watch a moving car from the outside but sit in the car, you are
changing your frame of reference. This corresponds to a change of basis in linear
algebra, which naturally pops out the centrifugal force (and the Coriolis force) from your
force expression.
Economics: Price (ex. function f) depends on supply and demand (the two components of
the two-dimensional vector x). If you do economics, linear algebra is a good idea.
Politics: If more roads are built, capacity goes up (good for business) but quality of life
goes down. People move away, which results in more traffic, which results in less excess
capacity, which is bad for business. Many variables and complex connections could lead
to multivariate calculus. This instead could be described in linear algebra and people in
politics or poly sci ought to know this to think about problems like these.
What is broadcast in python?
• Broadcasting describes how we treat
arrays with
different shapes during arithmetic
operations.
• The smaller array is “broadcast” across the
larger array so that they have compatible
shapes, subject to broadcasting
• Rules:
• NumPy compares their shapes element-
wise.
• It starts with the trailing dimensions, and
works its way forward.
• Two dimensions are compatible when
they are equal, or one of them is 1.
+
30 30 30
20 20 20
10 10 10
0 0 0 0 1 2
=
3
Why should I use python for my mathematical
hijinks?
• Python provides a platform for easy extensibility
• Large swath of extensible libraries and plenty of online support.
• This effectively and efficiently makes Python something like Matlab but better
• Allows for fast algorithms on machine data types on rectangular data ex. Array([0, 2, 4, 6, 8 ,10])
• Syntax is kept simple through not having to reference everything and therefore
follows the KISS principle
• Keeping the syntax simple (not like java) allows for faster compiling as you have less code to
compile, runtime lag tends to be less.
Data abstraction
• In OOP, you can have several classes which can implement a single interface
• A client of that interface doesn’t require the specifics used in the implementation of
interface
• In linear algebra, we have a field representing the data abstraction (it’s best to think of
fields like a class which implements pure functions such as +,-,*,%
• As long as the implantation of the fields in a class follows the rules of linear algebra, we
can utilize linear algebra in whatever application we choose to follow. This generality via
fields provides versatility in programming whatever.
• I.e the field of real numbers, cardinality, can aid in computing computer graphics
through its ties to geometry
• Binary and other base numbers can be used in cryptography
• Signal processing and other processes dynamic in nature such as load balancing a
network or polymorphic engines which change/time require complex numbers
• Python features many of these data structures making the barrier to entry into linear
algebra implementation lower
Comprehensions p1
Ex. (Math)
S = {x² : x in {0 ... 9}}
V = (1, 2, 4, 8, ..., 2¹²)
M = {x | x in S and x even}
1. Comprehension is an excellent example of this as it
allows the engineer to produce a list, set, array, or
dictionary through an expression
 Concise and readable, it utilizes functional
programming and is universally accessible. Allows
to write a procedure with very little code, usually
within one line, also resembles the notation
mathematicians use to describes sets
>>> S = [x**2 for x in range(10)]
>>> V = [2**i for i in range(13)]
>>> M = [x for x in S if x % 2 == 0]
>>> print S; print V; print M
Comprehensions p2
• Take for example {x∈R:x≥0} ”The set of consisting of all elements x of the set
of all real numbers such that x is less than or equal to 0(or the set of
negative numbers)”. Usually one removes the bold R as it is typically
assumed where the number is coming from (the field of all real numbers)
• The part before the colon produces a variable(s) and indicates the origin of
the elements and the part after provides the rule(s) which filter out which
elements then get allowed into the subsequent set. We would then write
this set comprehension in python as:
• (N = {-4, -2, -1, 0, 4, 6} ) ({x for x in N if x >=0})
• Whose answer in python would be {-4, -2}
Comprehensions p3
• For non-infinite numbers, |N| would describe the number of elements in a
set (Cardinality) whose Cardinality above would be 2
• One could make a lemma proving a hypothesis or array of hypotheses to be
true or not
• This could make sure that when coding a procedure, it follows a structure or
proof without future problems IN THAT FIELD
Other set notation things
• The cartesian product of A x B would be the set of all pairs (a,b) where “a” belongs to(∈) A
and “b” belongs to B and if A was {x, y} and B was {2, 3, 4}, A x B (the domain) would be
{(x,2), (y, 2), (x, 3), (y, 3), (x, 4), (y, 4)} (or the image of the function)
• In this one, the cardinality would be 6 because |A x B| is equal to |A| x |B|
• The Co-domain, however holistically, is the output of where the elements lie in a certain
domain and in this case, they lie between (x,y, and all real numbers) given input.
• So the image(Im) of A and B under the product function would be that list given above. Or A
and B map to the set above under the product function is not synonymous to (x, y, all real
numbers) the co-domain
• Now if you have a set x and a set y, the x^y lists all functions from y to x, so basically
everything from y gets jotted down as x gets introduced so basically you have to throw in
every possible function, not output, of set y into set x. For finite sets, |x^y| = |x|^|y|
Procedural abstraction
• This is to generalize and classify in a field i.e set of real numbers
• Programmers learn very quickly when writing code to call api’s (application
programming interfaces)
• What this means is they eventually learn what an array of different procedure calls
do and utilize them in concert with one another to build meaningful code
• Programmers thus aren’t required to understand how each procedure is then
implemented as the interaction of different modules from a global scope is
understood and what the end result yields.
• Such as coordinate visualization, basis, dimension, rank, and the relationships
between one another and how even that relationship could become its own field
Linear transformations
• If your vector or matrix changed up on you,
how do you describe it?
• A linear transformation is where the origin is
a fixed point and all lines remain lines, not
anything curved.
• Also, matrix multiplication is associative, no
matter the order the end result is the same
• [abcd][efgh]=[(ae+bg)(af+bh)(ce+gd)(cf+dh)]
• This does not mean when you apply a rotation
and shear transformation to a matrix that this is
matrix multiplication, it's addition and changing
up its transformation order results in a different
result.
Some of the hard problems linear algebra can
solve
• What is the energy state of my Hydrogen? My transistor??
• H^|ψ⟩=E|ψ⟩
• Note the braket notation are the quantum equivalent to parentheses and besides this, have
no other mathematical importance
• ψ is a vector, H is an operator, and E is a scalar
• Scalar multiplication is commutative and once wave vectors are normalized(by
getting rid of unnecessary inifinities), one can get the eigenstate energy by left
multiplying by ψ
• ⟨ψ|H^|ψ⟩=⟨ψ|E|ψ⟩=E
• Which means, without differential calculus, I know precisely what energy state
something like my transistor is in, so that pesky electrons stay where they are.
• No quantum tunneling!
What this builds on?
• Full abstraction, abstract algebra, vector spaces, semantics, quantum physics,
A.I, etc
END!

Weitere ähnliche Inhalte

Was ist angesagt?

Algorithm & data structures lec1
Algorithm & data structures lec1Algorithm & data structures lec1
Algorithm & data structures lec1Abdul Khan
 
Introduction to data_structure
Introduction to data_structureIntroduction to data_structure
Introduction to data_structureAshim Lamichhane
 
Interpolation and its applications
Interpolation and its applicationsInterpolation and its applications
Interpolation and its applicationsRinkuMonani
 
Polymath For Chemical Engineers
Polymath For Chemical EngineersPolymath For Chemical Engineers
Polymath For Chemical EngineersHashim Khan
 
Search algorithms master
Search algorithms masterSearch algorithms master
Search algorithms masterHossam Hassan
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
DATA STRUCTURE AND ALGORITHM FULL NOTES
DATA STRUCTURE AND ALGORITHM FULL NOTESDATA STRUCTURE AND ALGORITHM FULL NOTES
DATA STRUCTURE AND ALGORITHM FULL NOTESAniruddha Paul
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to AlgorithmsVenkatesh Iyer
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsKrishnan MuthuManickam
 
Interpolation and-its-application
Interpolation and-its-applicationInterpolation and-its-application
Interpolation and-its-applicationApurbo Datta
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsSwapnil Agrawal
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewWaqas Nawaz
 

Was ist angesagt? (20)

Algorithm & data structures lec1
Algorithm & data structures lec1Algorithm & data structures lec1
Algorithm & data structures lec1
 
Introduction to data_structure
Introduction to data_structureIntroduction to data_structure
Introduction to data_structure
 
Interpolation and its applications
Interpolation and its applicationsInterpolation and its applications
Interpolation and its applications
 
Polymath For Chemical Engineers
Polymath For Chemical EngineersPolymath For Chemical Engineers
Polymath For Chemical Engineers
 
Search algorithms master
Search algorithms masterSearch algorithms master
Search algorithms master
 
Parallel searching
Parallel searchingParallel searching
Parallel searching
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Big o notation
Big o notationBig o notation
Big o notation
 
DATA STRUCTURE AND ALGORITHM FULL NOTES
DATA STRUCTURE AND ALGORITHM FULL NOTESDATA STRUCTURE AND ALGORITHM FULL NOTES
DATA STRUCTURE AND ALGORITHM FULL NOTES
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of Algorithms
 
Interpolation and-its-application
Interpolation and-its-applicationInterpolation and-its-application
Interpolation and-its-application
 
Chapter 4 ds
Chapter 4 dsChapter 4 ds
Chapter 4 ds
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Data Structures- Hashing
Data Structures- Hashing Data Structures- Hashing
Data Structures- Hashing
 
MATLAB
MATLABMATLAB
MATLAB
 
Slide1
Slide1Slide1
Slide1
 
Unit 5
Unit 5Unit 5
Unit 5
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract View
 
Computer algebra-system-maple
Computer algebra-system-mapleComputer algebra-system-maple
Computer algebra-system-maple
 

Ähnlich wie Programming in python

Engineering Numerical Analysis-Introduction.pdf
Engineering Numerical Analysis-Introduction.pdfEngineering Numerical Analysis-Introduction.pdf
Engineering Numerical Analysis-Introduction.pdfssuseraae901
 
Lecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfLecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfssuserff72e4
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to MatlabAmr Rashed
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABRavikiran A
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using javaNarayan Sau
 
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahon
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahonGraph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahon
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahonChristopher Conlan
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Satalia
 
DSJ_Unit I & II.pdf
DSJ_Unit I & II.pdfDSJ_Unit I & II.pdf
DSJ_Unit I & II.pdfArumugam90
 
theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 018threspecter
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxskilljiolms
 

Ähnlich wie Programming in python (20)

Engineering Numerical Analysis-Introduction.pdf
Engineering Numerical Analysis-Introduction.pdfEngineering Numerical Analysis-Introduction.pdf
Engineering Numerical Analysis-Introduction.pdf
 
Lecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdfLecture1_computer vision-2023.pdf
Lecture1_computer vision-2023.pdf
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
Mbd dd
Mbd ddMbd dd
Mbd dd
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
Matlab lec1
Matlab lec1Matlab lec1
Matlab lec1
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
MatlabIntro (1).ppt
MatlabIntro (1).pptMatlabIntro (1).ppt
MatlabIntro (1).ppt
 
Data structure and algorithm using java
Data structure and algorithm using javaData structure and algorithm using java
Data structure and algorithm using java
 
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahon
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahonGraph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahon
Graph Algorithms, Sparse Algebra, and the GraphBLAS with Janice McMahon
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
 
DSJ_Unit I & II.pdf
DSJ_Unit I & II.pdfDSJ_Unit I & II.pdf
DSJ_Unit I & II.pdf
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 
R programmingmilano
R programmingmilanoR programmingmilano
R programmingmilano
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 01
 
Matlab pt1
Matlab pt1Matlab pt1
Matlab pt1
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 

Kürzlich hochgeladen

Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsMonica Sydney
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 

Kürzlich hochgeladen (20)

Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 

Programming in python

  • 1. Programming linear algebra things in python -How to comprehend in it -Why should this matter
  • 2. Linear algebra is integral to most calculations • This field is where one would study a line, a plane, a subspace, a point, and somehow figure out the correlation of one image to another • An intense change in intensity between pixels would be considered an edge and this observation is key in image recognition software today • No calculus required! • But if you did learn Calculus(basic differentiation), you could solve such problems as the Schrodinger equation
  • 3. What could I possibly use Python for? • Easy to learn language, extendable, no semicolons! • Visualize data with one of Python’s various modules( Scipy, Numpy, Matplotlib etc) • Numpy’s built-in ndarray allows for powerful, fast matrix processing for multi-dimensional homogenous data types • http://numpy.scipy.org/ • (Nd-array) N-dimensional array of square-like data • UFUNC(Universal functions)- Allow for broadcasting, processing matrices • Among other things like typecasting
  • 4. What is vector? • Essential to linear algebra, the vector describes point and direction of data, this is usually finitary in linear algebra, usually described as 𝑖 𝑙𝑖𝑘𝑒 𝑥 , 𝑗(𝑙𝑖𝑘𝑒 𝑦) • 𝑖 𝑗 are known as the basis vectors in 2d space, like the origin • The Tail the vector’s point of origin, the head when it ends • Magnitude of |a| is (𝑎1∗ 𝑎2)/2. • 𝑖 𝑗 2 1 would be the vector sum, 2,1 is scalar Head Tail What about matrix? • A set of numerical data, expressions, or symbols arranged in rows(m) and columns(n) • Can be described as an array of data • Can be built off of vectors
  • 5. The array information is stored in a cache and these commands extract commands from the header of the data Numpy >>> a = array([0,1,2,3]) >>> a array([0, 1, 2, 3]) >>> type(a) <type 'array'> >>> a.dtype dtype(‘int32’) Describing a 1x4 array Since python knows previously described array, it prints it out Ex: Assigning a float to into # an int32 array will truncate decimal part. >>> a[0] = 10.6 >>> a [10, 1, 2, 3] Coercion in code
  • 6. Matplotlib- Fast, on-the-go data visualization • import matplotlib.pyplot as plt • X= ([1,2,3,4]) • plt.plot(x) • plt.ylabel(' numbers') • plt.show()
  • 7. Why learn this? Physics: If you don't watch a moving car from the outside but sit in the car, you are changing your frame of reference. This corresponds to a change of basis in linear algebra, which naturally pops out the centrifugal force (and the Coriolis force) from your force expression. Economics: Price (ex. function f) depends on supply and demand (the two components of the two-dimensional vector x). If you do economics, linear algebra is a good idea. Politics: If more roads are built, capacity goes up (good for business) but quality of life goes down. People move away, which results in more traffic, which results in less excess capacity, which is bad for business. Many variables and complex connections could lead to multivariate calculus. This instead could be described in linear algebra and people in politics or poly sci ought to know this to think about problems like these.
  • 8. What is broadcast in python? • Broadcasting describes how we treat arrays with different shapes during arithmetic operations. • The smaller array is “broadcast” across the larger array so that they have compatible shapes, subject to broadcasting • Rules: • NumPy compares their shapes element- wise. • It starts with the trailing dimensions, and works its way forward. • Two dimensions are compatible when they are equal, or one of them is 1. + 30 30 30 20 20 20 10 10 10 0 0 0 0 1 2 = 3
  • 9. Why should I use python for my mathematical hijinks? • Python provides a platform for easy extensibility • Large swath of extensible libraries and plenty of online support. • This effectively and efficiently makes Python something like Matlab but better • Allows for fast algorithms on machine data types on rectangular data ex. Array([0, 2, 4, 6, 8 ,10]) • Syntax is kept simple through not having to reference everything and therefore follows the KISS principle • Keeping the syntax simple (not like java) allows for faster compiling as you have less code to compile, runtime lag tends to be less.
  • 10. Data abstraction • In OOP, you can have several classes which can implement a single interface • A client of that interface doesn’t require the specifics used in the implementation of interface • In linear algebra, we have a field representing the data abstraction (it’s best to think of fields like a class which implements pure functions such as +,-,*,% • As long as the implantation of the fields in a class follows the rules of linear algebra, we can utilize linear algebra in whatever application we choose to follow. This generality via fields provides versatility in programming whatever. • I.e the field of real numbers, cardinality, can aid in computing computer graphics through its ties to geometry • Binary and other base numbers can be used in cryptography • Signal processing and other processes dynamic in nature such as load balancing a network or polymorphic engines which change/time require complex numbers • Python features many of these data structures making the barrier to entry into linear algebra implementation lower
  • 11. Comprehensions p1 Ex. (Math) S = {x² : x in {0 ... 9}} V = (1, 2, 4, 8, ..., 2¹²) M = {x | x in S and x even} 1. Comprehension is an excellent example of this as it allows the engineer to produce a list, set, array, or dictionary through an expression  Concise and readable, it utilizes functional programming and is universally accessible. Allows to write a procedure with very little code, usually within one line, also resembles the notation mathematicians use to describes sets >>> S = [x**2 for x in range(10)] >>> V = [2**i for i in range(13)] >>> M = [x for x in S if x % 2 == 0] >>> print S; print V; print M
  • 12. Comprehensions p2 • Take for example {x∈R:x≥0} ”The set of consisting of all elements x of the set of all real numbers such that x is less than or equal to 0(or the set of negative numbers)”. Usually one removes the bold R as it is typically assumed where the number is coming from (the field of all real numbers) • The part before the colon produces a variable(s) and indicates the origin of the elements and the part after provides the rule(s) which filter out which elements then get allowed into the subsequent set. We would then write this set comprehension in python as: • (N = {-4, -2, -1, 0, 4, 6} ) ({x for x in N if x >=0}) • Whose answer in python would be {-4, -2}
  • 13. Comprehensions p3 • For non-infinite numbers, |N| would describe the number of elements in a set (Cardinality) whose Cardinality above would be 2 • One could make a lemma proving a hypothesis or array of hypotheses to be true or not • This could make sure that when coding a procedure, it follows a structure or proof without future problems IN THAT FIELD
  • 14. Other set notation things • The cartesian product of A x B would be the set of all pairs (a,b) where “a” belongs to(∈) A and “b” belongs to B and if A was {x, y} and B was {2, 3, 4}, A x B (the domain) would be {(x,2), (y, 2), (x, 3), (y, 3), (x, 4), (y, 4)} (or the image of the function) • In this one, the cardinality would be 6 because |A x B| is equal to |A| x |B| • The Co-domain, however holistically, is the output of where the elements lie in a certain domain and in this case, they lie between (x,y, and all real numbers) given input. • So the image(Im) of A and B under the product function would be that list given above. Or A and B map to the set above under the product function is not synonymous to (x, y, all real numbers) the co-domain • Now if you have a set x and a set y, the x^y lists all functions from y to x, so basically everything from y gets jotted down as x gets introduced so basically you have to throw in every possible function, not output, of set y into set x. For finite sets, |x^y| = |x|^|y|
  • 15. Procedural abstraction • This is to generalize and classify in a field i.e set of real numbers • Programmers learn very quickly when writing code to call api’s (application programming interfaces) • What this means is they eventually learn what an array of different procedure calls do and utilize them in concert with one another to build meaningful code • Programmers thus aren’t required to understand how each procedure is then implemented as the interaction of different modules from a global scope is understood and what the end result yields. • Such as coordinate visualization, basis, dimension, rank, and the relationships between one another and how even that relationship could become its own field
  • 16. Linear transformations • If your vector or matrix changed up on you, how do you describe it? • A linear transformation is where the origin is a fixed point and all lines remain lines, not anything curved. • Also, matrix multiplication is associative, no matter the order the end result is the same • [abcd][efgh]=[(ae+bg)(af+bh)(ce+gd)(cf+dh)] • This does not mean when you apply a rotation and shear transformation to a matrix that this is matrix multiplication, it's addition and changing up its transformation order results in a different result.
  • 17. Some of the hard problems linear algebra can solve • What is the energy state of my Hydrogen? My transistor?? • H^|ψ⟩=E|ψ⟩ • Note the braket notation are the quantum equivalent to parentheses and besides this, have no other mathematical importance • ψ is a vector, H is an operator, and E is a scalar • Scalar multiplication is commutative and once wave vectors are normalized(by getting rid of unnecessary inifinities), one can get the eigenstate energy by left multiplying by ψ • ⟨ψ|H^|ψ⟩=⟨ψ|E|ψ⟩=E • Which means, without differential calculus, I know precisely what energy state something like my transistor is in, so that pesky electrons stay where they are. • No quantum tunneling!
  • 18. What this builds on? • Full abstraction, abstract algebra, vector spaces, semantics, quantum physics, A.I, etc END!