Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an R program that generates a limited exponents chart for 3, 4, and 5 (powers of 3, powers of 4,and powers of 5) and

  1. Write an R program that generates a limited exponents chart for 3, 4, and 5 (powers of 3, powers of 4,and powers of 5) and perform some calculations.


    1. Write the function powerSeq(base, maxExp) which:

    a. returns a finite sequence (named vector) of a given number (base) raised to incrementing powers starting with (base)0. For instance, (base)0,(base)1,(base)2,(base)3,(base)4,(base)5.

    b. accepts two arguments base and maxExp, where base is the integer base and maxExp is the maximum exponent of the sequence.

    c. verifies that base and maxExp are integers.

    d. names the components of the returned vector by their exponent value (e.g., the component base0 is named 0, and base1 is named 1).


    2. Use powerSeq(base, maxExp) and generate 3 named vectors representing the sequential powers from 0 to 10 of 3, 4, and 5 (e.g., 30, 31, 32, 33,...310).


    3. Combine the 3 vectors (powers of 3, powers of 4, and powers of 5) into a matrix (powerChart) by column. Rename the columns to 3, 4, and 5; Ensure that the rows still carry the

    exponent-based names.


    4. Generate a new matrix (powerChartDes) that resembles powerChart but offers a readable notation in such a way that each component of powerChart now reads (base) to the power of (exponent) = (value), where base is the column name, exponent is the row name of the given component, and value is base(exponent). For instance, the component with the value 243 in powerChart shall be “3 to the power of 5 = 243” in powerChartDes.


    5. x−n=1/xn . Generate a new matrix (negPowerChart) for the negative powers of 3, negative powers of 4, and negative powers of 5 by using powerChart.

    6. Using powerChart, generate a sequence (vector) of 10 components where each component C is given by the fuction:

    a. Cn= 3n + 5n – 4n (n = 0, 1, 2, 3...10).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

1 Write the function powerSeqbase maxExp which a returns a finite sequence named vector of a given n... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials Of Services Marketing

Authors: Jochen Wirtz

4th Edition

1292425199, 9781292425191

More Books

Students also viewed these Organizational Behavior questions

Question

LO.7 Be aware of taxation on the CPA examination.

Answered: 1 week ago

Question

Discus/explain the powers of the administrative agencies.

Answered: 1 week ago