logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

R-Programming Multiple Choice Questions | MCQs | Quiz

R Programming Interview Questions and Answers
Pratice R Programming questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   R History
•   R Overview
•   R Basics
•   Console Input & Evaluation
•   Data Types - 1
•   Data Types - 2
•   Data Types - 3
•   Reading Datasets - 1
•   Reading Datasets - 2
•   Textual Data Formats
•   Connection Interfaces
•   Subsetting - 1
•   Subsetting - 2
•   Vectorized Operations-1
•   Vectorized Operations-2
•   Dplyr Basics - 1
•   Dplyr Basics - 2
•   Control Structures - 1
•   Control Structures - 2
•   Control Structures - 3
•   Functions - 1
•   Functions - 2
•   Dates & Times
•   Scoping Rules - 1
•   Scoping Rules - 2
•   Loop Functions - 1
•   Loop Functions - 2
•   Debugging
•   Debugging Tools
•   Simulation - 1
•   Simulation - 2
•   R Profiler - 1
•   R Profiler - 2
•   R ggplot2 - 1
•   R ggplot2 - 2
•   R ggplot2 - 3
•   Data Wrangling - 1
•   Data Wrangling - 2
•   Exploratory Data Analysis-1
•   Exploratory Data Analysis-2
•   Commands - 1
•   Commands - 2
•   Commands - 3
•   Packages - 1
•   Packages - 2
•   Packages - 3
•   Visualizing Data - 1
•   Visualizing Data - 2
•   Linear Regression
•   Predictive Analytics

Best Reference Books

R Programming Books
« Prev Page
Next Page »

R Programming Questions and Answers – Simulation-1

Posted on July 12, 2015 by Manish

This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Simulation-1”.

1. ________ generate random Normal variates with a given mean and standard deviation
a) dnorm
b) rnorm
c) pnorm
d) rpois
View Answer

Answer: b
Explanation: The “r” function is the one that actually simulates random numbers from that distribution.

2. Point out the correct statement :
a) R comes with a set of pseudo-random number generators
b) Random number generators cannot be used to model random inputs
c) Statistical procedure does not require random number generation
d) All of the mentioned
View Answer

Answer: a
Explanation: R allows you to simulate from well known probability distributions like the Normal, Poisson, and binomial.

3. ______ evaluate the cumulative distribution function for a Normal distribution
a) dnorm
b) rnorm
c) pnorm
d) rpois
View Answer

Answer: c
Explanation: p stands for cumulative distribution.

4. _______ generate random Poisson variates with a given rate
a) dnorm
b) rnorm
c) pnorm
d) rpois
View Answer

Answer: d
Explanation: q stands for quantile function (inverse cumulative distribution).

5. Point out the wrong statement :
a) For each probability distribution there are typically three functions
b) For each probability distribution there are typically four functions
c) r function is sufficient for simulating random numbers
d) None of the mentioned
View Answer

Answer: a
Explanation: There are typically four functions available that start with a “r”, “d”, “p”, and “q”.

6. Which of the following evaluate the Normal probability density (with a given mean/SD) at a point ?
a) dnorm
b) rnorm
c) pnorm
d) rpois
View Answer

Answer: a
Explanation: That point can be vector of points.

7. _________ is the most common probability distribution to work with.
a) Gaussian
b) Parametric
c) Paradox
d) All of the mentioned
View Answer

Answer: a
Explanation: Working with the Normal distributions requires using four functions.

8. What will be the output of the following code ?

> x <- rnorm(10)
> x

a)

[1] 0.01874617 -0.18425254 -1.37133055 -0.59916772 0.29454513
[6] 0.38979430 -1.20807618 -0.36367602 -1.62667268 -0.25647839

b)

[1] 22.20356 21.51156 19.52353 21.97489 21.48278 20.17869 18.09011
[8] 19.60970 21.85104 20.96596

c)

Min. 1st Qu. Median Mean 3rd Qu. Max.
18.09 19.75 21.22 20.74 21.77 22.20

d) All of the mentioned
View Answer

Answer: a
Explanation: Here we simulate standard Normal random numbers with mean 0 and standard deviation 1.

9. What will be the output of the following code ?

> x <- rnorm(10)
> summary(x)

a)

[1] 0.01874617 -0.18425254 -1.37133055 -0.59916772 0.29454513
[6] 0.38979430 -1.20807618 -0.36367602 -1.62667268 -0.25647839

b)

[1] 22.20356 21.51156 19.52353 21.97489 21.48278 20.17869 18.09011
[8] 19.60970 21.85104 20.96596

c)

Min. 1st Qu. Median Mean 3rd Qu. Max.
18.09 19.75 21.22 20.74 21.77 22.20

d) All of the mentioned
View Answer

Answer: c
Explanation: We can modify the default parameters to simulate numbers with mean 20 and standard deviation 2.

10. What will be the output of the following code ?

 > pnorm(2)

a) 0.9772499
b) 1.9772499
c) 0.6772499
d) All of the mentioned
View Answer

Answer: a
Explanation: If you wanted to know what was the probability of a random Normal variable of being less than 2, you could use the pnorm() function to do that calculation.

Sanfoundry Global Education & Learning Series – R Programming Language.

Here’s the list of Best Reference Books in R Programming Language.

To practice all areas of R Programming Language, Here is complete set of 1000+ Multiple Choice Questions and Answers.
« Prev Page - R Programming Questions and Answers – Debugging Tools
» Next Page - R Programming Questions and Answers – Simulation-2
« R Programming Questions and Answers – Debugging Tools
R Programming Questions and Answers – Simulation-2 »

Deep Dive @ Sanfoundry:

  1. C Programming Examples on Matrix
  2. Java Programming Examples on Combinatorial Problems & Algorithms
  3. C# Programming Examples on LINQ
  4. C++ Programming Examples on Combinatorial Problems & Algorithms
  5. C# Programming Examples on Functions
  6. C# Basic Programming Examples
  7. C Programming Examples on Combinatorial Problems & Algorithms
  8. Java Programming Examples on Numerical Problems & Algorithms
  9. C++ Programming Examples on Numerical Problems & Algorithms
  10. C Programming Examples on Numerical Problems & Algorithms
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry