Self-discipline (Switch OFF cell phone and no chatting) 自律(關機,不聊天)
Response to question (using interactive tools) 回答問題(使用互動工具)
Hand in your homework ON TIME 按時交作業
Attendance will be checked but NOT graded (*bonus will be given to who attend all classes on time!!) 將檢查出勤情況,但不評分(*準時參加所有課程者將獲得獎勵!!)。
Course Objectives 課程目標
apply the fundamentals of science to formulate environmental problems; 運用科學基礎知識來解決環境問題;
apply such fundamentals to synthesize cost effective solutions; 應用這些基本原理來綜合製定具有成本效益的解決方案;
apply such fundamentals to explore, summarizing and presenting data to identify environmental problems using statistical methods; 運用這些基礎知識探索、總結和展示數據,使用統計方法確定環境問題;
design and carry out proper statistical tests and interpret the results for evaluation of environmental problems; 設計和進行適當的統計測試,並解釋結果,以評估環境問題;
appreciate probabilistic nature of environmental sciences and develop ability to quantify risk; 了解環境科學的機率性質,培養量化風險的能力;
communicate logically and lucidly in statistically language and in English writing; 用統計語言和英語寫作進行邏輯清晰的溝通;
recognize the need for, and an ability to engage in life-long learning 認識終身學習的必要性和能力
Part A - Linear Programming A 部分- 線性編程
System of linear equations, matrices, linear inequality. 線性方程組、矩陣、線性不等式。
Determinants and matrices: definition and properties of nth order determinants; matrix algebra, transpose, inverse matrix; solutions of system of linear simultaneous equations. 行列式與矩陣:n 次行列式的定義與性質;矩陣代數、轉置、逆矩陣;線性同時方程組的解。
Linear programming, maximization and minimization. 線性規劃、最大化和最小化。
Part B - Statistics B 部分- 統計
Fundamental of statistics, probability and chance. 統計、機率和機會的基本原理。
Descriptive and summary statistics, means, SD, SEM, median, centiles. Outliers, missing data. Random variables and expectation. Variance, covariance. Data description and probability distributions. 描述性與總結統計、平均數、標清、SEM、中位數、百分位數。異常值、缺失資料。隨機變數和期望。方差、協方差。數據描述和機率分佈。
Hypothesis testing and tests of significance. 假設檢定和顯著性檢定。
One and two sample studies, sample size. p values, power of a test. Confidence intervals. 單樣本和雙樣本研究、樣本數。信賴區間。
Comparison of means, chi squared, t-test. Editing outliers and other nuisances. ANOVA. 平均數比較、卡方檢定、t 檢定。編輯異常值和其他幹擾項。變異數分析
Correlation and regression analysis, coefficients residuals. Analysis of variance, one-way, two-way, mixed models and orthogonal designs, multiple regression, general linear model. ANOVA applied to regression. 相關和迴歸分析,係數殘差。變異數分析、單向、雙向、混合模型和正交設計、多元迴歸、一般線性模型。方差分析應用於迴歸。
We will be using Microsoft Excel for demonstration and exercises in the lectures and tutorials 我們將在講座和教學中使用Microsoft Excel 進行演示和練習。
Lecture 1 第1 講
Systems of linear equations 線性方程組
Objective of this lecture: 本講座的目的
Gauss-Jordan Elimination. 高斯-喬丹消除法
Basic matrix operations. 基本矩陣運算
Inverse of a square matrix. 正方形矩陣的逆矩陣。
Matrix equations and systems of linear equations. 矩陣方程式和線性方程組。
System of 2 linear equations 兩個線性方程組
System in 2 variables
-
- cx 2 個變數中的系統
-
- cx
where a, b, c, d, h, k are real constants. 其中a、b、c、d、h、k 為實數常數。
is a solution if it satisfy the equation pair. The set of all such ordered pairs is a solution of this system. 如果 滿足方程式對,那麼它就是一個解。所有此類有序對的集合就是這個系統的解。
3 methods to solve: 3 種解決方法:
graphical, substitution and elimination. 圖形、替換和消除。
Example: Graphical 舉例說明:圖形
Draw the two lines on a graph, the intercept point is the only solution. 在圖形上畫出這兩條線,截點是唯一的解。
The intersection 交叉點
Example: Consistent and Indedendendent 實例:一致和獨立
Fast way to draw the blue line: 快速繪製藍色線條的方法
at 在
at 在
Find the and intercept points. 找出 和 截距點。
Join the 2 points by a straight line. 將兩點用直線連接起來。
Example: Inconsistent 舉例說明:不一致
System of 2 variables 2 變數系統
2 parallel lines, no interception. 兩條平行線,沒有攔截。
■ No solution. 沒有解決方案。
Example: Consistent and Dependent 實例:一致性和依賴性
System of 2 variables 2 變數系統
The same line. 同一句話。
Infinite no of solutions. 無窮無盡的解決方案
Substitution 替換
then 那麼
■ sub into first equation: 將■ 子代入第一個等式:
,
thus 因此
solution is 解決方案是
Elimination by addition 用加法消除
Theorem: 定理
A system of linear equations is transformed into an equivalent system if 在下列情況下,線性方程組可轉換為等價系統
Two equations are interchanged. 兩個等式互換。
An equation is multiplied by a nonzero constant. 方程式乘以一個非零常數。
A constant multiple of one equation is added to another equation. 將一個等式的常數倍數加到另一個等式中。
Elimination by addition 用加法消除
■ ■
subtract 減去
thus 因此
and substitute into either equation: 並將 代入任一等式:
■ ■
The solution is 解決方案是
Application of 2 equation system 兩個方程組的應用
Population of mosquito depends on ambient temperature T. Population will increase when temperature goes up (birth) but at the same time, death rate also increase. 蚊子的數量取決於環境溫度T。溫度升高時,蚊子的數量會增加(出生),但同時死亡率也會增加。
■ Death rate: 死亡率:
■ Birth rate: 出生率:
where T represents the temperature and P is the population of mosquito. 其中,T 代表溫度,P 代表蚊子數量。
Sometimes, birth exceed death and vice versa. 有時,出生超過死亡,反之亦然。
At what T does the birth equal death? 什麼時候出生等於死亡?
Supply and Demand 供需關係
The 2 lines meet at the intersection point where: 兩條直線在以下交點相交:
■ ■
If population exceed 1.7, the death will exceed birth and population will come down and vice versa. The equilibrium population is at 1.7. 如果人口超過1.7,死亡人數就會超過出生人數,人口就會減少,反之亦然。平衡人口為1.7。
Systems of Linear Equations and Augmented Matrices 線性方程組和增量矩陣
■ Matrices 矩陣
A matrix is a rectangular array of numbers written within brackets. 矩陣是在括號內寫入數字的矩形數組。
- Matrices - 矩陣
Each number is called an element of the matrix. 每個數字稱為矩陣的一個元素。
Horizontal elements form 1 row. 水平元素組成1 行。
Vertical elements form 1 column. 垂直元素組成1 列。
Dimensions: m rows x n columns. 尺寸:m 行xn 列。
m x n matrix. mxn 矩陣。
Square matrix: . 正方形矩陣: 。
Matrix with only one column is called column matrix. With only one row is called row matrix. 只有一列的矩陣稱為列矩陣。只有一行的矩陣稱為行矩陣。
elements denoted by where i is the row and j denotes the column position. 以 表示的元素,其中i 表示行,j 表示列的位置。
Arrange the equations in the same format. 以同樣的格式排列方程式。
x-term follow by y term on the left hand side and put all constants on the right hand side of the equations. 在方程式的左邊列出x 項和y 項,在方程式的右邊列出所有常數。
Coefficients of the and terms form the coefficient matrix. 和 項的係數構成係數矩陣。
Coefficients of the constant terms form the constant matrix. 常數項的係數構成常數矩陣。
The augmented coefficient matrix contains all the essential parts. 增強係數矩陣包含所有重要部分。
Solving Linear Systems using 使用線性系統求解
Augmented matrices 擴增矩陣
2 linear systems are equivalent if they have the same solution set. 如果2 個線性系統的解集相同,它們就是等價的。
We can transform the equations without changing their solutions by: 我們可以透過以下方法,在不改變方程式解的情況下對方程式進行變換:
interchange 2 equations, 交換2 個等式、
multiply one whole equation by a constant, 將一個整數乘以一個常數、
linear combination of two equations. 兩個方程式的線性組合。
- Theorem - 定理
An augmented matrix is transformed into a rowequivalent matrix by performing any of the following row operations: 擴增矩陣可透過以下任一行運算轉換為羅威等效矩陣:
change row with . 用 更改行。
change to . 更改為 。
Replace by 將 替換為
Elimination by adđition 加法消除
step 1: make interchange the 2 rows 步驟1:使 互換2 行
step 3: make 步驟3:製作
Elimination by addition (amended) 透過增補消除(修正)
We have successfully transformed the 2 equations set into a new 2 equation set which have the same solutions. 我們成功地將2 個方程組轉換為新的2 個方程組,它們的解法相同。
In this format, both x and y are easily found: 在這種格式下,x 和y 都很容易找到:
and . 和 。
substitute into both equations to check. 將 代入兩個等式進行檢定。
We can operate using only the matrices. 我們可以只使用矩陣進行運算。
Elimination by addition 用加法消除
Exercise 運動
Exercise 運動
Exercise 運動
Exercise 運動
Exercise 運動
Exercise 運動
Example: Graphical 舉例說明:圖形
Draw the two lines on a graph, the intercept point is the only solution. 在圖形上畫出這兩條線,截點是唯一的解。
The intersection point is 交叉點為
(5.647, 1.765 )
Augmented Matrices Exercise 擴增矩陣練習
Example: Check your solution 舉例說明:檢查您的解決方案
The intersection point is 交叉點為
(5.647, 1.765 )
2(5.647) - 3(1.765) = ?
3(5.647) ? 3(5.647) ?
Example: Special case 舉例說明:特殊情況
The 2 lines coincide 兩條線重合
There are infinite number of solutions 有無限的解決方案
Example: Special case 舉例說明:特殊情況
The 2 lines are parallel 兩條線平行
There are no solutions at all. 根本沒有解決辦法。
Gauss-Jordan Elimination 高斯-喬丹消除法
Reduced Matrix 縮減矩陣
We have just learnt 2 x 2 equations system. 我們剛剛學習了2 x 2 等式系統。
The same concept can be applied to 3x3, .....nxn equation systems. 同樣的概念也可應用於3x3、 .....nxn 等式系統。
We transformed the augmented matrix to reduced form. 我們將增強矩陣轉換為簡化形式。
It can be shown that any linear system must have exactly one solution, no solution or infinite no of solutions, regardless of the no of equations or no of variables. 可以證明,無論有多少個方程或變量,任何線性系統都必須有一個解、無解或無限多個解。
Reduced Matrix 縮減矩陣
Gauss-Jordan Elimination 高斯-喬丹消除法
The method systematically transforms an augmented matrix into a reduced form. 此方法可將增強矩陣系統地轉換為還原形式。
The reduced system is then very easy to solve. 這樣,簡化後的系統就很容易求解了。
Gauss-Jordan Elimination 高斯-喬丹消除法
Gauss-Jordan Elimination 高斯-喬丹消除法
Gauss-Jordan Elimination 高斯-喬丹消除法
solutions: let 解決方案:讓
0
1
-3
5
Basic Operations of Matrix 矩陣的基本運算
Addition/Subtraction 加法/減法
The two matrices must have the same size and same shape 兩個矩陣的大小和形狀必須相同
Commutative: 交換:
Assoicative: 助理:
Zero and Negation 零和否定
Zero matrix: all elements are zero. 零矩陣:所有元素均為零。
Negative matrix: 負矩陣
Multiplication 乘法
Multiplication by a number 數位乘法
Actually it is the self addition by times 實際上,它是 倍的自加法
Multiplication 乘法
Matrix Product 矩陣產品
Matrix Product 矩陣產品
56
Definition of Matrix Product 矩陣產品的定義
If is an x p matrix and is a matrix, the matrix product of A and B , denoted as AB is an m x n matrix whose element in the ith row and the jth column is the real number obtained from the product of the ith row of A and the jth column of B. 如果 是 xp 矩陣, 是 矩陣,則A 和B 的矩陣積表示為AB,是mxn 矩陣,其第i 行和第j 列中的元素是由A 的第i 行和B 的第j 列的乘積得到的實數。
-If the number of columns in A does not equal the number of rows in B , the AB is not defined. -如果A 中的列數不等於B 中的行數,則AB 沒有定義。
Example of Matrix Product 矩陣產品範例
Properties of Matrix Products 矩陣產品的特性
For two matrices A and B : 對於兩個矩陣A 和B :
Non Commutative: A 非交換: A
Zero properties does not hold in matrix 零屬性在矩陣中不成立
In real numbers, for then at least one number must be zero. 在實數中,對於 ,至少有一個數字必須為零。
In matrix, it is not necessary to require 在矩陣中, 沒有必要要求
or 或
Identity and Inverse Matrix 同矩陣和逆矩陣
Identity Matrix 身份矩陣
Does it exist a matrix I that act like the number one so that ? 是否存在一個矩陣I,其作用類似數字1,從而使 ?
The identity element for multiplication for the set of all square matrices of order n is the matrix with all diagonal elements equal 1 and all other elements zero. 所有n 階正方形矩陣集合的乘法同元素是所有對角線元素等於1,所有其他元素為0 的矩陣。
Example of Identity Matrix Product 同位矩陣乘積範例
Inverse Matrix 逆矩陣
Does it exist a matrix that act like the so that ? 是否存在與 相似的矩陣 ,從而使 ?
Many square matrices have inverse. Furthermore, non-square matrices may also have inverse. 許多正方形矩陣都有逆。此外,非方陣矩陣也可能有逆。
Inverse do not always exist for square matrices. 正方形矩陣並不總是存在逆矩陣。
Example of 2 x2 Multiplicative Inverse 2 x2 的乘法倒數範例
Matrix
this is true only if: 只有當
2a+3c = 1; 2b + 3d = 0; a + 2c =0; b + 2d = 1 2a+3c = 1;2b + 3d = 0;a + 2c = 0;b + 2d = 1
Solving the equations and 4 unknowns: 求解方程式與4 個未知數:
Example of Multiplicative Inverse Matrix 乘法逆矩陣範例
Check: 檢查:
The inverse of is 的倒數是
Actually the inverse of is 實際上, 的倒數是 。
Example of 3x3 Multiplicative Inverse Matrix 3x3 乘法逆矩陣範例
Solving the 9 equations and 9 unknowns: 求解9 個方程式和9 個未知數:
Example of 3x3 Multiplicative Inverse Matrix 3x3 乘法逆矩陣範例
It is more convenient to transform together. 一起改造更方便。
The objective is to carry out linear combinations and transform the right hand side to I 目標是進行線性組合,並將右側轉換為 I
Gauss elimination to find Inverse Matrix 高斯消去法求逆矩陣
Gauss elimination to find Inverse Matrix 高斯消去法求逆矩陣
Check: 檢查:
Inverse Matrix 逆矩陣
If [ M | I ] is transformed by row operations into [ I ], then the resulting matrix of is 如果[ M | I ] 透過行運算轉換為[ I ],那麼得到的 矩陣為
. However, if we obtain all zeros in one or more rows to the left of the vertical line, then does not exist. 。但是,如果我們在垂直線左邊的一行或多行中得到所有零,那麼 就不存在。
Exercise 運動
Find the inverse of: 求其倒數:
Inverse of 2 x 2 Matrix 2 x 2 矩陣的倒數
The inverse of 的倒數
is 是
We used to call ad - bc = D the determinant 我們習慣稱ad - bc = D 為行列式
thus inverse exist when D is nonzero 因此,當D 不為零時,反比例存在
Square matrix that do not have inverse are called Singular Matrix 沒有逆矩陣的正方形矩陣稱為奇異矩陣
Matrix Equations and Systems of Linear Equations 矩陣方程式與線性方程組
Matrix Equations 矩陣方程
Let x be an unknown matrix: 設x 為未知矩陣:
note that is not the solution. 注意, 並不是解決方案。
Matrix Equations 矩陣方程
Solve the following simultaneous equations using inverse matrix. 用逆矩陣求解下列同步方程式。
The inverse of is 的倒數是
Matrix Equations 矩陣方程
Using to solve 使用 求解
may not work, it requires: 可能不起作用,這需要
the inverse to exist and 逆向存在,且
the no of equations equals the no of unknowns. In this case, use Gauss-Jordan elimination to try to solve the equation in parametric form. 方程式個數等於未知數個數。在這種情況下,使用高斯-喬丹消元法嘗試以參數形式求解方程式。
Matrix Equations Example 矩陣方程式範例
An investment advisor currently has 2 types of investment available for clients: a conservative investment A that pays per year and an investment B of higher risk that pays per year. 某投資顧問目前有兩種投資可供客戶選擇:一種是年收益 的保守型投資A,另一種是年收益 的高風險型投資B。
Clients may divide their investments between the 2 to achieve any total return desired between to . However, the higher the desired return, the higher the risk. 客戶可將其投資在這兩者之間分配,以獲得 至 之間的任何預期總回報。不過,期望的回報越高,風險也越大。
How should each client listed in the table invest to achieve the indicated return? 表中列出的每位客戶應如何投資以獲得預期收益?
Clients' Asset 客戶資產
Client 客戶
1
2
3
Total
投資
Total
investment
年度回報
desired
Annual return
desired
Matrix Equations Example 矩陣方程式範例
Let be the amount invested in A by a client 設 為客戶在A 的投資額
Let be the amount invested in B by a client 設 為客戶在B 的投資額
Consider client 1 ; 考慮客戶1 ;
Matrix Equations Example 矩陣方程式範例
Client 1 should invest $15000 in A and in B 客戶1 應在A 中投資15000 美元,在B 中投資
Matrix Equations Example 矩陣方程式範例
■ Client 2 should invest in A and in B 客戶2 應將 投資於A,將 投資於 B
Matrix Equations Example 矩陣方程式範例
Client 3 should invest in A and in B 客戶3 應將 投資於A,將 投資於 B
Matrix Equations Example 矩陣方程式範例
This example illustrate the application of the matrix algebra. 本例說明了矩陣代數的應用。
The first step to find the inverse of a matrix is rather laborious. However, once it is found, the computation for many customers becomes very simple. 求矩陣逆的第一步相當費力。不過,一旦求出,許多客戶的計算就會變得非常簡單。
End of Lecture 1 第1 講結束
You have learnt how to solve linear simultaneous equations set using matrix algebra. 您已學會如何使用矩陣代數來解線性同步方程組。
Next lecture we will discuss linear programming. 下一講我們將討論線性規劃。