Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please anwer question number 2 Every positive integer can be written (uniquely) as a product of prime factors. For example, see the table below. In

image text in transcribed

Please anwer question number 2

Every positive integer can be written (uniquely) as a product of prime factors. For example, see the table below. In the first column, several integers are expressed in standard mathematical notation as products of their respective prime factors. In the second column, that prime factorization has been re-structured as a matrix. Your job in this problem is to re-construct a positive integer if given its prime factorization (in matrix form as shown in the table above). Write a Matlab function called makeintf.m which takes a matrix (as structured in the table above) as input, and produces a positive integer as output. Use a for loop in your code to accomplish this task. The function specifications and some sample function calls are shown in the tables below. input parameter pfmat a matrix representing the prime factorization of an integer output parameter theint an integer (constructed from the prime factorization stored in pfmat) sample function calls makeintf (PF1) produces the value 144 makeintf (PF2) produces the value 30870 makeintf (PF3) produces the value 19827925 Repeat problem 1, but this time use a while loop instead of a for loop, and call the resulting function makeintW.m

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

differentiate the function ( x + 1 ) / ( x ^ 3 + x - 6 )

Answered: 1 week ago

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago