R. M. D ENGINEERING COLLEGE (An Autonomous Institution) Approved by AICTE, New Delhi and Affiliated to Anna university, Chennai Accredited by NAAC & All the Eligible Programs are Accredited by NBA, New Delhi R.S.M. Nagar, Kavaraipettai – 601 206 DEPARTMENT OF SCIENCE AND HUMANITIES (MATHEMATICS) Regulation 2024 2 4 MA 4 0 1 – PROBABILITY AND STATISTICS (Common to CSE, IT, AIML ) Name : ----------------------------------------------- Register Number : ---------------------------------------------- Branch/Section : ---------------------------------------------- Academic Year/Semester : ---------------------------------------------- 2 Exp.No. 1 Probability of discrete distributions Date: Problem 1 : The probability of a component’s failure is 0.05. By using R out of 14 components i) find the probability that exactly 3 will fail ii) find the probability that atmost 3 will fail iii) plot the probability function and CDF of the random variable. Programming command : i) ii) iii) Output: i) ii) iii) Results: The R programming commands for binomial distribution are executed and the results are verified by calcul at ion s 3 Problem 2 : In a box of 200 fuses if experience shows that 2% of such fuses are defective. Use R to i) f ind the probability that exactly 5 defectives ii) f ind the probability that at most 5 defectives iii) plot the probability function and CDF of the random variable. Programming command : i) ii) iii) Output: i) ii) iii) Results: The R programming commands for poisson distribution are executed and the results are verified by calcul at ion s 4 Exp.No. 2 Probability of continuous distributions Date: Problem 1 : The time between busses on certain bus stop is 12 minutes. Therefore the wait time of a passenger who arrives randomly at a bus stop is uniformly distributed between 0 and 12 minutes. Using R f ind the probability that a person randomly arriving at the bus stop to wait for the bus has a wait time of at mos t 5 minutes. Programming command : Output: Results: The R programming commands for finding probability that follow uniform distribution are executed and the results are verified by calcul at ion s Problem 2 : The number of personal computers (PCs) sold daily at a computer world is uniformly distributed with a minimum of 2000 PC and a maximum o f 5000 PC Find the probability using R that the daily sales will sell at most 4000 PC Programming command : Output: Results: The R programming commands for finding probability that follow uniform distribution are executed and the results are verified by calcul at ion s 5 Problem 3 : An electric firm manufactures light bulbs that have a life before burns out is normally distributed with mean 800 hours and a S.D of 40 hours. Find the probability that (i) the bulb burns less than 778 hours. (ii) the bulb burns more than 834 hours. (ii) that the bulb burns between 778 and 834 hours. Programming command: Output Results: The R programming commands for finding probability that follow normal distribution are executed and the results are verified by calcul at ion s > # calculate the probability less than 778 hours > Prob_less_778< - pnorm(q=778, mean=800, sd=40, "lower.tail"=T) > # calculate the probability more than 834 hours > Prob_more_834< - pnorm(q=834, mean=800, sd=40, "lower.tail"=F) > #calculate probability between 778 and 834 hours > prob_778_834 < - pnorm(834, mean = 800, sd = 40) - pnorm(778, mean = 800, sd = 40) > #disply the result > Prob_less_778 > Prob_more_834 > prob_778_834 #disply the result > Prob_less_778 [1] 0.2911597 > Prob_more_834 [1] 0.1976625 > prob_778_834 [1] 0.5111778 6 Problem 4 : If X is a normal variate with mean 30 and standard deviation 5, find (a) P(X≤ 35 ) (b) P(X≥45). ( c ) P(26≤X≤40) Programming command: Out put Results: The R programming commands for finding probability that follow normal distribution are executed and the results are verified by calcul at ion s > # calculate the probability less than 35 hours > Prob_less_ 35 < - pnorm(q= 35 , mean= 30 , sd= 5 , "lower.tail"=T) > # calculate the probability more than 45 hours > Prob_more_ 45 < - pnorm(q= 45 , mean= 30 , sd= 5 , "lower.tail"=F) > #calculate probability between 26 and 40 hours > prob_ 26 _ 40 < - pnorm( 40 , mean = 30 , sd = 5 ) - pnorm( 26 , mean = 30 , sd = 5 ) > #disply the result > Prob_less _35 > Prob_more_ 45 > prob_ 26 _ 40 #disply the result > Prob_less_35 [1] 0.8413447 > Prob_more_45 [1] 0.001349898 > prob_26_40 [1] 0.7653945 7 Exp.No. 3 Covariance & Correlation of discrete random variables Date: Problem 1 : The joint probability mass function of X and Y is given by the following matrix Y X 0 1 2 0 0.01 0 0 1 0.09 0.09 0.18 2 0 0 0.81 Compute covariance(X,Y) by using R programming. Programming command : Output: Results: The R programming commands for finding covariance(X,Y) are executed and the results are verified by calcul at ion s 8 Problem 2 : The joint probability mass function of X and Y is given by the following matrix Y X 0 1 2 1 0.08 0.21 0.09 2 0.05 0.16 0.07 3 0.04 0.18 0.12 Compute the correlation (X,Y) by using R programming. Programming command : Output: Results: The R programming commands for finding correlation(X,Y) are executed and the results are verified by calcul at ion s 9 Exp.No. 4 Correlation of sample values Date: Problem 1 : Use R to compute the correlation coefficient for the following data: X 25 30 28 29 32 24 36 28 27 21 Y 18 20 21 16 14 13 22 15 19 12 Programming command : Output: Result s : R programming commands for finding correlation of sample data are executed and the results are verified by calcul at ion s Problem 2 : Use R to compute the correlation coefficient for the height (in inches) of father (X) and their son (Y) X 65 66 67 67 68 69 70 72 Y 67 68 65 68 72 72 69 71 Programming command : Output: Results: R programming commands for finding correlation of sample data are executed and the results are verified by calcul at ion s 10 Exp.No. 5 Testing of hypothesis using Z - test Date: Problem 1: Compute the z score to test whether the sample data 88, 92, 94, 94, 96, 97, 97, 97, 99, 99, 83, 92, 94, 94, 96, 97, 97, 97, 99, 99, 105, 109, 109, 109, 110, 112,94, 96, 97, 97, 97, 99, 99, 83, 92, 94, 94, 96, 97, 97, 97, 99, 99, 105, 109, 109, 109, 110, 112, 112, 113, 114, 115 support the administrator’s belief that the mean intelligence test score for all freshman is greater than 109 with sd 10.33. Programming command: Output: Results: The R programming commands for testing the hypothesis using z - test are executed and the results are verified by calcul at ion s >> library(BSDA) >> data=c(88, 92, 94, 94, 96, 97, 97, 97, 99,99, +83, 92, 94, 94, 96, 97, 97, 97, 99, 99, 105, +109, 109, 109, 110, 112,94, 96, 97, 97, 97, +99,99, 83, 92, 94, 94, 96, 97, 97, 97, 99, 99, +105, 109, 109, 109, 110,112, 112, 113, 114, 115 ) >> z.test(data, mu=109,alternative="greater", sigma.x = 10.33) 11 Problem 2: Compute the z score to test whether the sample data 101, 103, 112, 102, 98, 97, 93, 105, 100, 97, 107, 93, 94, 97, 97, 100, 110, 106, 110, 103, 99, 93, 98, 106, 100, 112, 105, 100, 114, 97, 110, 102, 98, 112, 99 can be drawn from a normal population with mean 102 and SD 6. Programming command: Output: Results: The R programming commands for testing the hypothesis using z - test are executed and the results are verified by calcul at ion s >> library(BSDA) >> data=c( 101, 103, 112, 102, 98, 97, 93, 105, 100, 97, 107, 93, 94, 97, 97, 100, 110, 106, 110, 103, 99, 93, 98, 106, 100, 112, 105, 100, 114, 97, 110, 102, 98, 112, 99 ) >> z.test(data, mu=102,alternative="two.sided", sigma.x = 6) 12 Exp.No. 6 Testing of hypothesis using t - test Date: Problem 1: A random sample of 10 boys had the following I.Q’s: 70, 120, 110, 101, 88, 83, 95, 98, 107, 100. Do these data support the assumption of a population mean I.Q of 100? Find a reasonable range in which most of the mean I.Q values of samples of 10 boys lie. Programming command: Output: Results: The R programming commands for testing the hypothesis using t - test are executed and the results are verified by calcul at ion s library(BSDA) >> IQ =c ( 70, 120, 110, 101, 88, 83, 95, 98, 107, 100 ) >> t .test( IQ , mu=10 0 ,alternative=" two.sided " ,conf.level=0.95 ) 13 Problem 2: The marks obtained by a group of 9 regular course students and another group of 11 part - time course students in a test are given below. Regular 56 62 63 54 60 51 67 69 58 Part - time 62 70 71 62 60 56 75 64 72 68 66 Perform a hypothesis test whether the marks obtained by regular students and part - time students differ significantly at 5%. Programming command: Output: Results: The R programming commands for testing the hypothesis using t - test are executed and the results are verified by calcul at ion s 14 Exp.No. 7 Perform one way ANOVA test Date: Problem 1: Compute the one - way analysis of variance table for the following data A B C D 20 25 24 23 19 23 20 20 21 21 22 20 Programming command: Output: Results: The R programming commands for performing one way ANOVA test are executed and the results are verified by calcul at ion s Problem 2: Compute the analysis of variance table to test the difference among the sample means at three positions are significant. Position 1 90 82 79 98 83 91 Position 2 105 89 93 104 89 95 86 Position 3 83 89 80 94 Programming command: Output: 15 Exp.No. 8 Perform two way ANOVA test Date: Problem 1: Compute the two - way analysis of variance table for the following data Salesmen Season Programming command: Output: Results: The R programming commands for performing two way ANOVA test are executed and the results are verified by calcul at ion s A B C D Summer 45 40 38 37 Winter 43 41 45 38 Monsoon 39 39 41 41 16 Problem 2: Compute the two way analysis of variance table for the following data Machine type Workers Programming command: Output: Results: The R programming commands for performing two way ANOVA test are executed and the results are verified by calcul at ion s A B C D W1 44 38 47 36 W2 46 40 52 43 W3 34 36 44 32 W4 43 38 46 33 W5 38 42 49 39 17 Exp.No. 9 P lo t 𝑿 ̅ c h a r t f o r t h e v a r i a bl e d a ta Date: Problem 1: P l o t 𝑋 ̅ ch a rt f o r t h e f o l l o w i n g 1 2 s am p le s ea c h ha v i n g 4 u n i t s. Sample No 1 2 3 4 5 6 7 8 9 10 11 12 Measurements in (mm) 1 1.4 1.6 2.9 1.7 2.6 2.3 1.9 1.7 1.8 0.8 2.0 1.4 2.3 1.0 2.0 3.6 2.8 2.1 1.6 2.2 2.0 1.5 2.5 1.3 2.8 1.5 0.5 2.5 3.2 2.1 1.8 1.9 1.5 2.1 1.6 1 2.7 2.0 2.2 1.8 1.5 1.7 1.4 1.2 2.0 0.9 1.8 Programming command: Output: 18 Problem 2: P l o t 𝑋 ̅ ch a rt f o r t h e f o l l o w i n g w e i g h t s o f 1 5 s am p le s o f 4 box e s d r a w n r a n d om l y Sample No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Box 1 10.0 10.3 11.5 11.0 11.3 10.7 11.3 12.3 11.0 11.3 12.5 11.9 12.1 11.9 10.6 Box 2 10.2 10.9 10.7 11.1 11.6 11.4 11.4 12.1 13.1 12.1 11.9 12.1 11.1 12.1 11.9 Box 3 11.3 10.7 11.4 10.7 11.9 10.7 11.1 12.7 13.1 10.7 11.8 11.6 12.1 13.1 11.7 Box 4 12.4 11.7 12.4 11.4 12.1 11.0 10.3 10.7 12.4 11.5 11.3 11.4 11.7 12.0 12.1 Programming command: Output: 19 Exp.No. 1 0 Plot R chart for the variable data Date: Problem 1: Plot R chart for the following weights of 15 samples of 4 boxes drawn randomly. Sample No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Box 1 10.0 10.3 11.5 11.0 11.3 10.7 11.3 12.3 11.0 11.3 12.5 11.9 12.1 11.9 10.6 Box 2 10.2 10.9 10.7 11.1 11.6 11.4 11.4 12.1 13.1 12.1 11.9 12.1 11.1 12.1 11.9 Box 3 11.3 10.7 11.4 10.7 11.9 10.7 11.1 12.7 13.1 10.7 11.8 11.6 12.1 13.1 11.7 Box 4 12.4 11.7 12.4 11.4 12.1 11.0 10.3 10.7 12.4 11.5 11.3 11.4 11.7 12.0 12.1 Programming command: Output: 20 Problem 2: Plot R chart for the following 12 samples each having 4 units. Sample No 1 2 3 4 5 6 7 8 9 10 11 12 Measurements in (mm) 1 1.4 1.6 2.9 1.7 2.6 2.3 1.9 1.7 1.8 0.8 2.0 1.4 2.3 1.0 2.0 3.6 2.8 2.1 1.6 2.2 2.0 1.5 2.5 1.3 2.8 1.5 0.5 2.5 3.2 2.1 1.8 1.9 1.5 2.1 1.6 1 2.7 2.0 2.2 1.8 1.5 1.7 1.4 1.2 2.0 0.9 1.8 Programming command: Output: