I. Some Basics on Line Fitting Suppose that there is a set P of n points...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
I. Some Basics on Line Fitting Suppose that there is a set P of n points in the two-dimensional plane, denoted by (x1, y1), (2, 92),, (In, Yn), and suppose x < x < 35 30 25 that minimizes the cost function 20 15 10 5 50 40 30 20 10 2.5 4 6 Fig. 2. Two lines that fit 12 points. 12 Input: We have the following inputs: 1) A set of n points in a 2-dimensional plane 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Fig. 3. Three lines that fit 18 points. problem is essentially a "modeling" problem: we want to model a set of "observed points" using a simple yet accurate model, and in this case, the model is a set of lines, each for a different interval of x. If too many lines are used, the model would not be "simple" any more. Thus, intuitively, we would like a problem formulation that requires us to fit the points well, using as few lines as possible. Let's formulate our problem, which we shall call the "Multi-Line Fitting Problem": 14 P = {(1, ), (x2, y2), , (n. Yn)} with 1 < x2 < 0. Output: A partition of the points P into k segments: P = {P, P2, Pm} P2 {Pm+1, Pm+2, P3 = {Pm2 +1:Pm2+2, Pm} Pms} E Pk = {Pmk 1+1, Pm-1+2, Pm = Pn} cost(P, C) = (P) + E(P) + + (Pk) + Ck. In the cost function cost(P, C), the part (P) + (P) + +(P) is the total error of using k lines to fit the n points, and Ck is the penalty for using k lines (namely, for partitioning the n points into k segments). The greater k is, the greater the penalty term Ck is. Note that the value of k, as well as the turning points Pm Pm," are what an algorithm solving the problem needs to decide on. 5 Pm-1 III. What to Submit In this project, you need to submit three items: (1) an algorithm report, (2) a program that implements your algorithm, (3) output of your program on test instances. 3) The proof of correctness for your algorithm. 4) the analysis of time complexity for your algorithm. A. Submission Item One: An Algorithm Report First, you are to design an efficient algorithm for the "Multi-Line Fitting Problem", and submit it as a report. The report is just like what we usually do for algorithm design in a homework, and should have the four elements as usual: 1) The main idea of your algorithm. 2) The pseudo code of your algorithm. B. Submission Item Two: A Program That Implements Your Algorithm You need to implement your algorithm using a commonly used programming language, such as Python, C++, Java, etc. We encourage you to use Python if possible, but other languages are fine, too. Your program will take a list of instances of the "Multi-Line Fitting Problem" as input, and return a list of solutions (corresponding to those instances) as its output. To test your program, we will provide you with input instances as a "dictionary" in Python (after you have submitted the program), and ask you to submit the output solutions as a "dictionary" in Python. (Details on the two files, including their formats, will be explained in the next subsection for "Submission Item Three".) When you submit your program, you need to explain clearly how to run your code. If your programming language is not Python, then you also need to include an explanation on how you turned the provided "dictionary" of "input instances" in Python to your programming language, and how you turned your "output solutions" in your programming language to a "dictionary" in Python (following the formats specified in the next subsection). I. Some Basics on Line Fitting Suppose that there is a set P of n points in the two-dimensional plane, denoted by (x1, y1), (2, 92),, (In, Yn), and suppose x < x < 35 30 25 that minimizes the cost function 20 15 10 5 50 40 30 20 10 2.5 4 6 Fig. 2. Two lines that fit 12 points. 12 Input: We have the following inputs: 1) A set of n points in a 2-dimensional plane 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Fig. 3. Three lines that fit 18 points. problem is essentially a "modeling" problem: we want to model a set of "observed points" using a simple yet accurate model, and in this case, the model is a set of lines, each for a different interval of x. If too many lines are used, the model would not be "simple" any more. Thus, intuitively, we would like a problem formulation that requires us to fit the points well, using as few lines as possible. Let's formulate our problem, which we shall call the "Multi-Line Fitting Problem": 14 P = {(1, ), (x2, y2), , (n. Yn)} with 1 < x2 < 0. Output: A partition of the points P into k segments: P = {P, P2, Pm} P2 {Pm+1, Pm+2, P3 = {Pm2 +1:Pm2+2, Pm} Pms} E Pk = {Pmk 1+1, Pm-1+2, Pm = Pn} cost(P, C) = (P) + E(P) + + (Pk) + Ck. In the cost function cost(P, C), the part (P) + (P) + +(P) is the total error of using k lines to fit the n points, and Ck is the penalty for using k lines (namely, for partitioning the n points into k segments). The greater k is, the greater the penalty term Ck is. Note that the value of k, as well as the turning points Pm Pm," are what an algorithm solving the problem needs to decide on. 5 Pm-1 III. What to Submit In this project, you need to submit three items: (1) an algorithm report, (2) a program that implements your algorithm, (3) output of your program on test instances. 3) The proof of correctness for your algorithm. 4) the analysis of time complexity for your algorithm. A. Submission Item One: An Algorithm Report First, you are to design an efficient algorithm for the "Multi-Line Fitting Problem", and submit it as a report. The report is just like what we usually do for algorithm design in a homework, and should have the four elements as usual: 1) The main idea of your algorithm. 2) The pseudo code of your algorithm. B. Submission Item Two: A Program That Implements Your Algorithm You need to implement your algorithm using a commonly used programming language, such as Python, C++, Java, etc. We encourage you to use Python if possible, but other languages are fine, too. Your program will take a list of instances of the "Multi-Line Fitting Problem" as input, and return a list of solutions (corresponding to those instances) as its output. To test your program, we will provide you with input instances as a "dictionary" in Python (after you have submitted the program), and ask you to submit the output solutions as a "dictionary" in Python. (Details on the two files, including their formats, will be explained in the next subsection for "Submission Item Three".) When you submit your program, you need to explain clearly how to run your code. If your programming language is not Python, then you also need to include an explanation on how you turned the provided "dictionary" of "input instances" in Python to your programming language, and how you turned your "output solutions" in your programming language to a "dictionary" in Python (following the formats specified in the next subsection).
Expert Answer:
Answer rating: 100% (QA)
Solutions Step 1 The given question is I Some Basics on Line Fitting Suppose that there is a set P of n points in the twodimensional plane denoted by x1 y1x2 y2 xn ynand suppose x1 x 2 0 Output A part... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
In Problems 1932, find the distance d between the points P 1 and P 2 . 2FP2 = (2, 1) P1 = (0,0) -2 -1 2 x X
-
For the following exercises, use the fundamental identities to fully simplify the expression. 1 - cos x tan x + 2 sin x
-
For the lines in exercises which of the following is closest to the slope of the line? (a) 1 (b) 2 (c) 3 (d) 21 (e) 22 (f) - 3 2 2 X
-
Featherstone Inc. reported the following data: Net income ................................... $296,000 Depreciation expense ................... 113,100 Gain on disposal of equipment ...... 58,500...
-
Sixteen stations, numbered 1 through 16, are contending for the use of a shared channel by using the adaptive tree walk protocol. If all the stations whose addresses are prime numbers suddenly become...
-
Arrange the functions n, 1000 log n, n log n, 2n!, 2n, 3n, and n2 / 1,000,000 in a list so that each function is big-O of the next function.
-
A laminated plate consisting of the [90/0/90] \(]_{\mathrm{s}} \mathrm{AS} / 3501\) laminate described in Example 7.13 has a central hole, as shown in Figure 9.28. The plate is loaded uniaxially...
-
McNeil Company, a medium-sized manufacturer of microwave ovens, has been an audit client for the past five years. McNeil Co. has been steadily growing and recently hired a new CEO who has decided to...
-
2. In Figure 2, describe how the distortion of parts can occur after fusion welding. (20 point) Neutral axis Weld Fig. 2. Distortion of parts after welding.
-
Frank Thompson operates a small business that manufactures oversized backyard games. He runs the business as a sole proprietorship. The company uses a job order cost system using a first-in,...
-
What are some interesting and useful information and ideas that you can learn in theories of personalities? How will you employ what you have learned to promote your academic progress?
-
Preaching to coworkers their beliefs in Christianity and why other coworkers should go to church and Bible study. Your employee is an associate Pastor at his church and tries to recruit new members...
-
Describe a business that employs a focus strategy as their competitive model? Why is it important to conduct due diligence when researching supplier markets? What are the implications of a...
-
Mark received an excellent interest rate for her loan of $9,500. Calculate the nominal interest rate compounded semi-annually if the loan accumulated to $10,071.01 in 6 years and 6 months. % Round to...
-
You are employed as a Production Manager in an engineering plant that your company has just acquired in North County Dublin. Your staff will be local workers and your primary goal is to increase...
-
Add player class to the project. - Add public data: int numPlayers - Instantiate in main and test. Add a print statement Add seLinkList class to the project. - This class should be a Single Linked...
-
A 230 V d.c. shunt motor with constant field drives a load whose torque is proportional to the speed. When running at 750 rpm it takes 30 A. Find the speed at which it will run if a 10 ohm resistance...
-
Test your confidence in the following Project Decisions: SI. # Question 01 02 03 04 05 06 07 08 09 10 How many years did it take to construct the largest Egyptian Pyramid- Pyramid of Cheops? When was...
-
Leslie and Leon Lazo are married and file a joint return for 2012. Leslie's Social Security number is 466-47-3311 and Leon's is 467-74-4451. They live at 143 Snapdragon Drive, Reno, NV 82102. For...
-
Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....
-
In 2012, Lou has a salary of $54,000 from her job. She also has interest income of $1,700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a...
-
Dunkirk Consulting wishes to predict the amount of overhead expense that will be incurred by a consulting contract, to develop more accurate bids for future con- tracts. Dunkirk has the following...
-
Block Commodities has gathered the following information concerning rock salt deliveries to its clients, which it believes are highly seasonal: a. Suppose Block Commodities calculated a set of...
-
The service center at a large automobile dealership is trying to boost revenue by pro- viding no-appointment-necessary oil changes to any type of vehicle that stops by the service center. To quickly...
Study smarter with the SolutionInn App