Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Consider the following for loops in R. For each for loop, list the values (in
order) that the variable i takes on in the body of the loop. Briefly (in no
more than a few sentences) explain why.
a)
for(i in 1+2:3.4*5) { }
b)
for(i in dim(matrix(0, nr = 7, nc = 8))) { }
c)
for(i in rnorm(3)) { }
d)
for(i in iris[1:3,3]) { }
e)
for(j in c(1, 2, 3, 4, 5)) { }
f)
for(i in (function(x) x*x)(c(1, 2, 3))) { }
g)
for(i in NULL) { }
h)
for(i in strsplit(as.character(4*atan(1)),’’)
[[1]][1:10]) { }
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Construct a DFA A so that L(A) = L(N) where N is the following NFA:arrow_forwardUse nested for...loops to create a (6x6) matrix in which the value of an element is three times its row number minus four times its column number provided the row number is greater than the column by 1. Otherwise, the element of the matrix is equal to 0.arrow_forwardUsing the C Programming language, write a program that sums an array of 50 elements. Next,optimize the code using loop unrolling. Loop unrolling is a program transformation that reduces thenumber of iterations for a loop by increasing the number of elements computed on each iteration.Generate a graph of performance improvement.arrow_forward
- The following data are given: x= [1,3,5,7]; y=[ln (1), In (3), ln (5), ln (7)] 3. a) Use the interpld function from scipy.interpolate library to interpolate the above data using the spline interpolation method. b) Estimate the logarithm of 2 for linear, quadratic and cubic splines. Print out the true value, interpolating values and the true relative errors in % for linear, quadratic and cubic splines. c) Show on a graph the true function In(x), interpolating linear spline, interpolating quadratic spline, interpolating cubic spline, and data points. Round numbers to four significant digits.arrow_forwardes remaining 8. Consider the function f:NxN-N defined recursively by: 1) Base case: Let meN and define (0,m) = 0 2) Recursive case: For any x,meN, x>0, define f(x,m) = (x-1,m) + (m+m) Prove the following theorem holds using proof by induction: Thereom: For any n,meN, m>0 we have (n.m) I m = n+n Fill in your answer here 9 Help BIU X, x L - ɔE =N E X Formatarrow_forwardLet 2= (0,1). Compute the language of the regular expression. ((01 +10) (1(11)")arrow_forward
- d) for (k0; k=0; t = t-1) printf("B"); for-t: TC1iter) = Change of var: Σ/repetitions, Closed form: for-k: TC1iter) =. Change of var: Σ/repetitions Closed form: dependent / independent of loop variable dependent / independent of loop variable e(arrow_forwardIf A={8,12,16,20} and B={12,16,20,24,28}, what is the value of P (A and B)?arrow_forwardDescribe an efficient way of putting a VECTOR representing a deck of n cards into random order in C++. You may use the function randomlnt(n), which returns a random number between 0 and n-1, inclusive. Your method should guarantee that every possible ordering is equally likely. What is the running time of your function?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education