ความรู้พื้นฐานคณิตศาสตร์ที่จำเป็นในการทำ AI

วันพุธ, 19 ตุลาคม 2565, linear algebra, Matrix, Eigenvector, Eigenvalue, PCA, SVD, calculus, Taylor seires

ทำไมถึงมาเขียนบทความคณิตศาสตร์

เนื่องจากเจอปัญในการเรียน Math refresher ตอนปี 2 อย่างมาก
เพราะลืมสิ่งที่เคยเรียนตอนปี 1 แล้ว แม้จะพึ่งผ่านไปไม่นานก็ตาม
อีกทั้งการกลับไปอ่านสรุปในสมุดที่ตัวเองเคยจดที่เคยเข้าใจก็ไม่เข้าใจแล้ว
และสมุดส่วนหนึ่งก็ยุ่ยไปแล้ว(บ่งบอกถึงการดูแลของสมุด 55)
เลยตั้งใจจดให้เรียบร้อยขึ้นและบันทึกลงที่นี่เผื่อเป็นประโยชน์กับคนอื่นด้วยครับ

อีกเหตุผลหนึ่งที่ทำก็เพราะว่า

คะแนนสอบวิชาคณิตศาสตร์

ดูจากคะแนนสอบครับ 7/25 บอกได้เลยว่าแตกกกก 555
เลยกลับมาทบทวนตัวเองว่าถ้าจะทำงานทางสายนี้จริง ๆ
ไม่ว่าจะอาชีพไหนก็ตามพื้นฐานคือสิ่งสำคัญ และพื้นฐานของ data science คือ math
ดังนั้นผมก็ต้องทำความเข้าใจในสิ่งที่ผมยังไม่เข้าใจ

บทความนี้จึงเป็นการเรียนซ้ำอีกรอบและสรุปคณิตศาสตร์แบบย่อตามที่ตัวผมเองเข้าใจ
ดังนั้นแปลว่าอาจจะเข้าใจผิดได้ ถ้าใครเห็นอะไรแปลก ๆ ก็ทักได้เลยครับ

และข้อมูลส่วนใหญ่ตัดแปะมาจากในสไลด์ข้อมูลที่ได้เรียนมา
แต่ไม่ได้เอา source มาโดยตรงนะครับเพราะไม่รู้ว่าจะติดลิขสิทธ์ไหม

อีกทั้งการทำสรุปใช้เวลานานมาก เพราะต้องกลับไปเหมือนเรียนใหม่ให้เข้าใจจริง ๆ
ดังนั้นจะค่อย ๆ เพิ่มเติมเนื้อหานะครับ
และหากใครเห็นว่าตรงไหนผมเข้าใจผิดสามารถที่จะบอกได้เลยนะครับ

Linear Algebra

การทำงานของคอมพิวเตอร์ทั้งหมดจะคือการคำนวนกันของตัวเลข
คือการคำนวนกันของชุดข้อมูลที่ถูกเก็บเอาไว้ในรูปของ Matrix และได้ผลลัพธ์เอาไปคำนวนต่อกันไปเรื่อย ๆ
ดังนั้นทุกอย่างที่เราทำในคอมพิวเตอร์ การกดคลิก การเลื่อน scroll แล้วแสดงผลบางอย่าง
ทั้งหมดนี้อยู่ภายใต้การทำงานของ linear algebra ทั้งสิ้น
ยิ่งงานของ data science งานที่ต้องสร้างโมเดลจากข้อมูลโดยตรง
linear algebra จึงเป็นพื้นฐานที่ต้องเข้าใจว่าโมเดลที่เราสร้างมันเกิดขึ้นมาได้อย่างไร

● scalar

1 lines Line 1: alpha is a. member of r-n minus a. s c a. l a. r comma E x a. m p l e colon negative 3

● Vector

1 lines Line 1: x is a. member of r-n minus a. v e c t o r w i t h n e n t r i e s
x is a. member of r-n E x a. m p l e colon x equals the 4 by 1 column matrix Row 1: x sub 1 Row 2: x sub 2 Row 3: x sub 2 Row 4: x sub 4 is a. member of r-four

vector = ผลรวมของแรง + ทางทาง ตามระบบ (Cartesian coordinate)

● Vector Space: Definition

A real-valued vector space (V, +, ⋅ ) is a set of vectors V with two operations

2 lines Line 1: 1 plus colon V times V right arrow V Line 2: 2 times colon the real numbers times V right arrow V

● Inner Product

ถ้าเจอเครื่องหมาย < *, * > หมายถึงทำ inner product กัน

3 lines Line 1: I n n e r p r o d u c t i s a. f of u n c t i o n t h of a. t m a. p p i n g is less than times comma times is greater than colon V times V right arrow the real numbers t h of a. t s a. t i s f of i e s t h of e f of o l l o w i n g p r o p e r t i e s colon Line 2: 1 S y m m e t r i c colon for all x comma y is a. member of V is less than x comma y is greater than equals is less than y comma x is greater than Line 3: 2 P o s i t i v e d e f of i n i t e colon for all x is a. member of V the set 0 is less than x comma x is greater than is greater than 0 a. n d is less than x comma 0 is greater than equals 0

● Dot Product

A particular type of inner product
ถ้าเจอเครื่องหมาย ( *, * ) หมายถึงทำ dot product กัน
วิธีคิด :

the 2 by 2 matrix Row 1: A B Row 2: C D times the 2 by 1 column matrix E F equals open bracket open paren A times E close paren plus open paren B times F close paren plus open paren C times E close paren plus open paren D times F close paren close bracket equals the real numbers

●Euclidian Vector Space

A vector space with inner product is calledan inner product space.

open paren r-n comma plus comma times close paren w i t h d o t p r o d u c t open paren times comma times close paren i s c a. l l e d a. E u c l i d i a. n v e c t o r s p a. c e period

"A finite dimensional real inner product space is called a Euclidean space."
From Introduction to Hilbert Spaces with Applications,
Second Edition by L. Debnath and P. Mikusinski, 1999. Page 92.

Norm

ตามที่เข้าใจ norm ก็คือวิธีการวัดระยะอย่างนึง

4 lines Line 1: A n o r m o n a. v e c t o r s p a. c e V i s a. f of u n c t i o n the absolute value of the absolute value of times colon V long right arrow double struck R w h of i c h a. s s i g of n s e a. c h v e c t o r x is a. member of V i t s l e n g of t h the absolute value of the absolute value of x is a. member of double struck R period Line 2: A n o r m m u s t s a. t i s f of y t h of e f of o l l o w i n g p r o p e r t i e s colon Line 3: 1 A b s o l u t e l y hom o g of e n e o u s colon for all x is a. member of V comma for all lamda is a. member of the real numbers the absolute value of the absolute value of lamda x equals the absolute value of lamda times the absolute value of the absolute value of x Line 4: 2 P o s i t i v e d e f of i n i t i v e colon for all x is a. member of V the absolute value of the absolute value of x is greater than 0 a. n d the absolute value of the absolute value of x equals 0 long left right double arrow x equals 0

ชนิดของ Norm

เนื่องจาก norm เป็นวิธีการวัดอย่างหนึ่ง ดังนั้นแปลว่าเราสามารถวัดค่าหนึ่งได้โดยหลายเครื่องมือ เช่น

●Manhattan Norm หรือ L1

n o r m f of o r x is a. member of r-n colon the absolute value of the absolute value of x sub 1 equals the sum from i equals 1 to n of the absolute value of x

คิดง่าย ๆ จับทุกอย่างใส่ในค่าสัมบูรณ์แล้วเอามารวมกัน

● Euclidian Norm หรือ L2

2 lines Line 1: n o r m f of o r x is a. member of r-n colon the absolute value of the absolute value of x sub 2 equals the square root of the sum from i equals 1 to n of x sub i squared Line 2: E x a. m p l e colon the absolute value of the absolute value of open bracket negative 2 comma 0 close bracket sub 2 equals the square root of open paren negative 2 close paren squared plus 0 squared equals 2

L2 จะถือว่าเป็น default norm

● p-Norm

2 lines Line 1: x is a. member of r-n comma p is greater than 1 Line 2: the absolute value of times x the absolute value of sub p equals the p-th root of the sum from i equals 1 to n of the absolute value of x sub i to the power of p
p-norm

ที่มา https://www.quora.com/What-is-the-mathematical-relationship-between-the-L1-norm-and-L2-norm

● Max-Norm

2 lines Line 1: l sub infinity colon the absolute value of the absolute value of x sub infinity equals max over i of the absolute value of x sub i Line 2: E x a. m p l e colon the absolute value of the absolute value of open bracket negative 2 comma 0 comma 0.5 comma 1 close bracket sub infinity equals 2

เลือกค่าที่ใส่ absolute แล้วมีค่าสูงสุด

● inner product and norms

Any inner product induces a norm but

case 1 : <x, y> = <y, x>
case 2 : < nx, y> = n<x, y>
case 3 : <x + y, z> = <x, z> + <y, z>
case 4 : if All x > 0 the <x, x> > 0 else <x> == 0

(!) Not every norm is induced by an inner product.
Example : Manhattan norm.

● Cauchy-Schwarz Inequality

For an inner product vector space, the induced norm satisfies theinequality:

the absolute value of is less than x comma y is greater than is less than or equal to the absolute value of the absolute value of x times the absolute value of the absolute value of y

For dot product and Euclidian norm:

the absolute value of open paren x comma y close paren is less than or equal to the absolute value of the absolute value of x sub 2 times the absolute value of the absolute value of y sub 2

