Results 1 to 5 of 5

Thread: How to find middle number? -edit

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Where you live
    Posts
    104

    How to find middle number? -edit

    Hey, for my project, I need to make a line of best fit, and to do that I am going to need to take the 5 sets of coordinates and find the middle number. For example,

    X | Y

    1 10
    2 8
    3 4
    4 6
    5 1

    What i mean by middle number would be: for X it would be 3 and for Y it would be 6. (EDITED TO MAKE IT MORE CLEAR) IS there a mathematics formula I could use? Or a piece of coding that would determine this for me? Thanks.
    P.S - Yes I know that "Middle Number" isnt correct terminology, I just cant think of the correct term right now
    Last edited by Inno; Sep 25th, 2002 at 04:32 PM.

  2. #2
    Addicted Member Martin Wilson's Avatar
    Join Date
    Mar 2002
    Location
    :)
    Posts
    236
    The Median is what you want. Of the top of my head you would need to sort them and then the middle value would be the one you want.
    What is the answer to this question?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Where you live
    Posts
    104
    Yes! Median!
    Ok, sort them...should i use a < or > If statement for all of them to put them in order? (remember im a newb)

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Originally posted by Guv
    Least squares fit equations are as follows.
    Code:
    Sum(Yi) = b*n + m*Sum(Xi)
    Sum(Xi*Yi) = b*Sum(Xi) + m*Sum(Xi2)
    Solve the above for m & b.

    n is the number of data points, and the sums are for i = 1 to n.
    Page down for "Line of best fit"

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Where you live
    Posts
    104

    Download Grapher!

    Thanks for the help guys, Ive finished my final product that im handing in! It works, though it is not an exact line of best fit, it represents one, which is what the lab required! Have a look!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width