Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Standard Deviation using Array

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Standard Deviation using Array

    Hi all, I am new to JAVA. So, can you kindly help me with a Program?

    # I want to write a program to calculate Standard Deviation using Array in simple way.... Please help


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Standard Deviation using Array

    Hi and welcome to the forum.
    You should have read the sticky at the top of the forum titled "This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING)", and the announcements page containing other important forum information.

    Thread moved from member introductions.

  3. #3
    Member
    Join Date
    Jun 2012
    Location
    Left Coast, USA
    Posts
    451
    My Mood
    Mellow
    Thanks
    1
    Thanked 97 Times in 88 Posts

    Default Re: Standard Deviation using Array

    Quote Originally Posted by JavaFreakSam View Post
    ... calculate Standard Deviation using Array in simple way.... Please help
    How would you calculate the Standard Deviation of the values by "hand"?

    Forget Java for a moment. Get a pencil and some paper.

    Suppose I have three numbers: 1.0, 2.0, 3.0

    What is the Standard Deviation of that set of numbers? Calculate it "by hand." I picked a small set of numbers with values that might even let you do the calculation without a calculator. It should only take a minute or two.

    Now, back to Java. I want to make a program that handles numbers in an array of any size, but for starters, assume that we have an array, x, of doubles whose values are

    x[0] = 1.0
    x[1] = 2.0
    x[2] = 3.0

    Write a Java loop that performs the same calculations that you did with pencil and paper. It can be done with one loop, but depending on your approach to the problem, you might even need two loops. The important thing is to make the program go through exactly the same sequence of operations that you did by hand. Then incorporate that loop into a Java main() function.

    If you don't know how to do it with pencil and paper, find a reference (class notes or textbook or Standard Deviation - wikipedia or whatever...) Then do it with pencil and paper.

    If you don't see the connection between pencil and paper and java, then post again.

    But, when you post again:

    1. Show the work that you did on the three numbers when you performed the pencil-and-paper calculations.

    2. Show what you tried in Java.

    3. Tell us exactly what you don't understand about how to get the answer.


    Cheers!

    Z
    Last edited by Zaphod_b; October 11th, 2012 at 02:38 PM.

Similar Threads

  1. Help with variance and standard deviation
    By alexpayne5657 in forum Algorithms & Recursion
    Replies: 3
    Last Post: November 30th, 2011, 12:29 PM
  2. Need help with my standard deviation code.
    By drew.field in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 16th, 2011, 03:01 PM
  3. Replies: 7
    Last Post: November 23rd, 2010, 10:03 PM
  4. STANDARD CALCULATOR
    By asdfg in forum What's Wrong With My Code?
    Replies: 5
    Last Post: August 27th, 2010, 08:41 PM
  5. How to capture standard output from another program ?
    By ni4ni in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: March 3rd, 2010, 10:00 AM