The Cauchy-Schwarz inequality says the lengths of the dot product of vectors is less than or equal to the product of the lengths of the vectors.
Another form of this inequality says the length of the sum of two vectors is less than or equal to the sum of the lengths of the vectors.

● Distance between Vectors

Distance between two vectors x and y is defined as

d of open paren x comma y close paren colon equals the absolute value of the absolute value of x minus y equals the square root of is less than x minus y comma x minus y is greater than

For dot product and Euclidian norm, we get Euclidian distance

d of open paren x comma y close paren colon equals the absolute value of the absolute value of x minus y sub 2 equals the square root of open paren x minus y comma x minus y is greater than close paren equals the square root of open paren x sub 1 minus y sub 1 close paren raised to the 2 power plus open paren x sub 2 minus y sub 2 close paren squared plus period period period positive open paren x sub n minus y sub n close paren squared

● Angle between Two Vectors

from Cauchy-Schwarz Inequality

3 lines Line 1: the absolute value of open paren x comma y close paren is less than or equal to the absolute value of the absolute value of x times the absolute value of the absolute value of y Line 2: negative 1 is less than or equal to the fraction with numerator the absolute value of open paren x comma y close paren and denominator the absolute value of the absolute value of x times the absolute value of the absolute value of y is less than or equal to 1 Line 3: omega colon cosine omega equals the fraction with numerator open paren x comma y close paren and denominator the absolute value of the absolute value of x minus the absolute value of the absolute value of y minus a. n g of l e b e t w e e n x a. n d y

example : angle between x = [10, 0] y =[2, 2]

2 lines Line 1: omega equals the arc cosine of the fraction with numerator open paren x comma y close paren and denominator the absolute value of the absolute value of x times the absolute value of the absolute value of y equals the arc cosine of the fraction with numerator open paren 10 times 2 close paren plus open paren 0 times 2 close paren and denominator the square root of 10 squared plus 0 squared times the square root of 2 squared plus 2 squared equals the arc cosine of the fraction with numerator 20 and denominator 10 times 2 the square root of 2 equals the arc cosine of the fraction with numerator 1 and denominator the square root of 2 Line 2: omega equals the arc cosine of open paren the fraction with numerator the square root of 2 and denominator 2 close paren equals pi over 4
unit circle sin cos tan

ที่มา https://andymath.com/unit-circle/

● Orthogonality

x and y are orthogonal if and only if <x, y> = 0.
such as x = [1, 0] and y =[0, 1]

● Orthogonality Projection

● Distance between Vectors

Suppose we have two vectors u and v
What is the length of u'v?

Orthogonal Projection

case 1:

2 lines Line 1: i f 0 is less than or equal to omega is less than or equal to 90 Line 2: open paren u comma v close paren equals the absolute value of the absolute value of u times the absolute value of the absolute value of v times cosine omega equals the absolute value of the absolute value of u times the absolute value of the absolute value of v times the fraction with numerator the absolute value of the absolute value of u sub v prime and denominator the absolute value of the absolute value of u equals the absolute value of the absolute value of u sub v prime times the absolute value of the absolute value of v

case 2:

2 lines Line 1: i f 90 is less than or equal to omega is less than or equal to 180 Line 2: negative open paren u comma v close paren equals the absolute value of the absolute value of u times the absolute value of the absolute value of v times cosine omega equals the absolute value of the absolute value of u times the absolute value of the absolute value of v times the fraction with numerator the absolute value of the absolute value of u sub v prime and denominator the absolute value of the absolute value of u equals the absolute value of the absolute value of u sub v prime times the absolute value of the absolute value of v

However

2 lines Line 1: the absolute value of open paren u comma v close paren equals the absolute value of the absolute value of u prime times the absolute value of the absolute value of v long left right double arrow the absolute value of the absolute value of u sub v prime equals the fraction with numerator the absolute value of open paren u comma v close paren and denominator the absolute value of the absolute value of v Line 2: u sub v prime equals the fraction with numerator open paren u comma v close paren and denominator open paren v comma v close paren times v

example : u = [ 1, 1, 1] v= [2, 2, 2]

1 lines Line 1: u sub v prime equals the fraction with numerator open paren u comma v close paren and denominator open paren v comma v close paren times v equals the fraction with numerator 2 plus 2 plus 2 and denominator 4 plus 4 plus 4 equals one third v equals open bracket two thirds comma two thirds comma two thirds close bracket

● Hyperplanes

จาก wikipedia
In geometry, a hyperplane is a subspace whose dimension is one less than that of its ambient space. For example, if a space is 3-dimensional then its hyperplanes are the 2-dimensional planes, while if the space is 2-dimensional, its hyperplanes are the 1-dimensional lines.

hyperplame 2D & 3d

ที่มา https://deepai.org/machine-learning-glossary-and-terms/hyperplane

compact notation:
(w, x) + b = 0, w = (w1, w2, ..., wn) where at least one w ≠ 0

w is a normal vector to this hyperplane
it’s orthogonal to every vector on it.

hyperplane

ตรงนี้เป็นตัวอย่างของการใช้ hyperplane ในการทำ binary classification

● Vector Subspace

V = (V, +, ⋅ ) is a vector space

2 lines Line 1: U is not equal to empty set a. n d U subset of or equal to V Line 2: S i n c e U subset of or equal to V a. n d V equals open paren V comma plus comma times close paren t h of e n p r o p e r t i e s o f open paren plus close paren a. n d open paren times close paren h of o l d a. u t o m a. t i c a. l l y period

Important thing need to check

4 lines Line 1: 1 period 0 is a. member of U Line 2: 2 period c l o s u r e o f o p e r a. t i o n open paren plus close paren a. n d open paren times close paren colon Line 3: negative for all x comma y is a. member of U colon x plus y is a. member of U Line 4: negative for all x comma y is a. member of U comma lamda is a. member of the real numbers colon lamda x is a. member of U
not vector subspace

ทั้งสองรูปไม่ใช่ vector subspace ตามคุณสมบัติที่ 2 และ 1 ตามลำดับ

2 lines Line 1: minus the n-th power of P equals open paren the n-th power of P comma plus comma times close paren Line 2: minus for all m is less than or equal to n colon the m-th power of P equals the m-th power of P of open paren the m-th power of P comma plus comma times close paren subset of or equal to the power of n of P

Ploynomail always be Vector subspace :
     if degree m <= n and multiply m with a scalar, degree m still <= degree n

● Linear Combinations

vectors can be added together and multipled by scalars.

5 lines Line 1: E x a. m p l e colon Line 2: minus I n open paren r-two comma plus comma times close paren comma c o n s i d e r v sub 1 equals the 2 by 1 column matrix 1 0 comma v sub 2 equals the 2 by 1 column matrix 0 1 Line 3: u equals 2 v sub 1 minus v sub 2 comma u i s a. l i n e a. r c o m b i n a. t i o n o f v sub 1 a. n d v sub 2 Line 4: minus I n open paren P squared comma plus comma times close paren comma c o n s i d e r v sub 0 equals 1 comma v sub 1 equals t comma v sub 2 equals t squared Line 5: u equals 2 t squared minus t plus 1 equals 2 v sub 2 minus v sub 1 plus v sub 0 comma i s a. l i n e a. r c o m b i n a. t i o n o f v sub 0 comma v sub 1 a. n d v sub 2

● Span

V - a vector space
A set of all linear combinations of vectors in V is called a span

3 lines Line 1: V is a. member of r-three comma v equals the set x sub 1 comma x sub 2 comma x sub 3 comma v subset of or equal to V Line 2: t h of e n x sub 1 equals the 3 by 1 column matrix 1 0 0 comma x sub 2 equals the 3 by 1 column matrix 0 1 0 comma x sub 3 equals the 3 by 1 column matrix 0 0 1 Line 3: span o f v equals a. x sub 1 plus b x sub 2 plus c x sub 3 equals the 3 by 1 column matrix Row 1: a. times 1 plus b times 0 plus c times 0 Row 2: a. times 0 plus b times 1 plus c times 0 Row 3: a. times 0 plus b times 0 plus c times 1 equals the 3 by 1 column matrix a. b c

จากตัวอย่าง span ของ v คืออะไรก็ได้ใน R^3
เพราะเราสามารถจะสร้างอะไรขึ้นมาก็ได้จากการทำ linear combination ของ vector v ที่เรามี
สรุปง่าย ๆ span คือ ผลลัพธ์ที่ได้หลังจากเรา vector ที่มีไปทำ linear combination

3 lines Line 1: V is a. member of r-three comma v equals the set x sub 1 comma x sub 2 comma x sub 3 comma v subset of or equal to V Line 2: t h of e n x sub 1 equals the 3 by 1 column matrix 1 0 0 comma x sub 2 equals the 3 by 1 column matrix 0 1 0 comma x sub 3 equals the 3 by 1 column matrix 0 0 1 Line 3: span o f v equals a. x sub 1 plus b x sub 2 plus c x sub 3 equals the 3 by 1 column matrix Row 1: a. times 1 plus b times 0 plus c times 0 Row 2: a. times 0 plus b times 1 plus c times 0 Row 3: a. times 0 plus b times 0 plus c times 1 equals the 3 by 1 column matrix a. b c

คนปรกติจะเขียนในกันรูปนี้ : V = span[v] หรือ V = span[x1, x2, ..., xn] หรือ

span of open bracket x sub 1 comma period period period comma x sub n close bracket equals open brace lamda sub 1 x sub 1 plus period period period positive lamda sub n x sub n divides lamda sub 1 comma period period period comma lamda sub n is a. member of the real numbers close brace

