Aka SHHH
Aka SHHH
SECTION B
II. Answer any FOUR questions. Each Question carries 5 marks (4x5=20)
9. What are the different data structures available in our language explain with
an example.
VECTORS
A vector is an ordered collection of homogeneous data types of a given length.. Vectors are one-
dimensional data structures. It is a one-dimensional array that can hold atomic
types( integer,numeric, character, logical, complex and raw)
Vector can be created using c() combine function. Syntax: vector_obj <-c(ele, ele2,ele3,…….elen)
LIST
A list is a generic object consisting of an ordered collection of objects. Lists are heterogeneous data
structures. These are also one-dimensional data structures. A list can be a list of vectors, list of matrices,
a list of characters and a list of functions and so on
a list can be created using the list() function.
Syntax:
List_obj <-list(ele1, ele2, ele3,…….elen)
Matrices
A matrix is a rectangular arrangement of numbers in rows and columns. In a matrix, as we know
rows are the ones that run horizontally and columns are the ones that run vertically. Matrices are
twodimensional, homogeneous data structures.
Matrix matrix() function.
datastructure is
used to perform
matrix
operations and
Linear Algebra
concepts You
can create a
matrix using
the
10.Explain the following input and output statement: Scan(), readline(), print(),
printwithpaste(), sprint().
Ans: printf() function is defined in the stdio.h header file and is used to show
output on the console (standard output).
Scan() reads data as a list or vector that takes user input through a console
or file.
Readline() functons captures singline texture input from the console
Printwithpaste() Print output using paste() function inside print() function R
provides a method paste() to print output with string and variable together. This
method defined inside the print()
function.
sprint(). used to create a formatted string
11.What is probability distribution? Explain probability mass function,
probability density function, cumulative density function.
Ans: Defination: Probability distributions are functions that calculates the
probabilities of the outcomes of random variables
Probability Mass Function (PMF) The probability mass function (PMF) of a
Bernoulli distribution describes the probability of observing a particular
outcome. For a random variable X with a Bernoulli distribution. Here, p in the
probability of success, and q is the probability of failure
probability density function (por)
describes the probability of continous random variable tating Certain vaker Dn
Eg: plotting the distribution of weight of person b/w two weights prob of getting
weights. are Infinite
Commulative distribution function (CDE)
which describes the random probability of a variable (Continous Idiscrete) will
taken on a vale less than or equal to Certain Valu…
12.Explain the operators used in R.
14.Calculate Mean, Median and Mode for the following frequency distribution.
X 1 2 3 4 5
F 7 11 9 8 3
III. Answer any FOUR questions. Each Question carries 7 marks (4x7=28)
15. Briefly explain the characteristics of R ? Differentiate between Python and
R language.
16. What is Probability? Explain different types of probabilistic sampling?
17. What is Statistics? Explain the following: