SlideShare a Scribd company logo
1 of 12
Download to read offline
Math 156
Homework1(Cui Yi) ID number:605068398
Math 156
Homework1(Cui Yi) ID number:605068398
Q1.
Solution
Q2.
Solution
Q2.1
Q2.2
Q4.
Solution
Q5.
Solution
Q6.
Solution
Q7.
Solution
Q8.
Solution
Q1.
Compute the gradient J (w ) and show that the equation J (w ) = 0
may be written in the form Aw = b where A is a matrix and b is a vector.
Solution
Cost function: ,
Obviously, we can easily
Then, using the chain theory,
Setting the , then
1°when is invertible , , Remark: Ker(A)={ }
2°
Rm: the form ,when is vertible, then
Figure 1
Q2.
Does the equation J (w ) = 0 always have a solution? If there is a solution is it unique? Explain how
these two questions are related to the number of data points N and the degree M of the polynomial
model.
Solution
Q2.1
The equation J (w ) = 0 does not always have a solution.
For example, it will meet the problems like over-fitting.(Figure 1)
When the M becomes bigger, it will cause the over-fitting problem. At this time, the equation J (w )
= 0 does not always have a solution.
Also, it will finally make the inaccuracy in the test set while it may have better performance in the
training set.
Intuitively, what is happening is that the more flexible polynomials with larger values ofM are
becoming increasingly tuned to the random noise on the target values.
Figure 2
Figure 3
Q2.2
From the point of RANK, we know rank(Z) , and
If ,the solution is not unique.
If the solution is unique.
In the book, we can easily see the difference of different N(N is the point)
We see that increasing the size of the data set reduces the over-fitting problem.
But what we should bear in mind is that the larger the data set, the more complex (in other words
more flexible) the model that we can afford to fit to the data.
Figure 4
Q4.
Solution
Those twelve points are illustrated on the picture.
x=[-pi:0.001:pi];
y=cos(2.*x);
plot(x,y);
hold on
xi=linspace(-pi,pi,12);
yi=cos(2.*xi);
plot(xi,yi,'r*');
title('Task 4', 'FontSize', 16);
ylabel('cos(X)', 'FontSize', 15);
xlabel('X', 'FontSize', 15);
Q5.
Solution
The same as Task 1, and ,
We can easily get the result with two situations. And the final form is
1°
2° , Remark: Ker(A)={ }
Here, z , t
Figure 5
Q6.
Solution
is the function that we get from Task 5
X1 = [-3:0.01:3]' ;
Figure 6
When M=11 , it may get the best result.
X1 = [-pi:(2.*pi)./11:pi]' ;
Figure 7
Q7.
Solution
Figure 8
Q8.
Solution
From the figure,we can easily find that M=6 is th best fitting.
Here are two situations where I choose the x data
X = rand(12, 1)*2* pi- pi ;
Figure 9
Figure 10
When m=11,
X = [-pi:(2.*pi)./11:pi]';
Figure 11
When m=11,
The fitted function has very steep slopes especially in figure 9 and extreme values .

More Related Content

What's hot

Sienna 10 dynamic
Sienna 10 dynamicSienna 10 dynamic
Sienna 10 dynamic
chidabdu
 
modul 2 add maths
modul 2 add mathsmodul 2 add maths
modul 2 add maths
Sasi Villa
 
2.2 graphing linear equations
2.2 graphing linear equations2.2 graphing linear equations
2.2 graphing linear equations
andreagoings
 
Chapter 1 functions
Chapter 1  functionsChapter 1  functions
Chapter 1 functions
Umair Pearl
 
add maths module 4
add maths module 4add maths module 4
add maths module 4
Sasi Villa
 
Solving Linear Equations
Solving Linear EquationsSolving Linear Equations
Solving Linear Equations
taco40
 

What's hot (20)

presentazione
presentazionepresentazione
presentazione
 
FEM Introduction: Solving ODE-BVP using the Galerkin's Method
FEM Introduction: Solving ODE-BVP using the Galerkin's MethodFEM Introduction: Solving ODE-BVP using the Galerkin's Method
FEM Introduction: Solving ODE-BVP using the Galerkin's Method
 