● Generating Set

Let G be a group, and S a subset of G.
We say that S generates G (and that S is a set of generators for G)
if every element of G can be expressed as a product of elements of S and their inverses.

● Linear Dependence และ Linear Independence

มีปัญหากับ 2 คำนี้มาก คือ
มีผลเฉลยไม่ชัด (Non-trivial solution) คือ "a[x] = 0 โดยที่ a อย่างน้อย 1 ตัวไม่ใช่ 0"
     เช่น u = [1, 2], v=[3, 6]
     เราสามารถเขียนได้ในรูป 3v = u
     และตรงนี้เป็น linearly dependent
มีผลเฉลยชัด (trivial solution) คือ ต้องเอา a[x] = 0 โดย ทุกตัวของ a = 0
     เช่น u = [1, 0], v = [0, 1]
     เราต้องแทนค่า a=0 เท่านั้น, au + av = 0
     ตรงนี้เป็น linear independent

● Dimension of a Linear Space

The linear space V is called n-dimensional
if the maximal number of linearly independent vectors in it is equal to n.
We denote this as dim (V) = n.

3 lines Line 1: n equals v e c t o r s e sub 1 comma e sub 2 comma e sub 3 comma period period period comma e sub n colon Line 2: i f e sub 1 comma period period period comma e sub n a. r e l i n e a. r l y i n d e p e n d e n t h of e n n is less than or equal to the dimension of open paren r-n close paren

● Basis

- Basis is a set of vectors which can represent every vector in space by linear combination
- A set of n linearly independent vectors e1, e2, ... , en in an n-dimensional space V is called a basis for V.
เช่น x = [1,0,1], y =[1, 1, 1], z =[2, 1, 2]
จะเห็นได้ว่า z = x+y และ x, y linearly independence กัน
ดังนั้น V = span[x, y,z] = span[x,y]
B = {x, y} is a basis of V

● Orthogonal Basis and Orthonormal Basis

orthogonal basis - [e1, e2, ..., en] หรือ basis ของทุกตัวใน v ตั้งฉากกัน
เช่น In R^2 : B = {a1, a2} is a basis of V
     a1 = [4, 0], a2 = [0, 3]
orthonormal basis - นอกจาก e ทุกตัวจะตั้งฉากกันแล้ว for all ||ei|| = 1
เช่น In R^3 : : B = {e1, e2} is a basis of V
     e1 = [1, 0, 0], e2 =[0, 1, 0], e3 = [0, 0, 1]

● Canonical Basis

3 lines Line 1: E x a. m p l e i n R squared colon Line 2: negative c a. n o n i c a. l b a. s i s colon e equals the set e sub 1 equals the 2 by 1 column matrix 1 0 comma e sub 2 equals the 2 by 1 column matrix 0 1 Line 3: negative a. n o t h of e r b a. s i s colon a. equals the set a. sub 1 equals the 2 by 1 column matrix 1 negative 1 comma a. sub 2 equals the 2 by 1 column matrix 1 1

จากที่เข้าใจคือ Canonical หมายถึง การตอบให้อยู่ในรูปแบบเดียวที่เป็นพื้นฐาน เช่น
ทำสมการแล้วได้คำตอบ 3/6 อันนี้คือไม่ canonical
แต่ถ้าได้คำตอบเป็น 1/2 อันนี้เป็น canonical
จึงคิดเองว่า canonical น่าจะหมายถึงรูปที่ไม่สามารจะลดได้อีกแล้ว

● Coordinates

a Coordinate vector is a representation of a vector as an ordered list of numbers that describes the vector in terms of a particular ordered basis. Coordinates are always specified relative to an ordered basis. (from Wikipedia)
v = a1e1 + a2e2+ ... + anen
coordinates of v = [a1, a2, ... , n]

● Coordinates change

coordinate change

ตามที่เข้าใจคือ สมมติว่าเรามีแกน x และ y แล้วมี vector อันนึงคือ v = [1, 1]
แล้วถ้าเราจับแกนของเราหมุนตามเข็มนาฬิกาไป 90 องศา
ถ้าอยากจะเขียน vector เดิมให้มีทิศทางเดิม เราจะเขียนอย่างไรในแกนใหม่ ที่เป็น x' และ y' ?

เทียบง่าย ๆ คือการใช้คนละแกนเหมือนกับใช้คนละภาษาในการอธิบายสิ่งเดียวกัน
สมมติว่าแกน x' = [0, -1] , y' = [1, 0] แล้ว v เดิม = [1, 1]
วิธีคิดคือ v[x'] + v[y'] = 1[0, -1] + 1[1, 0] = [1, - 1]

3 lines Line 1: x equals x sub 1 of e sub 1 plus x sub 2 of e sub 2 plus period period period positive x sub n of e sub n equals x sub 1 prime of e sub 1 prime plus x sub 2 prime of e sub 2 prime plus period period period positive x sub n prime of e sub n prime Line 2: R e m e m b e r colon e sub i prime equals alpha sub 1 i e sub 1 plus alpha sub 2 i e sub 2 plus period period period positive alpha sub n i e sub n Line 3: e sub i prime equals x sub 1 prime times open paren alpha sub 11 e sub 1 plus alpha sub 21 e sub 2 plus period period period positive alpha sub n 1 e sub n close paren plus period period period positive x sub i prime times open paren alpha sub 1 i e sub 1 plus alpha sub 2 i e sub 2 plus period period period alpha sub n i e sub n close paren plus period period period positive x sub n prime of open paren alpha sub 1 n e sub 1 plus alpha sub 2 n e sub 2 plus period period period positive alpha sub n n e sub n close paren

หากเขียนเป็นแถวสวย ๆ จะออกมาแบบนี้ คือ

3 lines Line 1: x sub 1 equals x sub 1 prime alpha sub 11 plus period period period positive x sub i prime alpha sub 1 i plus period period period positive x sub n prime alpha sub 1 n Line 2: x sub 2 equals x sub 1 prime alpha sub 21 plus period period period positive x sub i prime alpha sub 2 i plus period period period positive x sub n prime alpha sub 2 n Line 3: x sub n equals x sub 1 prime a. sub n 1 plus period period period positive x sub i prime alpha sub n i plus period period period positive x sub n prime a. sub n n
equation coordinate change

A Matrix

2 lines Line 1: A is a. member of r-m times n minus a. m a. t r i x w i t h m r o w s a. n d n c o l u m n s Line 2: A equals the 3 by 3 matrix Row 1: Column 1, a. sub 11 Column 2, period period Column 3, a. sub 1 n Row 2: Column 1, period period Column 2, period period Column 3, period period Row 3: Column 1, a. sub m 1 Column 2, period period Column 3, a. sub m n

● Special Matrices

4 lines Line 1: D i a. g of o n a. l m a. t r i x colon the 3 by 3 matrix Row 1: a. 0 0 Row 2: 0 b 0 Row 3: 0 0 c open paren a. sub i i is not equal to 0 comma a. sub i j equals 0 for all i is not equal to j close paren Line 2: I d e n t i t y M a. t r i x colon the 3 by 3 matrix Row 1: 1 0 0 Row 2: 0 1 0 Row 3: 0 0 1 open paren a. sub i i equals 1 comma a. sub i j equals 0 for all i is not equal to j close paren Line 3: S y m m e t r i c M a. t r i x colon the 3 by 3 matrix Row 1: a. 0 0 Row 2: 0 b 0 Row 3: 0 0 c open paren a. sub i j equals a. sub j i close paren Line 4: T r i a. n g of u l a. r M a. t r i x colon the 3 by 3 matrix Row 1: a. b c Row 2: 0 d e Row 3: 0 0 f comma the 3 by 3 matrix Row 1: a. 0 0 Row 2: b c 0 Row 3: d e f open paren a. sub j i equals 0 for all i is greater than j o r for all i is less than j close paren

An n-dimensional vector can be considered nx1 matrix
** An identity matrix may be denoted 1, I, E (the latter being an abbreviation for the German term "Einheitsmatrix"; Courant and Hilbert 1989, p. 7)

● Operations with Matrices

Transpose of a Matrix = เปลี่ยนแถวเป็นหลัก เปลี่ยนหลักเป็นแถว

2 lines Line 1: A equals the 2 by 2 matrix Row 1: a. b Row 2: c d Line 2: A to the T power equals the 2 by 2 matrix Row 1: a. c Row 2: b d

multiplying by scalar

1 lines Line 1: lamda A equals lamda times the 2 by 2 matrix Row 1: a. b Row 2: c d equals the 2 by 2 matrix Row 1: lamda a. lamda b Row 2: lamda c lamda d

sum of two matrices

1 lines Line 1: A positive B equals the 2 by 2 matrix Row 1: a. b Row 2: c d plus times the 2 by 2 matrix Row 1: e f Row 2: g h equals the 2 by 2 matrix Row 1: Column 1, a. plus e Column 2, b plus f Row 2: Column 1, c plus g Column 2, d plus h

multiplying by marix

1 lines Line 1: A times B equals the 2 by 2 matrix Row 1: a. b Row 2: c d times times the 2 by 2 matrix Row 1: e f Row 2: g h equals the 2 by 2 matrix Row 1: Column 1, a. e plus b g Column 2, a. f plus b h Row 2: Column 1, c e plus d g Column 2, c f plus d h

