(Use R) Suppose x is a vector. Write a code that return the sum of the products of the components of x with their corresponding positions. For example if x = c(2, 5, 7), then it should return 2 * 1 + 5 *2 +7*3 = 33.

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter9: Systems Of Equations And Inequalities
Section9.9: Properties Of Determinants
Problem 12E
icon
Related questions
Question
(Use R) Suppose x is a vector. Write a code that return the sum of the products of the
components of x with their corresponding positions. For example if x = c(2, 5, 7), then it
should return 2 * 1 + 5 *2 +7*3 = 33.
Transcribed Image Text:(Use R) Suppose x is a vector. Write a code that return the sum of the products of the components of x with their corresponding positions. For example if x = c(2, 5, 7), then it should return 2 * 1 + 5 *2 +7*3 = 33.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra and Trigonometry (MindTap Course List)
Algebra and Trigonometry (MindTap Course List)
Algebra
ISBN:
9781305071742
Author:
James Stewart, Lothar Redlin, Saleem Watson
Publisher:
Cengage Learning