C++ Programming Assignment

Completado Publicado Mar 7, 2012 Pagado a la entrega
Completado Pagado a la entrega

Background

This exercise is on programming of some statistical functions. No preliminary knowledge of

statistics is required. All necessary concepts are explained in this section.

Standard deviation

Standard deviation is a popular measure of variability or diversity of data used in statistics.

If we have some set of data, each data point being a real or rational number (e.g. hight of

a person expressed in cm), then low standard deviation indicates that the data points tend

to be very close to the mean value, while high standard deviation indicates that the data

points are spread over a large range of values, far away from the mean value.

The standard deviation1 is defined as follows.

For a set of data points X = {x1, x2, . . . , xn} its mean value is mean(X) = x1+x2+...+xn

n .

Then the standard deviation of X is the value

X =

s

(x1 − mean(X))2 + (x2 − mean(X))2 + . . . + (xn − mean(X))2

n

.

Pearson correlation coefficient

Assume now that we have two data sets of equal size X = {x1, . . . , xn} and X = {y1, . . . yn}

and we would like to find out if there is some correlation between the values xi and yi. For

example, if xi and yi represent the height and the weight of a person, respectively, then,

perhaps, there is some correlation. On the other hand, if xi and yi represent the height of a

person and his/her performance in COMP528, then I doubt that there is a correlation.

There are different ways to measure the correlation between two data sets. Perhaps, the

most popular is a Pearson correlation coefficient, which is defined as follows.

For two data sets X = {x1, . . . , xn} and Y = {y1, . . . , yn}, their Pearson coefficient

X,Y =

1

ni=n

i=1 (xi − mean(X)) · (yi − mean(Y ))

X · Y

where X and Y are standard deviations of X and Y , respectively, as defined above. The

Pearson correlation coefficient always has the value in between −1 and 1. The closer it to 1

the more indication of the correlation between data values2.

If you would like to learn more on the standard deviation and Pearson correlation, the

Wikipedia entries are good starting points.

1we use here so called population standard deviation, there are other versions, which are not of our

concern

2notice that Pearson correlation coefficient captures only one type of the correlation that is a linear

dependence

2

Computing the Pearson correlation coefficient

asks you to write a program computing Pearson correlation coefficient using

parallel loop templates from Intel Threading Building Blocks library (TBB).

The input data are given in two arrays a and b of values of type double. The length of each

array is 100000. You need to write a C++ program which

• implements a serial (not using parallelism) algorithm for computing Pearson correlation

coefficient of data presented in arrays a and b;

• implements a parallel algorithm using parallel loop templates from TBB library for

computing the same;

• for a given data computes the Pearson correlation by both serial and parallel algorithm;

• prints out the results of both algorithms and the acceleration achieved by paralleliza-

tion;

The program speed will be evaluated using particular initialization of the arrays by the values

of the trigonometric functions sine and cosine applied to the indexes, that is a[i] = sin(i)

and b[i] = cosin(i).

Programación en C Programación en C++

Nº del proyecto: #1491013

Sobre el proyecto

12 propuestas Proyecto remoto Activo Mar 9, 2012

Adjudicado a:

procoder898

Hi, I am expert at C++ and statistics, can surely satisfy you. Please check your inbox,

$39 USD en 0 días
(29 comentarios)
5.0

12 freelancers están ofertando un promedio de $35 por este trabajo

it2051229

Hi, kindly check your inbox for my inquiries. Thanks.

$30 USD en 0 días
(750 comentarios)
7.3
dobreiiita

Hi, I am confident to handle this project. Thanks

$30 USD en 1 día
(223 comentarios)
6.7
pkcoder

Hi sir. i am a qualified programmer. i can do this job. kindly check pmb. thank you

$30 USD en 0 días
(30 comentarios)
4.7
Algotrade

Please see PMB

$45 USD en 3 días
(18 comentarios)
4.3
rakib062

Hi, I am a graduate in CS. I have done lots of similar projects both in academic courses and freelancer.com. I have implemented statistical analysis in programming exercise. I assure you of simple,clean,efficient code Más

$35 USD en 0 días
(26 comentarios)
4.6
nerobot

If you take my bid, you can be confident that I will deliver the project code in a well commented and useful format. I have over 8 years in programming in C++, in mathematical, engineering, and physics projects.

$35 USD en 1 día
(0 comentarios)
0.0
kozla13

I have Masters degree in Electrical engineering and i know this stuff

$30 USD en 2 días
(0 comentarios)
0.0
prasenjit18

i can do this.

$30 USD en 4 días
(0 comentarios)
0.0
smalllogic

I can program for these calculations.

$40 USD en 3 días
(0 comentarios)
0.0
pLeAsEWaiT

Hi, please check pm

$30 USD en 1 día
(0 comentarios)
0.0