เอาแต่ละแถวของ A ไปคูณแต่ละหลักของ B
โดยมีเงื่อนไขว่า columns ของ A จะต้องเท่ากับ rows ของ B
ผลลัพธ์ของการคูณกันจะได้ matrix ขนาด rowsA x columnsB
เช่น matrix  2, 6 * martrix 6, 1 = martrix 2, 1

● Matrices Also Form a Vector Space!

ดังนั้น Vector Space มีคุณสมบัติอะไร Matrix ก็จะมีตามนั้น

Linear Transformation

การ transformation มีหลายแบบ
แต่การ transform ให้เป็น linear จะต้องมีคุณสมมัติ 2 ข้อคือ

6 lines Line 1: 1 period A of open paren x plus y close paren equals A of x plus A of y Line 2: 2 period A of lamda x equals lamda A of x Line 3: blank Line 4: A minus t r a. n s f of o r m e r Line 5: x sub i n p u t comma x sub o u t p u t equals V e c t o r Line 6: x sub i n p u t long right arrow A long right arrow x sub o u t p u t

ตรงนี้จะคล้าย กับ change coordinate สามารถย้อนกลับไปอ่านได้
- Every linear transformation can be defined by its matrix.
   Columns = how this transformation changes the vectors in the selected basis.
- Vice versa: every square matrix defines some linear transformation.

● Identity Transformation

AxI = A
ดังนั้นการ transform ด้วย identity matrix จะไม่เปลี่ยนแปลงอะไรซักอย่าง

3 lines Line 1: x equals x sub 1 of e sub 1 plus x sub 2 of e sub 2 plus period period period positive x sub n of e sub n equals x sub 1 prime of e sub 1 prime plus x sub 2 prime of e sub 2 prime plus period period period positive x sub n prime of e sub n prime Line 2: R e m e m b e r colon e sub i prime equals alpha sub 1 i e sub 1 plus alpha sub 2 i e sub 2 plus period period period positive alpha sub n i e sub n Line 3: e sub i prime equals x sub 1 prime times open paren alpha sub 11 e sub 1 plus alpha sub 21 e sub 2 plus period period period positive alpha sub n 1 e sub n close paren plus period period period positive x sub i prime times open paren alpha sub 1 i e sub 1 plus alpha sub 2 i e sub 2 plus period period period alpha sub n i e sub n close paren plus period period period positive x sub n prime of open paren alpha sub 1 n e sub 1 plus alpha sub 2 n e sub 2 plus period period period positive alpha sub n n e sub n close paren

● Stretching / Squeezing

K x equals the 2 by 2 matrix Row 1: k sub 1 0 Row 2: 0 K sub 2 times the 2 by 1 column matrix x sub 1 x sub 2

● Projection on an Axis

2 lines Line 1: proj of e c t i o n r-three o n r-two p l a. n e Line 2: t r a. n s f of o r m e r m a. t r i x colon P x equals the 3 by 3 matrix Row 1: 1 0 0 Row 2: 0 1 0 Row 3: 0 0 0 the 3 by 1 column matrix x sub 1 x sub 2 x sub 3 equals the 3 by 1 column matrix x sub 1 x sub 2 0

จะเห็นได้ว่าการ project ไปมิติที่ต่ำกว่า จะทำให้ข้อมูลหายไปด้วยบางส่วน

● Rotation

r o t a. t e b y m a. t r i x R sub theta colon R sub theta x equals the 2 by 2 matrix Row 1: Column 1, cosine theta Column 2, negative sine theta Row 2: Column 1, sine theta Column 2, cosine theta times the 2 by 1 column matrix x sub 1 x sub 2

● Combining Transforms

Let A and B be two linear transforms. What if we first apply A and then B?

5 lines Line 1: t r a. n s f of o r m e r A r o t a. t e 90 degrees equals the 2 by 2 matrix Row 1: 0 negative 1 Row 2: 1 0 Line 2: t r a. n s f of o r m e r B s t r e t c h of i n g 2 t i m e equals the 2 by 2 matrix Row 1: 2 0 Row 2: 0 2 Line 3: A of B x equals B A times x equals C x Line 4: C equals B A Line 5: C equals the 2 by 2 matrix Row 1: 0 negative 1 Row 2: 1 0 times the 2 by 2 matrix Row 1: 2 0 Row 2: 0 2 equals the 2 by 2 matrix Row 1: 0 negative 2 Row 2: 2 0

● Inverse transform

3 lines Line 1: m a. t r i x A equals A Line 2: I n v e r s e t r a. n s f of o r m A inverse colon m a. p s e v e r y t h of i n g b a. c k t o w h of e r e i t w a. s right double quotation mark colon Line 3: A inverse of A of x equals x long left right double arrow A inverse of A equals I open paren i d e n t i t y M a. t r i x close paren

จากด้านบนถ้า C(x) = D
แล้ว ?(D) = x, แล้ว ? คือ inverse transform
-Not every transform has an inverse!
    - Rotation: yes (rotate it back)
     - Projection: no เพราะ มิติมันหายไปแล้วบางส่วน
-A matrix that doesn’t have an inverse is called singular. or Determinant(A) = 0

● Determinant

จาก wikipedia.com
In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It allows characterizing some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if and only if the matrix is invertible and the linear map represented by the matrix is an isomorphism. (a one-to-one correspondence (mapping) between two sets that preserves binary relationships between elements of the sets.)

A numerical way to characterize a linear transformation (and itsmatrix):
- absolute value = how much area changes;
- sign = change of orientation.

● Computing Determinant

3 lines Line 1: A equals the set a. sub i j minus n times n m a. t r i x Line 2: M sub i j equals i t s min of o r long left right double arrow M sub i j i s a. n open paren n minus 1 close paren times open paren n minus 1 close paren m a. t r i x r e s u l t i n g f of r o m r e m o v i n g i minus t h r o w a. n d j minus t h c o l u m n f of r o m A Line 3: determinant A equals the sum from i equals 1 to n of open paren negative 1 close paren raised to the i plus j power times a. sub i j the determinant of M sub i j equals the sum from j equals 1 to n of open paren negative 1 close paren raised to the i plus j power times a. sub i j the determinant of M sub i j

● Properties of the Determinant

3 lines Line 1: determinant A equals the determinant of A to the T power Line 2: determinant A B equals determinant A times determinant B Line 3: the determinant of A to the negative 1 power equals 1 over determinant A

● Inverse of a Matrix

สามารถหา Inverser โดยการใช้วิธีการ Gaussian Elimination เทียบกับ Matrix Identity

open paren the 3 by 3 matrix Row 1: a. b c Row 2: d e f Row 3: g h i divides the 3 by 3 matrix Row 1: 1 0 0 Row 2: 0 1 0 Row 3: 0 0 1 close paren

ถ้าสามารถทำให้ด้านซ้ายกลายเป็น identity ได้
ด้านขวาจะกลายเป็น inverse matrix

● Rank of Matrix

The rank of a matrix is the maximum number of its linearly independent rows (or columns).

A equals the 3 by 3 matrix Row 1: 1 0 0 Row 2: 0 1 0 Row 3: 0 0 0

rank ของ matrix A คือ 2

r a. n k of X is less than or equal to min of open brace n comma m close brace

● Null space

A set of vectors that are mapped to 0 by a linear transformation A
A*v=0

A equals the 3 by 3 matrix Row 1: a. b c Row 2: d e f Row 3: g h i comma v equals the 3 by 1 column matrix j k l
the 3 by 3 matrix Row 1: a. b c Row 2: d e f Row 3: g h i times the 3 by 1 column matrix j k l equals the 3 by 1 column matrix 0 0 0

Vector v is a null space

● Systems of Linear Equations(SLE)

Ax = b
คำตอบที่ได้จะมีลักษณะดังต่อไปนี้
1. x+y=1, x+y=2 : No solutions, detA=0
2. x+y=1, 2x+y=2 : A single solution x=1, y=0, detA != 0
3. x+y=1, 2x+2y=2 : Infinitely many solutions, b=[1, 2]^T
detA = 0 because A maps onto the same vector

● Number of Solutions of Systems Linear Equations(SLE)

Ax = b

c o n s i d e r divides m a. t r i x open paren A divides b close paren equals the 3 by 3 matrix Row 1: Column 1, a. sub 11 Column 2, period period a. sub 1 n Column 3, b sub 1 Row 2: Column 1, period period period Column 2, period period period Column 3, period period Row 3: Column 1, a. sub m 1 Column 2, period period a. sub m n Column 3, b sub n

Ax=b has a unique solutions iff rank(A|b) = rank(A) = n
Ax=b has infinitely many solutions iff rank(A|b) = rank(A) < n
Ax=b has no solutions iff rank(A|b) > rank(A)

● Homogeneous SLE

Ax = 0
let V be a set of solutions:

8 lines Line 1: for all v is a. member of V divides A of v equals 0 Line 2: blank Line 3: n o t e t h of a. t Line 4: minus 0 is a. member of V b e c a. u s e A times 0 equals 0 Line 5: minus for all v is a. member of long right arrow lamda v is a. member of V Line 6: i n d e e d comma A of lamda v equals lamda A of v equals 0 Line 7: minus for all v sub 1 comma v sub 2 is a. member of V long right arrow open paren v sub 1 plus v sub 2 close paren is a. member of V Line 8: i n d e e d comma A of open paren v sub 1 plus v sub 2 close paren equals A of v sub 1 plus A of v sub 2 equals 0

● Matrix Decomposition

Factorization : 21 = 3*7

● LU Matrix Decomposition

A = L*U

LU codeLU result

LU code and result

