LFD Book Forum *ANSWER* Stuck on #4
 User Name Remember Me? Password
 FAQ Calendar Mark Forums Read

 Thread Tools Display Modes
#11
04-29-2013, 10:05 AM
 jcmorales1564 Member Join Date: Apr 2013 Posts: 12
Re: *ANSWER* Stuck on #4

Quote:
 Originally Posted by yaser Your answer should agree with the given answer to two-decimal-digit accuracy as stated in the problem, or else be considered "none of the above."
Thank you, professor. I responded a few minutes ago, apparently just at the same time that you did. I had not seen your reply.

Juan
#12
04-30-2013, 09:27 AM
 Elroch Invited Guest Join Date: Mar 2013 Posts: 143
Re: *ANSWER* Stuck on #4

One absurdly simple way to get a handle on the plausibility of the result all of us doubted is to see what the range of possible slopes is, and guess it might be near the middle.

Observe that if two points are very near the origin, the slope can be but no higher. If they are at the furthest extremes, the slope can be zero, but no lower. The mean of this range of possible slopes is 1.57.
#13
09-09-2013, 09:53 PM
 GB449 Member Join Date: Aug 2013 Posts: 20
Re: *ANSWER* Stuck on #4

Quote:
 Originally Posted by IsidroHidalgo I think you have a typo, is'n it? For me
I have simulated 100K points using this formula for slope and taken the average. I have run this a number of times but each time I get a different slope all of which are small numbers like +/- 0.00X

The random points (x1, y1) and (x2, y2) I generated are all between -1 and 1. Is the slope I am getting small because the random numbers are between -1 and 1? After all, I am dividing by 100K.

Here's the code
double slope = ((x1*y1) + (x2*y2)) / ((x1*x1) + (x2*x2));

I sum the slopes for each point and compute average
AverageSlope = SumSlope / (double) NoOfPoints;

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General     General Discussion of Machine Learning     Free Additional Material         Dynamic e-Chapters         Dynamic e-Appendices Course Discussions     Online LFD course         General comments on the course         Homework 1         Homework 2         Homework 3         Homework 4         Homework 5         Homework 6         Homework 7         Homework 8         The Final         Create New Homework Problems Book Feedback - Learning From Data     General comments on the book     Chapter 1 - The Learning Problem     Chapter 2 - Training versus Testing     Chapter 3 - The Linear Model     Chapter 4 - Overfitting     Chapter 5 - Three Learning Principles     e-Chapter 6 - Similarity Based Methods     e-Chapter 7 - Neural Networks     e-Chapter 8 - Support Vector Machines     e-Chapter 9 - Learning Aides     Appendix and Notation     e-Appendices

All times are GMT -7. The time now is 12:08 AM.

 Contact Us - LFD Book - Top