Custom Random Number Generator Essay

Exclusively available on Available only on IvyPanda® Made by Human No AI

Introduction

An integer can be generated randomly using a computer program known as custom random number generator. It generates a random number between two chosen integers. Two integers are keyed in depending on the desired interval (Glosser, 1998). The number is generated in a predictable manner and is pseudo random in nature (Pseudo-random numbers, n.d.). The generated random number is 3.

Starting with the 3rd piece of data, systematic sampling was used and the subset of data selected is shown in table 1 below.

Age_ Unsuccessful ApplicantsAge_ Successful Applicants
3734
4239
4442
4535
4938
5445
5639
3448
3941
4333
4536
4638
5342
5435
5738
3741
4147
4448
4539
4833
3736
5538
3739
3744
4435
4445
4939
4948
3651
4133
3036
2938
3939

Table 1: Systematically sampled subsets of data.

Systematic sampling involves choosing a starting number at random and thereafter at regular intervals determined from the generated random integer. The samples are 100 dividing by the random integer 3 gives 33.3, so every third applicant is chosen starting from the 3rd applicant. Therefore, the subset data generated is of 33 applicants.

Mean, median, mode calculations

Determining mean, median and mode

The summation of the two data sets is obtained

For unsuccessful applicants, ∑ = 1440

Mean = total age of applicants/Total number of applicants

= 1440/33 =43.64 yrs

For successful applicants, ∑=1312

Mean=1312/33 =39.75yrs

The median is the middle number of the data set. Arranging in ascending order, the median is found.

For unsuccessful applicants, median =44 yrs

For successful applicants, median=39 yrs

The mode is the number occurring most often in the data set.

For unsuccessful applicants, mode=37yrs

For successful applicants, mode=39yrs

Determining range and standard deviation

The variance =∑(xi-x’)^2/n where xi is the ith element in the data set, x’ is the mean and n is the total number of the data.

For unsuccessful applicants

Age Unsuccessful Applicantsxi-x’(xi-x’)^2
29-14.63636364214.2231405
30-13.63636364185.9504132
34-9.63636363692.85950413
36-7.63636363658.31404959
37-6.63636363644.04132231
37-6.63636363644.04132231
37-6.63636363644.04132231
37-6.63636363644.04132231
37-6.63636363644.04132231
39-4.63636363621.49586777
39-4.63636363621.49586777
41-2.6363636366.950413223
41-2.6363636366.950413223
42-1.6363636362.67768595
43-0.6363636360.404958678
440.3636363640.132231405
440.3636363640.132231405
440.3636363640.132231405
440.3636363640.132231405
451.3636363641.859504132
451.3636363641.859504132
451.3636363641.859504132
462.3636363645.58677686
484.36363636419.04132231
495.36363636428.76859504
495.36363636428.76859504
495.36363636428.76859504
539.36363636487.67768595
5410.36363636107.4049587
5410.36363636107.4049587
5511.36363636129.1322314
5612.36363636152.8595041
5713.36363636178.5867769
∑=1440∑=1711.636364
Mean x’=43.63636364

Table 2: Variance table for unsuccessful data subset.

Variance =1711.636364/33 =51.867

Population Standard deviation σ=√variance =√51.867 =7.20

The sample standard deviation S=√(X-X’)/n-1

S=√1711.6363/32=7.31359

The range is the difference between the lowest and highest values in a data set. For unsuccessful applicants, the range=57-29=28yrs.

Successful applicants

Age Successful Applicantsxi-x’(xi-x’)^2
34-5.75757575833.1496786
33-6.75757575845.66483012
33-6.75757575845.66483012
33-6.75757575845.66483012
35-4.75757575822.63452709
35-4.75757575822.63452709
35-4.75757575822.63452709
36-3.75757575814.11937557
36-3.75757575814.11937557
36-3.75757575814.11937557
38-1.7575757583.089072544
38-1.7575757583.089072544
38-1.7575757583.089072544
38-1.7575757583.089072544
38-1.7575757583.089072544
39-0.7575757580.573921028
39-0.7575757580.573921028
39-0.7575757580.573921028
39-0.7575757580.573921028
39-0.7575757580.573921028
39-0.7575757580.573921028
411.2424242421.543617998
411.2424242421.543617998
422.2424242425.028466483
422.2424242425.028466483
444.24242424217.99816345
455.24242424227.48301194
455.24242424227.48301194
477.24242424252.45270891
488.24242424267.93755739
488.24242424267.93755739
488.24242424267.93755739
5111.24242424126.3921028
∑=1312∑=768.0606061
Mean x’=39.75757576