ไว้เข้าใจมากขึ้นจะกลับมาเขียนเรื่องนี้นะครับ เอาแค่ code ไปก่อน 555

Eigenvectors and Eigenvalues

The prefix eigen- is adopted from the German word eigen for "proper", "inherent"; "own", "individual", "special"; "specific", "peculiar", or "characteristic".

A v equals lamda v

eigenvector : v = characteristic direction
eigenvalues : lambda = information recovery

● Finding Eigenvalues

5 lines Line 1: A v equals lamda v Line 2: A v minus lamda v equals 0 Line 3: open paren A minus lamda E close paren equals 0 Line 4: S i n c e v is not equal to 0 comma t h of e o n l y p o s s i b l e i f a. n d o n l y i f Line 5: the determinant of open paren A minus lamda E close paren equals 0

eigenvector : v = characteristic direction
eigenvalues : lambda = information recovery

จะเห็นได้ว่า ถ้าหาก det(A-lambdaE) = 0
นั่นแปลว่า matrix(A-lambdaE) ได้ทำการ map ตัวเองไปในมิติที่ต่ำกว่าเดิม
หรือมันคือการลดมิติข้อมูลนั่นเอง

การแยกองค์ประกอบที่สำคัญออกมาทำให้เราได้ basis ที่ดี
ดังนั้นเราจะสามารถเก็บข้อมูลเดิมโดยใช้พื้นที่น้อยลงได้ เพราะเอา basis ที่ดีมาอ้างอิง
และการคำนวนข้อมูลที่น้อยลงแต่มีคุณสมบัติใกล้เคียงกับเดิม
จะช่วยประหยัดทรัพยากรในการคำนวนลงได้อีก

eigenvector จะหมายถึงทิศทางที่เราจะเก็บข้อมูลจากข้อมูลเดิม
เราจะมองจากมุมไหนให้เราเห็นสิ่งนั้นชัดเจนที่สุด และคงคุณสมบัติได้มากที่สุด
อย่างไรก็ตามบางอย่างไม่มี eigenvector เพราะไม่ว่าทางไหนก็เบลอไปหมด ไม่ลักษณะอะไรเด่น

eigenvalues หมายถึงความชัดของเงาที่ได้

4 lines Line 1: lamda is greater than 0 colon v a. n d A v p o i n t t o t h of e s a. m e d i r e c t i o n Line 2: lamda is less than 0 colon v a. n d A v p o i n t t o o p p e r s i t e d i r e c t i o n Line 3: the absolute value of lamda is greater than 1 comma A v l arg e r t h of a. n v Line 4: the absolute value of lamda is less than 1 comma A v s m a. l l e r t h of a. n v

โดยยิ่งค่า lambda มาก แปลว่าภาพที่ได้จะยิ่งชัด

● Degenerate Eigenvalue

the concept of degenerate is "A limiting case in which a class of object changes its nature so as to belong to another, usually simpler, class."

เช่น วงกลมที่ถูกลดพื้นที่จนสุดท้ายกลายเป็นจุด, สี่เหลี่ยมที่ถูกเขียนเป็นสามเหลี่ยมแทน สามเหลี่ยมที่ถูกเขียนให้กลายเป็นเส้นตรง

2 lines Line 1: n o r m a. l c a. s e colon A equals the 2 by 2 matrix Row 1: 1 0 Row 2: 0 1 comma lamda equals 1 comma e i g of e n v e c t o r equals the set the 2 by 1 column matrix 1 0 comma the 2 by 1 column matrix 0 1 Line 2: the degree of e n e r a. t e c a. s e colon A equals the 2 by 2 matrix Row 1: 0 1 Row 2: 0 0 comma lamda equals 0 comma e i g of e n v e c t o r equals the set the 2 by 1 column matrix 1 0

จะเห็นได้ว่าจาก eigenvector ที่ควรจะเป็น 2 มิติถูกลดให้กลายเป็น 1 มิติแทน

● Useful Properties

6 lines Line 1: A equals n times n m a. t r of i x comma lamda sub 1 comma period period period comma lamda sub n equals e i g of e n v a. l u e s Line 2: determinant A equals lamda sub 1 times period period period times lamda sub k Line 3: t r of A equals a. sub 11 plus a. sub 22 plus a. sub 33 plus period period period positive a. sub n n equals lamda sub 1 plus period period period positive lamda sub k Line 4: blank Line 5: 1 period i f determinant A equals 0 comma A i s i n v e r of t i b l e Line 6: 2 period A to the negative 1 power h of a. s e i g of e n v a. l u e s equals 1 over lamda comma period period period comma the fraction with numerator 1 and denominator lamda sub k colon e i g of e n v e c t e r o f A a. n d A to the negative 1 power a. r of e t h of e s ame

● Eigen-Decomposition

ถ้าเป็น Degenerate Matrix ก็จะทำ Eigen-Decomposition ไม่ได้

A equals n times n m a. t r i x comma lamda sub 1 comma lamda sub 2 comma period period period comma lamda sub n equals e i g of e n v a. l u e s comma V equals open bracket v sub 1 times the absolute value of v sub 2 period period period divides v sub n close bracket negative c h of a. n g of e minus o f minus b a. s i s m a. t r i x
6 lines Line 1: A s s u m e A h of a. s n o n the degree of e n e r a. t e e i g of e n v a. l u e s Line 2: V equals open bracket v sub 1 comma v sub 2 comma period period period comma v sub n close bracket Line 3: open bracket A close bracket sub V equals Lamda minus a. d i a. g of o n a. l m a. t r i x w i t h d sub i i equals lamda equals the 3 by 3 matrix Row 1: Column 1, lamda sub 1 Column 2, 0 Column 3, 0 Row 2: Column 1, 0 Column 2, period period period Column 3, 0 Row 3: Column 1, 0 Column 2, 0 Column 3, lamda sub n Line 4: A V equals V Lamda Line 5: A equals V Lamda V to the negative 1 power colon m u l t i p l e b o t h s i d e b y m a. t r i x V to the negative 1 power Line 6: A equals V Lamda V to the negative 1 power colon e i g of e n d e c o m p o s i t i o n o f A period

● Diagonalizable Matrix

Matrix diagonalization is the process of taking a square matrix and converting it into a special type of matrix--a so-called diagonal matrix--that shares the same fundamental properties of the underlying matrix.

1 lines Line 1: A equals V Lamda V to the negative 1 power long left right double arrow Lamda equals V to the negative 1 power A V

ด้านซ้าย คือการทำ Eigendecomposition ส่วนด้านขวาคือ การทำ Diagonalization ถ้าทำด้านซ้ายได้ก็จะทำด้านขวาได้
โดยผลลัพธ์ที่จะได้เป็น diagonal matrix

A equals the 2 by 2 matrix Row 1: 3 1 Row 2: 1 3 comma e i g of e n v e t o r A equals the set the 2 by 1 column matrix 1 1 comma the 2 by 1 column matrix negative 1 1 comma e i g of e n v a. l u e A equals 4 comma 2
2 lines Line 1: Lamda equals V to the negative 1 power A V Line 2: raised to the Lamda equals the 2 by 2 matrix Row 1: negative one half one half Row 2: one half one half times the 2 by 2 matrix Row 1: 3 1 Row 2: 1 3 times the 2 by 2 matrix Row 1: negative 1 1 Row 2: 1 1 equals the 2 by 2 matrix Row 1: 2 0 Row 2: 0 4 power

การทำ Diagonalizable Matrix จะทำให้เราได้ diagonal matrix ที่มีค่าเป็น eigenvalues ของ matrix A

● The SpectralTheorem

If A is a real symmetric matrix then
1) A has only real (possibly repeating) eigenvalues
2) A has n linearly independent eigenvectors
3) v1, v2, ..., vn are orthogonal or orthonormal

1 lines Line 1: A equals V Lamda V to the negative 1 power long left right double arrow Lamda equals V to the negative 1 power A V

● Power of a Matrix

หลายคนคงอาจจะงงมาว่าที่เขียนมายืดยาวเอาไปใช้อะไรได้
โดยปรกติถ้าเราจะเอา Matrix A ไปคูณกัน 8 ครั้ง
สิ่งที่เราต้องทำก็คือ A*A*A*A*A*A*A*A= [A*A]*[A*A]*[A*A]*[A*A] =[A*A*A*A]*[A*A*A*A]=[A*A*A*A*A*A*A*A]

ในทางกลับกันถ้าเราหาเจ้าตัวด้านล่างได้ เราจะสามารถคิดอีกแบบได้นั่นคือ

4 lines Line 1: Lamda equals V to the negative 1 power A V Line 2: A to the power of n equals A times A times A times period period period times A sub n Line 3: equals open paren V Lamda V to the negative 1 power close paren to the power of n equals V Lamda V to the negative 1 power V Lamda V to the negative 1 power times period period period times V Lamda V to the negative 1 power colon V to the negative 1 power times V equals E Line 4: equals V times Lamda raised to the exponent to the power of n end exponent times V to the negative 1 power

โดยการทำนวนจะง่ายกว่ามากเพราะว่า ตัวตรงกลางเป็น Diagonal Matrix
ลองคิดง่าย ๆ ว่าถ้าหากเรามีค่า parameter 1 ล้านตัว คูณกัน 1,000 ครั้ง การคูณกันตรง ๆ กับ
การคูณโดยใช้ eigen values basis แบบไหนจะน่าชื่นใจมากกว่ากัน

● Orthogonal Matrixs

Orthogonal vectors are linearly independent → A is a fullrank matrix. So, A has an inverse

