Question
C PROGRAM PLZ GIVE SAME OUTPUT DONOT GIVE IRRELEVANT OUTPUT 1 - Variance calculation with dynamic arrays Description: In probability theory and statistics, variance measures
C PROGRAM PLZ GIVE SAME OUTPUT DONOT GIVE IRRELEVANT OUTPUT
1 - Variance calculation with dynamic arrays
Description:
In probability theory and statistics, variance measures how far a set of numbers is spread out. A variance of zero indicates that all the values are identical. Variance is always non-negative: a small variance indicates that the data points tend to be very close to the mean (expected value) and hence to each other, while a high variance indicates that the data points are very spread out around the mean and from each other.
Example: x(input) D = X - Mean D2 9 -11 121 12 -8 64 15 -5 25 18 -2 4 20 0 0 22 2 4 23 3 9 24 4 16 26 6 36 31 11 121 Sum = 200 Sum = 400 Mean = (sum of x) / size where : size = Number of items in the input Formula to calculate the variance: sigma = (sum of D2 ) / size
Pr-requisites:-
Functions
Pointers
DMA
Objective: -
To understand the concept of
Functions and Pointers
Dynamic Memory Allocation
Inputs: - Array of N Integers, N
Sample execution: - Test Case 1: Enter the no.of elements : 10
Enter the 10 elements: [0] -> 9 [1] -> 12 [2] -> 15 [3] -> 18 [4] -> 20 [5] -> 22 [6] -> 23 [7] -> 24 [8] -> 26 [9] -> 31 Variance is 40.000000
REQUESTED FILE
#include
float variance(int *, int);
int main() { }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started