Table 3: Variance table for successful data subset.

Variance =768.0606061/33=23.274

Population standard deviation=√23.274 = 4.824

The sample standard deviation S=√(X-X’)/n-1

S=√768.0606/32=4.8991

Range=51-33=18yrs

Results table

Unsuccessful applicantsSuccessful applicants
Mean43.6439.75
Median4439
Mode3739
Range2818
Standard deviation7.313594.8991

Table 4: Results table.

The two sets of data have their mean, median and mode centered around 37-44yrs. We have many older applicants in the unsuccessful group as compared to the successful group. This can be seen from the wide range obtained (28yrs) and the mean age of 43.64. The ages for the unsuccessful group deviate from the mean by a very wide margin of 7.31359. The successful group is mostly centered around 39yrs with less deviation 4.8991 from the mean.

Graphical representations

Histogram representations

Histogram illustrating the distribution of unsuccessful applicants.
Figure 1: Histogram illustrating the distribution of unsuccessful applicants.
Figure 2: Histogram illustrating the distribution of successful applicants.
Figure 2: Histogram illustrating the distribution of successful applicants.
Histogram showing median and bell shaped distribution of unsuccessful applicants.
Figure 3: Histogram showing median and bell shaped distribution of unsuccessful applicants.

The median is 44, mode =37 and mean is 43.64.

Histogram showing median and bell shaped distribution of successful applicants.
Figure 4: Histogram showing median and bell shaped distribution of successful applicants.

The median is 39, mode =39 and mean is 39.75.

Constructing box plots

Unsuccessful applicants

Box plot for unsuccessful applicants.
Figure 5: Box plot for unsuccessful applicants.

Maximum value=57yrs;

Minimum value=29yrs;

Median=44;

1st quartile=37;

3rd quartile=49;

Inter quartile range=49-37=12;

Upper fence for outliers=3rd quartile+1.5IQR= 49+ (1.5*12) =67;

Lower fence for outliers=1st quartile-1.5IQR=37-(1.5*12) =19;

Therefore, there are no outliers.

Successful applicants

Box and whisker plot for successful applicants.
Figure 6: Box and whisker plot for successful applicants.

Minimum value=33;

Maximum value=51;

1st quartile=36;

Median=39;

3rd quartile=42;

Inter quartile range=42-36=6;

Upper fence for outliers=3rd quartile+1.5IQR= 42+(1.5*6)=51;

Lower fence for outliers=1st quartile-1.5IQR=36-(1.5*6) =27;

The data value 51 is on the border. Therefore, there is no outlier.

Histograms and box plots help in showing the distribution of the data sets. The histogram for unsuccessful applicants shows a normal evenly distributed population (bell shaped) on both sides. This implies the age of the unsuccessful applicants is balanced about the central point (median). The histogram for successful applicants is skewed towards the right. This implies that the age of successful applicants is unbalanced about the central point (median = 39) but its distribution is near a normal distribution. The box plot for unsuccessful applicants shows an even distribution of the whiskers meaning its population is evenly distributed while that for successful applicants is uneven. The lower and upper quartiles have 25% of lower and upper values respectively.

Formulation of hypotheses

The hypotheses will test whether the means are different. The hypothesized mean is 40 yrs. The null hypothesis will determine whether the sample means of both samples are equal, unsuccessful applicants mean μ1=successful applicants means μ2, such that the means of the two groups are not significantly different.

  • Null hypothesis Ho: μ1=μ2
  • Alternate hypothesis H1: μ1≠μ2 (two tailed test)