Pg 0018 0086
Pg 0018 0086Pg 0018 0086
Pg 0018 0086
 
Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...
 
Sienna 10 dynamic
Sienna 10 dynamicSienna 10 dynamic
Sienna 10 dynamic
 
IRJET- Intuitionistic Fuzzy Divisor Cordial Graph
IRJET- Intuitionistic Fuzzy Divisor Cordial GraphIRJET- Intuitionistic Fuzzy Divisor Cordial Graph
IRJET- Intuitionistic Fuzzy Divisor Cordial Graph
 
Embedding and np-Complete Problems for 3-Equitable Graphs
Embedding and np-Complete Problems for 3-Equitable GraphsEmbedding and np-Complete Problems for 3-Equitable Graphs
Embedding and np-Complete Problems for 3-Equitable Graphs
 
Geethu final
Geethu finalGeethu final
Geethu final
 
modul 2 add maths
modul 2 add mathsmodul 2 add maths
modul 2 add maths
 
2.2 graphing linear equations
2.2 graphing linear equations2.2 graphing linear equations
2.2 graphing linear equations
 
Chapter 1 functions
Chapter 1  functionsChapter 1  functions
Chapter 1 functions
 
Maths important questions for 2018
Maths important questions for 2018Maths important questions for 2018
Maths important questions for 2018
 
Xi trigonometric functions and identities (t) part 1
Xi trigonometric functions and identities  (t)   part 1 Xi trigonometric functions and identities  (t)   part 1
Xi trigonometric functions and identities (t) part 1
 
10.1.1.92.3502
10.1.1.92.350210.1.1.92.3502
10.1.1.92.3502
 
add maths module 4
add maths module 4add maths module 4
add maths module 4
 
LIMIT FUNGSI - KELOMPOK 3
LIMIT FUNGSI - KELOMPOK 3LIMIT FUNGSI - KELOMPOK 3
LIMIT FUNGSI - KELOMPOK 3
 
Quadratic Equations
Quadratic EquationsQuadratic Equations
Quadratic Equations
 
Implicit differentiation
Implicit differentiationImplicit differentiation
Implicit differentiation
 
Solving Linear Equations
Solving Linear EquationsSolving Linear Equations
Solving Linear Equations
 
Log char
Log charLog char
Log char
 

Similar to Machine hw1

5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!
A Jorge Garcia
 
IIT JEE - 2008 ii- mathematics
IIT JEE  - 2008  ii- mathematicsIIT JEE  - 2008  ii- mathematics
IIT JEE - 2008 ii- mathematics
Vasista Vinuthan
 
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docxMath 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
andreecapon
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
anhlodge
 

Similar to Machine hw1 (20)

sdfsdf
sdfsdfsdfsdf
sdfsdf
 
5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!5HBC: How to Graph Implicit Relations Intro Packet!
5HBC: How to Graph Implicit Relations Intro Packet!
 
Aieee mathematics -2008
Aieee mathematics -2008Aieee mathematics -2008
Aieee mathematics -2008
 
Lecture 07 graphing linear equations
Lecture 07 graphing linear equationsLecture 07 graphing linear equations
Lecture 07 graphing linear equations
 
IIT JEE - 2008 ii- mathematics
IIT JEE  - 2008  ii- mathematicsIIT JEE  - 2008  ii- mathematics
IIT JEE - 2008 ii- mathematics
 
IIT JEE Mathematics 1994
IIT JEE Mathematics   1994IIT JEE Mathematics   1994
IIT JEE Mathematics 1994
 
Class IX Linear Equations in Two Variables
Class IX Linear Equations in Two VariablesClass IX Linear Equations in Two Variables
Class IX Linear Equations in Two Variables
 
Calculus Assignment Help
 Calculus Assignment Help Calculus Assignment Help
Calculus Assignment Help
 
Lego like spheres and tori, enumeration and drawings
Lego like spheres and tori, enumeration and drawingsLego like spheres and tori, enumeration and drawings
Lego like spheres and tori, enumeration and drawings
 