A i s o r t h of o g of o n a. l long left right double arrow A to the T power A equals A A to the T power equals E long left right double arrow A to the negative 1 power equals A to the T power

Principle Component Analysis(PCA)

PCA is an unsupervised learning method that is often reduce the dimensionality of
the dataset by tranform a large dataset into a lower dimensional dataset that
still contain most of the information of the large dataset.

PCA is a powerful statistical tool for analyzingdata based on eigen decomposition.

Suppose we have a dataset with n observations and m features:

X equals open bracket x to the first power times the absolute value of period period period times x to the power of n close bracket comma x to the power of j equals the 4 by 1 column matrix Row 1: x sub 1 j Row 2: x sub 2 j Row 3: period period period Row 4: x sub m j i s o b s e r v a. t i o n f of o r e x a. m p l e j
x to the power of j equals the 4 by 1 column matrix Row 1: x sub 1 j Row 2: x sub 2 j Row 3: period period period Row 4: x sub m j long left arrow o b s e r v a. t i o n s f of o r e x a. m p l e j comma X equals open bracket x to the first power times the absolute value of period period period times x to the power of n close bracket long left arrow m times n d a. t a. m a. t r i x

Assuming that X is centered, otherwise we should center it firse
because  centering matrix will be play an important role.
We will use it to remove the column means from a matrix that each column has mean zero.
how to center matrix

4 lines Line 1: X sub C equals E sub n minus 1 over n X Line 2: X sub C 1 equals 0 comma X sub 0 equals 1 Line 3: X sub C 2 equals the 2 by 2 matrix Row 1: 1 0 Row 2: 0 1 minus one half times the 2 by 2 matrix Row 1: 1 1 Row 2: 1 1 equals the 2 by 2 matrix Row 1: one half negative one half Row 2: negative one half one half Line 4: X sub C 3 equals the 3 by 3 matrix Row 1: 1 0 0 Row 2: 0 1 0 Row 3: 0 0 1 minus one third times the 3 by 3 matrix Row 1: 1 1 1 Row 2: 1 1 1 Row 3: 1 1 1 equals the 3 by 3 matrix Row 1: two thirds negative one third negative one third Row 2: negative one third two thirds negative one third Row 3: negative one third negative one third two thirds

Key idea: project your m×n data onto a p-dimensional subspace (p < m) in such away that we preserve as much variance in our data as possible.

Suppose that this subspace has an orthonormal basis B

2 lines Line 1: B equals open bracket b to the first power times the absolute value of period period period times b to the power of p close bracket t h of e n Line 2: X sub p r o j equals B X

How to find B? we should project on the p eigenvectors of the data covariance matrixthat correspond to p largest eigenvalues!

Important to know before do PCA
variance : refers to a statistical measurement of the spread between numbers in a data set.
covariance : Covariance between two random variables = measure of the joint variability.

V a. r of X equals 1 over n Sigma times open paren X sub i minus X horizontal bar close paren squared
2 lines Line 1: C o v of open paren X comma Y divided into equals 1 over n the sum from to of open paren X sub i minus X horizontal divided into times open paren Y sub i minus Y horizontal divided into to the T power Line 2: C o v of open paren X comma X close paren equals 1 over n the sum from to of open paren X sub i minus X horizontal divided into times open paren X sub i minus X horizontal close paren to the T power

another thing that we should remember that is eigen decomposition concept

S equals V Lamda V to the negative 1 power equals V Lamda V to the T power
the 3 by 3 matrix Row 1: Column 1, S sub 11 Column 2, period period period Column 3, S sub 1 m Row 2: Column 1, period period period Column 2, period period period Column 3, period period period Row 3: Column 1, S sub n 1 Column 2, period period period Column 3, S sub m m equals the 3 by 3 matrix Row 1: Column 1, v sub 11 Column 2, period period period Column 3, v sub 1 m Row 2: Column 1, period period period Column 2, period period period Column 3, period period period Row 3: Column 1, v sub n 1 Column 2, period period period Column 3, v sub m m times the 3 by 3 matrix Row 1: Column 1, lamda sub 1 Column 2, 0 Column 3, 0 Row 2: Column 1, 0 Column 2, period period period Column 3, 0 Row 3: Column 1, 0 Column 2, 0 Column 3, lamda sub m times the 3 by 3 matrix Row 1: Column 1, v sub 11 Column 2, period period period Column 3, v sub 1 m Row 2: Column 1, period period period Column 2, period period period Column 3, period period period Row 3: Column 1, v sub n 1 Column 2, period period period Column 3, v sub m m to the T power
T equals t r of S equals s sub 11 plus s sub 22 plus period period period positive s sub m m equals lamda sub 1 plus period period period positive lamda sub m

S = Covariance Matrix

another thing that we should remember that is eigen decomposition concept

4 lines Line 1: E i g of e n v a. l u e s o f of A A to the T power a. n d A to the T power A Line 2: M a. t r i c e s A to the T power A a. n d A A to the T power s h of a. r e t h of e s a. m e s e t o f n o n minus z e r o e i g of e n v a. l u e s factorial Line 3: open paren A to the T power A close paren times v equals lamda v comma lamda is not equal to 0 Line 4: A A to the T power A v equals lamda A v

Why this is useful? because if you have to matirx A is a 1000×2 matrix.
and you have to calculate A*A^T that is 1000*1000 matrix
you should just compute (A^T)*A instead!

● Step of PCA

-Subtract mean from X
-Calculate Cov(X, X)
-Calculate eigenvectors and eigenvalues of the covariance matrix
-Sort the eigen vector according to their eigenvalues in decreasing order
-Choose first k eigenvectors and that will be the new k dimensions
-Transform the original n-dimensional data points to k dimensions (Project with dot product)

● Singular Value Decomposition(SVD)

-Only symmetric matrices are guaranteed to have n linearlyindependent eigenvectors (The Spectral Theorem).
-Non-symmetric matrices may or may not have eigenbasis.
-And what about non-square matrices?

Singular Value Decomposition is a generalization of eigen decomposition for all matrices.

7 lines Line 1: F of o r a. n y m a. t r i x A t h of e r e e x i s t s a. f of a. c t o r i z a. t i o n colon Line 2: A sub N times M equals U sub N times N times Sigma sub N times M times V sub M times M to the T power Line 3: w h of e r e U a. n d V to the T power a. r e o r t h of o n o r m a. l a. n d Sigma i s d i a. g of o n a. l colon Line 4: Sigma sub N times M equals the 4 by 4 matrix Row 1: Column 1, sigma sub 1 Column 2, 0 Column 3, 0 Column 4, 0 Row 2: Column 1, 0 Column 2, sigma sub 2 Column 3, 0 Column 4, 0 Row 3: Column 1, 0 Column 2, 0 Column 3, period period period Column 4, 0 Row 4: Column 1, 0 Column 2, 0 Column 3, 0 Column 4, sigma sub m sigma sub 1 comma period period period comma sigma sub m colon S i n g of u l a. r V a. l u e s Line 5: C o v a. r i a. n c e M a. t r i x colon R equals F of the T power of F Line 6: R equals U times Sigma times V to the T power times V times Sigma to the T power times U to the T power Line 7: R equals U times Lamda times U to the T power

● Application of Singular Value Decomposition(SVD)

3 lines Line 1: A sub M times N equals U sub M times r to the power of r Sigma sub r times r to the power of r times V sub r times r to the power of r to the T power comma w h of e r e Line 2: U to the power of r equals open bracket u sub 1 times the absolute value of period period period times u sub r close bracket comma V to the power of r equals open bracket v sub 1 times the absolute value of period period period times v sub r close bracket i s o r t h of o g of o n a. l m a. t r i x s Line 3: Sigma to the power of r equals d i a. g of o n a. l m a. t r i x w i t h sigma sub 1 is greater than or equal to sigma sub 2 is greater than or equal to period period period is greater than or equal to sigma sub r is greater than or equal to 0
SVD application

สมมติว่าเรามีข้อมูลขนาด 1 ล้าน * 1 แสน
การคูณ matrix ขนาด n*n เราจะต้องคูณกัน n^3 ครั้ง
เช่น matrix 2*3 เราจะต้องคูณกันทั้งหมด 8 ครั้ง

การที่เราจะเอาทั้งหมดมาคำนวนกัน RAM ของพิวเตอร์ของเราไม่ไหวแน่นอน
ดังนั้น เราก็แบ่งมันเป็นย่อย ๆ แล้วค่อย ๆ คิดได้
และคิดด้วยเลขที่มี 0 เยอะ ๆ คอมก็จะทำงานได้เร็วขึ้นมาก

Functions

Function describes the relationshipbetween x and y.
-Domain: the set of numbers for which a function is defined. ,สิ่งที่เอาไปใส่ใน f(*)
-Range: the set of all possiblenumbers f(x) as y runs over itsdomain. ,ผลลัพธ์ที่ได้จากการเอา f(*)

function
domain and range

● Univariate Functions

univariate = มีตัวแปรเพียงตัวเดียวในการพิจารณา
bivariate = มีตัวแปรสองตัวในการพิจารณา

l i n e a. r f of u n c t i o n colon f of x equals 2 x plus 1 comma f colon double struck R long right arrow double struck R
Equatio Graph
p o l y n o m i a. l f of u n c t i o n colon f of x equals x squared minus 2 x plus 1 comma f colon double struck R long right arrow r-plus
Equatio Graph
the exp of o n e n t i a. l f of u n c t i o n colon f of x equals 10 to the power of x comma f colon double struck R long right arrow r-plus
Equatio Graph
t r i g of o n o m e t r i c f of u n c t i o n colon f of x equals sine x comma f colon the real numbers long right arrow open bracket 0 comma 1 close bracket
Equatio Graph