The alpha level represents the significance level of the hypothesis. It gives the probability of rejecting the null hypothesis when it is true (type 1 error), that is, it is the probability of concluding that the research hypothesis is true when the null hypothesis is true. When the p-value is less than 0.025 for a two tailed test, the null hypothesis is rejected.

The z statistic will be used for hypothesis testing. The population size is large at 33 (n˃30) and the population standard deviations are known.

The z statistic is

z statistic

where x bar is the sample mean of unsuccessful and successful applicants, σ is the standard deviation and n is the sample size.

The Z value is given as Z=43.64-39.75/√(7.313592/33+4.89912/33)=1.6566.

The shaded region below is the rejection region R.

Rejection region R: Z˃1.96 and z<1.96

Sketch of the critical region in hypothesis testing.
Figure 7: Sketch of the critical region in hypothesis testing.

Since 1.6566 <1.96, we accept the null hypothesis. This means the means of the unsuccessful and successful groups are not significantly different.

The null hypothesis is not rejected. This implies that the means of the two groups is not significantly different. The mean age of the unsuccessful applicants is 43.64 while for successful applicants is 39.75.

Confidence intervals

Margin of error

Margin of error m= mean ± standard deviation

For unsuccessful group, margin of error m= 43.63±7.31359

M=36.31 to 50.94

For successful applicants, the margin of error is M=39.75±4.8991=34.85 to 44.64

At 90% confidence level, the critical value is 1.64 which is calculated from (1-0.9)/2=0.05 and looking it up the z value from the table.

Illustration of confidence intervals.
Figure 8: Illustration of confidence intervals.

Desired confidence interval

The difference of means x1-x2=43.64-39.75=3.89

Standard error of the difference=√(σ12/n1+σ22/n2)=√(7.3132/33+4.89912/33)=1.5313

CI=X1-X2±1.64*1.531.

CI=3.89±2.51=1.38 to 6.4.

Confidence intervals are signs of estimates reliability. The two data samples have been sampled from a larger group of data. The confidence interval shows how frequently a particular unknown parameter is included in an observed interval.

Conclusion

From the graphical representations and after hypothesis testing, it was found that the mean age for unsuccessful applicants was 43.64 yrs while that for successful applicants was 39.75. The margin of error for both data sets is small. The confidence interval for the group is 1.38 to 6.4. This means that the sampled population is highly reliable in giving the correct results. The histograms and box plots portray a near normal bell shaped distribution. It can be safely concluded that there is no discrimination in the selection. Since sampling was done, it is assumed that the whole population will present an almost equal result or improve on the result hence the hiring process can be retained.

References

Glosser, M. G. (1998). Custom random number generator. Web.

Pseudo-random numbers, (n.d.). Web.

More related papers Related Essay Examples
Cite This paper
You're welcome to use this sample in your assignment. Be sure to cite it correctly

Reference

IvyPanda. (2021, January 13). Custom Random Number Generator. https://ivypanda.com/essays/custom-random-number-generator/

Work Cited

"Custom Random Number Generator." IvyPanda, 13 Jan. 2021, ivypanda.com/essays/custom-random-number-generator/.

References

IvyPanda. (2021) 'Custom Random Number Generator'. 13 January.

References

IvyPanda. 2021. "Custom Random Number Generator." January 13, 2021. https://ivypanda.com/essays/custom-random-number-generator/.

1. IvyPanda. "Custom Random Number Generator." January 13, 2021. https://ivypanda.com/essays/custom-random-number-generator/.


Bibliography


IvyPanda. "Custom Random Number Generator." January 13, 2021. https://ivypanda.com/essays/custom-random-number-generator/.

If, for any reason, you believe that this content should not be published on our website, please request its removal.
Updated:
This academic paper example has been carefully picked, checked and refined by our editorial team.
No AI was involved: only quilified experts contributed.
You are free to use it for the following purposes:
  • To find inspiration for your paper and overcome writer’s block
  • As a source of information (ensure proper referencing)
  • As a template for you assignment
1 / 1