7777777

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

NAME- ENAKSHI KAPOOR

REGISTER NO.-21BEC1194

LAB QUIZ PROBABILITY AND STATISTICS

QUESTION-1
SOLUTION-

Code-
1:10
X=10; X<-10; 10->X;
c(1,2,5)
a =c(1, 3, 5, 7) b =c(2, 4, 6, 8)
a =c(1, 3, 5, 7)
b =c(2, 4, 6, 8)
a+b
a-b
a*b
a/b
X=as.character(5.2)X
X=as.character(5.2)
x
X
paste("Baa", "Baa", "Black", "Sheep")
var(1,2,3,4,5,6,7,8,9)
var=c(1,2,3,4,5,6,7,8,9)
var
req=c(10,20,30,40,50,60,70,80,90)
req
in=data.frame(var,req)
in=data.frame(var,req)
in
info=data.frame(var,req)
info
tabltable(info$var)
table=table(info$var)
table
table=table(info$req)
table
pie(table)
boxplot(ino$var,col=c("red","blue"))
boxplot(info$var,col=c("red","blue"))
pie(table)
Command window-

Plots-
Pie chart-

Boxplot-

Question 2
SOLUTION-

CODE-
Command window-
QUESTION-3
SOLUTION-

CODE-
n=300
sprop=146/n
pprop=0.5
q=1-pprop
z=(sprop-pprop)/sqrt(pprop*q/n)
z
E=qnorm(0.975)
c(-E,E)
z=(sprop+c(-E,E)*sqrt)(pprop*q/n)
z=(sprop-pprop)/sqrt(pprop*q/n)
z
if(z>-E &&z<E){print("same ratio")} else{print("not same
ratio")}
Command window-

You might also like