● Limit of a Function

lim over x right arrow a. of f of x equals L

-“The limit of f(x) as x approaches a is L”.
-Informally: for x close to a, f(x) is close to L. The closer x gets to a, the closer f(x) gets to L.

2 lines Line 1: f of o r m a. l l y colon for all epsilon is greater than 0 there exists delta is greater than 0 s u c h t h of a. t the absolute value of x minus a. is less than delta long right arrow the absolute value of f of x minus L is less than epsilon Line 2: for all equals f of o r a. l l comma there exists equals e x i s t s comma epsilon equals e p s i l o comma delta equals d e l t a.

แปลเป็นภาษามนุษย์จะมีความหมายประมาณนี้ครับ

g of i v e n a. n y epsilon is greater than 0 comma t h of e r e e x i s t s delta is greater than 0 s u c h t h of a. t f of o r a. l l x is not equal to c comma i f the absolute value of x minus c is less than delta comma t h of e n the absolute value of f of x minus L is less than epsilon
limit graph

● Properties of Functions

- continuous function : a function that can be drawn in one stroke.
example of discontinuous function
f(x) = 1/x

Equatio Graph
2 lines Line 1: A f of u n c t i o n f of x i s c o n t i n u o u s i f f of o r e v e r y x sub 0 i n i t s d o m a. i n Line 2: lim over x right arrow x sub 0 of f of x equals f of open paren x sub 0 close paren

● Increasing and Decreasing Functions

-increaseing funcstion : y=f(x)

f of open paren x sub 2 close paren is greater than f of open paren x sub 1 close paren for all x sub 2 is greater than x sub 1 is a. member of open bracket a. comma b close bracket
Equatio Graph

● Increasing and Decreasing Functions

-decreaseing funcstion : y=f(x)

f of open paren x sub 2 close paren is less than f of open paren x sub 1 close paren for all x sub 2 is greater than x sub 1 is a. member of open bracket a. comma b close bracket
Equatio Graph

● Monotonic function

monotonic function is a (non-) increasing / decreasing function over the whole domain.

Equatio Graph

there are a monotonically non-decreasingfunction, a monotonically non-increasing function
and a non-monotonic function.

● Convexity

Concave function

4 lines Line 1: f of open paren the fraction with numerator x sub 1 plus x sub 2 and denominator 2 close paren is greater than the fraction with numerator f of open paren x sub 1 close paren plus f of open paren x sub 2 close paren and denominator 2 Line 2: f of x equals x squared times negative 1 comma x sub 1 equals 0 comma x sub 2 equals 1 Line 3: open paren the fraction with numerator 0 plus 1 and denominator 2 close paren squared times negative 1 is greater than the fraction with numerator 0 squared plus open paren open paren 1 squared close paren times negative 1 close paren and denominator 2 Line 4: negative one fourth is greater than negative one half
Equatio Graph

Convex function

4 lines Line 1: f of open paren the fraction with numerator x sub 1 plus x sub 2 and denominator 2 close paren is less than the fraction with numerator f of open paren x sub 1 close paren plus f of open paren x sub 2 close paren and denominator 2 Line 2: f of x equals x squared comma x sub 1 equals 0 comma x sub 2 equals 1 Line 3: open paren the fraction with numerator 0 plus 1 and denominator 2 close paren squared is less than the fraction with numerator 0 squared plus 1 squared and denominator 2 Line 4: one fourth is less than one half
Equatio Graph

A non-convex curve

Equatio Graph

Derivative

Derivative is way to measure change

4 lines Line 1: f prime of x equals lim over white up pointing triangle x right arrow 0 of open paren the fraction with numerator f of open paren x plus white up pointing triangle x close paren minus f of x and denominator white up pointing triangle x close paren Line 2: d e r i v a. t i v e o f t h of e f of u n c t i o n f a. t t h of e p o i n t x t e l l s u s h of o w m u c h t h of e Line 3: f of u c n t i o n f of c h of a. n g of e s a. s t h of e i n p u t x c h of a. n g of e s b y s m a. l l a. m o u n t white up pointing triangle x colon Line 4: f of open paren x plus white up pointing triangle x close paren almost equals f of x plus white up pointing triangle x times f prime of x
derivative notation

คือแต่ละคนคิดก็ใช้สัญญะไม่เหมือนกัน พอคนมาเรียนก็เลยงง
แต่จริง ๆ แก่นแท้ของมันคือการเปรียบอัตราการเปลี่ยนแปลงระหว่างจุด 2 จุด

● Derivative formula

15 lines Line 1: d e r i v a. t i v e f of o r m u l a. colon Line 2: open paren c o n s tangent t close paren prime equals 0 Line 3: x to the alpha-th power prime equals alpha x raised to the alpha minus 1 power Line 4: e to the power of x prime equals e to the power of x Line 5: a. to the power of x prime equals a. to the power of x l n a. Line 6: open paren l n x close paren prime equals 1 over x Line 7: open paren the log base a. of x close paren prime equals the fraction with numerator 1 and denominator x l n a. Line 8: open paren sine x close paren prime equals cosine x Line 9: open paren cosine x close paren prime equals negative sine x Line 10: open paren tangent x close paren prime equals 1 over cosine squared x Line 11: cotan of g of e n t o r open paren cotangent x close paren prime equals negative 1 over sine squared x Line 12: open paren arc sine x close paren prime equals the fraction with numerator 1 and denominator the square root of 1 minus x squared Line 13: open paren arc cosine x close paren prime equals negative the fraction with numerator 1 and denominator the square root of 1 minus x squared Line 14: open paren arc tangent x close paren prime equals the fraction with numerator 1 and denominator 1 plus x squared Line 15: open paren arc cotangent x close paren prime equals negative the fraction with numerator 1 and denominator 1 plus x squared

● Sum Rule

1 lines Line 1: open bracket u of x plus v of x close bracket prime equals u prime of x plus v prime of x

● Product Rule

1 lines Line 1: open bracket u of x times v of x close bracket prime equals u prime of x times v of x plus u of x times v prime of x

● Chain Rule

3 lines Line 1: f of open paren g of x close paren prime equals f prime of g of x times g prime of x Line 2: o r Line 3: d f over d x equals d f over d g times d g over d x

● Quotient Rule

1 lines Line 1: open paren u of x over v of x close paren prime equals open paren u of x times 1 over v of x close paren prime equals u prime of x times 1 over v of x minus u of x period open paren the fraction with numerator 1 and denominator v of x squared close paren times v prime of x equals the fraction with numerator open paren u prime of x v of x minus u of x v prime of x close paren and denominator v of x squared

● Geometric Meaning of a Derivative

Geometrically, the derivative of a function f(x) at a given point is the slope of the tangent to f(x) at the point a.

derivative geometry
2 lines Line 1: i n c r e a. sine g f of u n c t i o n colon f prime of x is greater than 0 for all x is a. member of open bracket a. comma b close bracket Line 2: d e c r e a. sine g f of u n c t i o n colon f prime of x is less than 0 for all x is a. member of open bracket a. comma b close bracket

● Find minimum and maximum points

สมมติว่าเรามีหนึ่งฟังชั่น คือ f(x) = x^3-12x+2

Equatio Graph

เรารู้ว่าที่ที่ความชันเป็น 0 จะเป็นจุดสูงสุดหรือต่ำสุด เราจะเรียกจุดนี้ว่า Critical Point
f'(x)= 3x^2-12 หากเราแก้สมการนี้โดยการเท่ากับ 0 : 3x^2-12=0
เราจะได้ค่า x มาสองค่าคือ 2 และ -2
หรือ f'(2)=0 และ f'(-2)=0

Equatio Graph

จากรูปจะเห็นได้ว่าที่จุด x=-2 ค่า derivative ที่จะได้จะข้ามจากค่า + ไปเป็นค่า -
เป็นเกณฑ์วัดว่านั้นคือจุดสูงสุด

และที่จุด x=2 ค่า derivative ที่จะได้จะข้ามจากค่า - ไปเป็นค่า +
เป็นเกณฑ์วัดว่านั้นคือจุดต่ำสุด

สามารถย้อนไปดูรปก่อน ๆ ที่เป็นค่า tangent ได้ครับ

หากเราดูที่กราฟด้านล่างที่อยู่ในช่วงของ [a, b]
เราจะเห็นได้ว่ามีจุดที่สำคัญอยู่ 3 จุด ไล่จากซ้ายไปขวาคือ
1) local maximum
2) the minimum for the region under cosideration
3) the maximum for the region under cosideration

ดังนั้น Don’t Forget the Endpoints of the interval!

minimum and maximum points

● Algorithm for Finding Global Extrema

Suppose you need to find global maxima (minima) of f(x) on [a, b]
Step :
1) Find all critical points of f(x) on [a, b]
2) Determine which of them are the local maxima (minima);
3) Compute f(x) at the endpoints: f(a) and f(b) .
4) Pick the point from (2) – (3) corresponding to the largest (smallest) functionvalue.

● Higher Derivatives