arijit ppt (1) (1).pptx
arijit ppt (1) (1).pptxarijit ppt (1) (1).pptx
arijit ppt (1) (1).pptx
 
Algebraic techniques in combinatorics
Algebraic techniques in combinatoricsAlgebraic techniques in combinatorics
Algebraic techniques in combinatorics
 
Complex%20numbers
Complex%20numbersComplex%20numbers
Complex%20numbers
 
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docxMath 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
Math 235 - Summer 2015Homework 2Due Monday June 8 in cla.docx
 
Aieee mathematics- 2010
Aieee mathematics- 2010Aieee mathematics- 2010
Aieee mathematics- 2010
 
IIT JEE Maths 2000
IIT JEE Maths   2000IIT JEE Maths   2000
IIT JEE Maths 2000
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
Coueete project
Coueete projectCoueete project
Coueete project
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
 
Litv_Denmark_Weak_Supervised_Learning.pdf
Litv_Denmark_Weak_Supervised_Learning.pdfLitv_Denmark_Weak_Supervised_Learning.pdf
Litv_Denmark_Weak_Supervised_Learning.pdf
 

Recently uploaded

Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
gajnagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
SayantanBiswas37
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 

Recently uploaded (20)

Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 

Machine hw1

  • 1. Math 156 Homework1(Cui Yi) ID number:605068398 Math 156 Homework1(Cui Yi) ID number:605068398 Q1. Solution Q2. Solution Q2.1 Q2.2 Q4. Solution Q5. Solution Q6. Solution Q7. Solution Q8. Solution
  • 2. Q1. Compute the gradient J (w ) and show that the equation J (w ) = 0 may be written in the form Aw = b where A is a matrix and b is a vector. Solution Cost function: , Obviously, we can easily Then, using the chain theory, Setting the , then 1°when is invertible , , Remark: Ker(A)={ } 2° Rm: the form ,when is vertible, then
  • 3. Figure 1 Q2. Does the equation J (w ) = 0 always have a solution? If there is a solution is it unique? Explain how these two questions are related to the number of data points N and the degree M of the polynomial model. Solution Q2.1 The equation J (w ) = 0 does not always have a solution. For example, it will meet the problems like over-fitting.(Figure 1) When the M becomes bigger, it will cause the over-fitting problem. At this time, the equation J (w ) = 0 does not always have a solution. Also, it will finally make the inaccuracy in the test set while it may have better performance in the training set. Intuitively, what is happening is that the more flexible polynomials with larger values ofM are becoming increasingly tuned to the random noise on the target values.
  • 4. Figure 2 Figure 3 Q2.2 From the point of RANK, we know rank(Z) , and If ,the solution is not unique. If the solution is unique. In the book, we can easily see the difference of different N(N is the point) We see that increasing the size of the data set reduces the over-fitting problem. But what we should bear in mind is that the larger the data set, the more complex (in other words more flexible) the model that we can afford to fit to the data.
  • 5. Figure 4 Q4. Solution Those twelve points are illustrated on the picture. x=[-pi:0.001:pi]; y=cos(2.*x); plot(x,y); hold on xi=linspace(-pi,pi,12); yi=cos(2.*xi); plot(xi,yi,'r*'); title('Task 4', 'FontSize', 16); ylabel('cos(X)', 'FontSize', 15); xlabel('X', 'FontSize', 15);
  • 6. Q5. Solution The same as Task 1, and , We can easily get the result with two situations. And the final form is 1° 2° , Remark: Ker(A)={ } Here, z , t
  • 7. Figure 5 Q6. Solution is the function that we get from Task 5 X1 = [-3:0.01:3]' ;
  • 8. Figure 6 When M=11 , it may get the best result. X1 = [-pi:(2.*pi)./11:pi]' ;
  • 10. Figure 8 Q8. Solution From the figure,we can easily find that M=6 is th best fitting. Here are two situations where I choose the x data X = rand(12, 1)*2* pi- pi ;
  • 11. Figure 9 Figure 10 When m=11, X = [-pi:(2.*pi)./11:pi]';
  • 12. Figure 11 When m=11, The fitted function has very steep slopes especially in figure 9 and extreme values .