Assignment
Assignment
Q2) Identify the Data types, which were among the following
Nominal, Ordinal, Interval, Ratio.
Data Data Type
Gender Nominal
High School Class Ranking Ordinal
Celsius Temperature Interval
Weight Ratio
Hair Color Nominal
Socioeconomic Status Ordinal
Fahrenheit Temperature Interval
Height Ratio
Type of living accommodation Nominal
Level of Agreement Ordinal
IQ(Intelligence Scale) Interval
Sales Figures Ratio
Blood Group Nominal
Time Of Day Interval
Time on a Clock with Hands Interval
Number of Children Ratio
Religious Preference Nominal
Barometer Pressure Interval
SAT Scores Interval
Years of Education Ratio
Q3) Three Coins are tossed, find the probability that two heads and one tail are
obtained?
n(S) = {(HHH),(HHT),(HTH),(THH),(TTH),(HTT),(THT),(TTT)}
n(two heads and one tail) = 3
p(two heads and one tail) = 3/8
Q4) Two Dice are rolled, find the probability that sum is
a) Equal to 1
b) Less than or equal to 4
c) Sum is divisible by 2 and 3
Possible outcomes = {(1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (2,1) (2,2) (2,3) (2,4) (2,5)
(2,6) (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) (5,1) (5,2)
(5,3) (5,4) (5,5) (5,6) (6,1) (6,2) (6,3) (6,4) (6,5) (6,6) }
n(S) = Total number of events = 36
a) n(A) = 0
Hence p(A) = 0
b) n(A) = 7
p(A) = n(A)/n(S)
= 7/36
c) n(A) = 6
p(A) = n(A)/n(S)
= 6/36
= 1/6
Q5) A bag contains 2 red, 3 green and 2 blue balls. Two balls are drawn at
random. What is the probability that none of the balls drawn is blue?
Q6) Calculate the Expected number of candies for a randomly selected child
Below are the probabilities of count of candies for children (ignoring the nature of
the child-Generalized view)
CHILD Candies count Probability
A 1 0.015
B 4 0.20
C 3 0.65
D 5 0.005
E 6 0.01
F 2 0.120
Child A – probability of having 1 candy = 0.015.
Child B – probability of having 4 candies = 0.20
Ans =
Expected value = ∑ p(Xi) * Xi
= (0.015*1) + (0.20 * 4) + (0.65 * 3) + (0.005 * 5) + (0.01 * 6) +
(0.120 * 2)
= 3.09
The expected number of candies for randomly selected child is 3.09
Q7) Calculate Mean, Median, Mode, Variance, Standard Deviation, Range &
comment about the values / draw inferences, for the given dataset
- For Points,Score,Weigh>
Find Mean, Median, Mode, Variance, Standard Deviation, and Range
and also Comment about the values/ Draw some inferences.
Ans: Mean = sum of values/ total number of values
Median = if n is odd, n+1/2 th term
If n is even , (n/2)+((n/2)+1)/2 th term
Mode = Value that appeared most in the dataset or which have high frequency
Variance = 1/(n-1) * ∑ (xi – x)2
Where xi = each data point
x = mean
n = number of records
Standard Deviation = square root of variance
Range = Maximum Value – Minimum Value
Points
Mean = 3.596
Median = 3.695
Mode = 3.07 and 3.92
Variance = 0.2809
Score
Mean = 3.596
Median = 3.3
Mode = 3.440
Variance = 0.9604
Q9) Calculate Skewness, Kurtosis & draw inferences on the following data
Cars speed and distance
Use Q9_a.csv
Ans: Skewness
Speed: The distribution of data for this column is approximately symmetric
as it is lying between (-0.5,0.5)
Distance: The distribution of data for this column is moderately skewed
Kurtosis
In both the cases of speed and distance, kurtosis is smaller than 3. This
means that the datasets have lighter tails than the normal distribution
and can be considered to have a negative kurtosis. In this case, there will
be no chances of presence of outliers.
SP and Weight(WT)
Use Q9_b.csv
Ans:10.a
Ans 11:
For 94% = (134.85077199775026, 265.14922800224974)
For 98% = (122.6512694143423, 277.3487305856577)
For 96% = (130.15355671679083, 269.84644328320917)
34,36,36,38,38,39,39,40,40,41,41,41,41,42,42,45,49,56
1) Find mean, median, variance, standard deviation.
2) What can we say about the student marks?
Ans:
1) mean = (34+36+36+38+38+39+39+40+40+41+41+41+41+42+42+45+49+56)/18
Mean = 41
Median = 40.5
Variance = 1/(n-1) * ∑ (xi – x)2
= 156/17
= 9.17
S.D = square root of variance
= (9.17) 1/2
= 3.02
2)The average marks obtained by student in tests is 41 and we can say that
student is maintaining his/her marks around 41 as deviation is very less.
Q13) What is the nature of skewness when mean, median of data are equal?
Ans: When mean and median are equal, then there is no skewness and there will
be symmetric distribution or normal distribution.
Q18) Answer the below questions using the below boxplot visualization.
Draw an Inference from the distribution of data for Boxplot 1 with respect
Boxplot 2.
Ans: 1. Both the box plots have uniform distribution and same medians.
2. The IQR for boxplot 1 is lower than the IQR for boxplot 2. Hence, the data
points in boxplot 1 are consistently hovered around the central value than in
boxplot 2.
3.The range of data of boxplot 1 is smaller than the range of data of boxplot 2.
Hence, the overall data is widely distributed in boxplot 2 as compared to boxplot
1.
4.There are no outliers present in both the boxplots.
Q 20) Calculate probability from the given dataset for the below cases
b. P(MPG<40)
Ans: 0.74
c. P (20<MPG<50)
Ans: 0.90
Ans: The data is not following normal distribution as the mean, median and
mode are not equal for the columns in data.
Q 22) Calculate the Z scores of 90% confidence interval,94% confidence
interval, 60% confidence interval
Ans:
C.I Z-score
90% 1.644
94% 1.88
60% 0.841
Q 24) A Government company claims that an average light bulb lasts 270
days. A researcher randomly selects 18 bulbs for testing. The sampled bulbs
last an average of 260 days, with a standard deviation of 90 days. If the
CEO's claim were true, what is the probability that 18 randomly selected
bulbs would have an average life of no more than 260 days
Hint:
rcode pt(tscore,df) p
df degrees of freedom