Derivatives of the derivatives looks like this
f''(x)=(f'(x))', f'''(x)=(f(f''(x))', ...

Let a be a stationary point: f'(x)=0
as we know from above
if f'(x) < 0 then f(x) has a local maximum at x
if f'(x) > 0 then f(x) has a local minimum at x

However if x = 0 we don't know what happens so we need to check manually

Derivatives of the derivatives looks like this
f''(x)=(f'(x))', f'''(x)=(f(f''(x))', ...

Let a be a stationary point: f'(x)=0
as we know from above
if f'(x) < 0 then f(x) has a local maximum at x
if f'(x) > 0 then f(x) has a local minimum at x

However if x = 0 we don't know what happens so we need to check manually
There are 3 cases that can be possible.

Equatio Graph

● Taylor Series

Taylor series are an incredibly important tool for numerical approximation.

The formula for the Taylor series of a function f(x) around a point x=a is given by

f of a. plus the fraction with numerator f prime of a. and denominator 1 factorial times open paren x minus a. close paren plus the fraction with numerator f prime prime of a. and denominator 2 factorial times open paren x minus a. close paren squared plus the fraction with numerator f prime prime prime of a. and denominator 3 factorial times open paren x minus a. close paren cubed plus period period period
T sub infinity equals the sum from k equals 0 to infinity of the fraction with numerator the k-th power of f of open paren x sub 0 close paren and denominator k factorial times open paren x minus x sub 0 close paren to the power of k

Taylor Series เป็นเรื่องนึงที่ผมรู้สึกว่าไม่ค่อยเข้าใจว่าเรียนไปทำไม
แต่ที่ไปหาข้อมูลเพิ่มเติมมาคลิปของ 3Blue1Brown Taylor series | Chapter 11, Essence of calculus
ช่วยผมเยอะมากครับ (จริง ๆ หลายเรื่องที่เข้าใจก็เพราะ 3Blue1Brown 555) และก็เอามากจาก cambridgecoaching

เข้าเรื่องเลย คือ การทำ function ที่เรามีให้อยู่ในรูปของ polynomial มันมีข้อดีหลายอย่างต่อการคำนวน
เอาไปหาก derivative หรือเอาไป integral ได้ทำได้ง่ายอีกเช่นกัน

ยกตัวอย่างเรามี function ที่ค่อนข้างซับซ้อน เช่น f(x) = cos(x)
แล้วเราต้องการสร้าง function ที่ประมาณค่ามีความใกล้เขียนกับ function cos(x) มากที่สุด

เริ่มจากวิธีที่ง่ายที่สุดคือ การสร้าง function เส้นตรง
นั่นคือ g(x) = mx+b และ f(0) = g(0)
เรารู้ว่าค่า cos(0) = 1 เราจะได้สมการ g(0)=m(0)+b=1 ดังนั้นเราจะรู้ว่า b=1
ซึ่งเราจะได้เส้นตรงสีฟ้าแนวนอนขนานแกน x ตามรูปด้านล่าง

แต่เราอยากได้ function ประมาณค่าที่มันใกล้เคียงมากกว่า function เส้นตรง
เราเลยจะสร้าง quadratic funtion ขึ้นมา
ซึ่งหน้าตาของ function ก็จะเป็นประมาณนี้ g(x) = a + bx + cx^2
แต่เราจะได้ สมการมากมายที่ g(0) = 1 + bx+cx^2 ซึ่ง bx+cx^2 = 0 จะทำให้สมการเป็นจริง

ตอนนี้ได้ค่า a = 1 แล้ว

ดังนั้นเราก็จะได้ค่ามากมายที่เอาไปแทนค่าใน b, c และทำให้สามาการเป็นจริง
ไปดูที่พาราโบล่าด้านล่างที่ผ่านจุด (0, 1) แต่อันสีฟ้าเพียงอันเดียวที่ดูแล้วจะใกล้เคียง cos(x) มากที่สุด

โดยเราจะหา g(x) สีฟ้าได้โดย หา derivative ของ g'(x) = f'(x)

สิ่งที่ควรรู้เพิ่มเติม ก่อนไปต่อ
first derivative =  slope of the tangent lineto the function at the point x
the first derivative tells us how whethera function is increasing or decreasing,
and by how much it is increasing or decreasing.

second derivative = tells us if the first derivative is increasing or decreasing. If the second derivative is positive, then the firstderivative is increasing, so that the slope of the tangent line to the function is increasing as x increases. We see this phenomenon graphically as the curve of the graph being concave up, that is, shaped like a parabola open upward. Likewise, if the second derivative is negative, then the first derivative is decreasing, so thatthe slope of the tangent line to the function is decreasing as x increases. Graphically, we see this as the curve of the graph being concave down, that is, shaped like a parabola open downward. At the points where thesecond derivative is zero, we do not learn anything about the shape of the graph: it may be concave up orconcave down, or it may be changing from concave up to concave down or changing from concave down toconcave up

เพราะเรารู้ว่าความชันของ f(0) = 0 เพราะเป็นจุดสูงสุด
ที่จุด g'(x) = f'(x) ความชันของ g'(x) และ f'(x) จะต้องเท่ากัน
cox'(0) = -sin(0) = 0

เราก็จะได้ค่า b = 0

และเราก็อยากที่จะได้ค่า c ต่อ โดยเราก็หาโดยการหา second derivative ของ g''(x) = 2c
derivative of f(x) = cos(x) at x=0 is f''(0) = -cos(0) = -1, this gives us that 2c=-1, and so c = -1/2.

เราก็จะได้ค่า c = -1/2

จุดท้ายเราก็จะได้ quadratic approximation แบบนี้

1 lines Line 1: g of x equals 1 plus 0 times x minus one half times x squared equals 1 minus one half times x squared
taylor series 1

เราก็จะได้ function กำลังสองสีฟ้าที่ดีกว่า function กำลังสองอันอื่น ๆ

● Higher Order Approximations

อย่างไรก็ตาม หากเราต้องการ functions ที่ใกล้เคียงมากกว่ากำลังสอง
สิ่งที่เราจะทำก็คือ หา derivative ของ กำลังนั้นลึกลงไปเรื่อย ๆ
f'''(x)=g'''(x) แบบนี้ไปไปเรื่อย ๆ

g of x equals a. sub 0 plus a. sub 1 x to the first power plus a. sub 2 x squared plus dot dot dot
3 lines Line 1: m factorial times a. sub m equals the m-th power of f of 0 Line 2: If we rearrange the terms comma we see that colon Line 3: a. sub m equals the fraction with numerator the m-th power of f of 0 and denominator m factorial

แล้วเราก็จะได้อะไรแบบนี้

f of x equals f of a. plus the fraction with numerator f prime of a. and denominator 1 factorial times open paren x minus a. close paren plus the fraction with numerator f prime prime of a. and denominator 2 factorial times open paren x minus a. close paren squared plus the fraction with numerator f prime prime prime of a. and denominator 3 factorial times open paren x minus a. close paren cubed plus dot dot dot
equals 1 plus the fraction with numerator f prime of cosine x times 0 close paren and denominator 1 factorial x plus the fraction with numerator f prime prime of cosine x times 0 and denominator 2 factorial x squared plus the fraction with numerator f prime prime prime of cosine x times 0 and denominator 3 factorial x cubed plus dot dot dot
equals 1 plus the fraction with numerator 0 and denominator 1 factorial x plus the fraction with numerator negative 1 and denominator 2 factorial x squared plus the fraction with numerator 0 and denominator 3 factorial x cubed plus the fraction with numerator 1 and denominator 4 factorial x to the fourth power plus the fraction with numerator 0 and denominator 5 factorial x to the fifth power plus the fraction with numerator negative 1 and denominator 6 factorial x to the sixth power plus the fraction with numerator 0 and denominator 7 factorial x to the seventh power plus the fraction with numerator 1 and denominator 8 factorial x to the eighth power plus dot dot dot
equals 1 minus the fraction with numerator 1 and denominator 2 factorial x squared plus the fraction with numerator 1 and denominator 4 factorial x to the fourth power minus the fraction with numerator 1 and denominator 6 factorial x to the sixth power plus the fraction with numerator 1 and denominator 8 factorial x to the eighth power plus dot dot dot
equals the sum from n equals 0 to infinity of open paren negative 1 close paren to the power of n times the fraction with numerator x raised to the 2 n power and denominator 2 n factorial
taylor series 2

ตอนนี้เริ่มรู้สึกว่าเนื้อหาเยอะเกินไปในบทความเดียว
ดังนั้นผมจะรอเขียนแยกอีกหนึ่งบทความนะครับ ความรู้พื้นฐานคณิตศาสตร์ที่จำเป็นในการทำ AI ตอนที่ 2

บทสรุป

ตอนแรกตั้งใจว่าจะตัดแปะเฉย ๆ แปปเดียวก็น่าจะเสร็จ
แต่พอเขียนจริงต้องทำความเข้าใจพร้อมกันไปด้วยอีกรอบในส่วนที่ไม่เข้าใจ
เพื่อตัวเองในอนาคตกลับมาอ่านจะได้อ่านง่าย ๆ ตอนต้องใช้ในอนาคต

พอเขียนจริงเริ่มเขียนตั้งแต่ 19 ตุลาคม 2022 แต่เขียนตอนแรกเสร็จตอน 6 พฤศจิกายน
ใช้เวลาไป 20 กว่าวัน เยอะกว่าที่คิดไว้ตอนแรกมากครับ

แล้วจะค่อย ๆ เขียนเพิ่มเนื้อหาในตอนที่ 2 เพิ่มนะครับ

เขียนโดย กอปกฤษฏิ์ ทรายเขียว

นักเรียนที่ทำสรุปวิชาคณิตศาสตร์ที่เคยได้เรียน

กลับด้านบน