Question: NEED URGENT HELP with this please. USING MIPS(MARS 4.5): MARS MIPS simulator - Missouri State University From a set of numbers size n we can

NEED URGENT HELP with this please. USING MIPS(MARS 4.5): MARS MIPS simulator - Missouri State University

NEED URGENT HELP with this please. USING MIPS(MARS 4.5): MARS MIPS simulator

From a set of numbers size n we can select ordered subsets of size r. The number of subsets of size r in n is given by the formula P(n,r) - n!/(n-r)! For example, n-4, and r-2, then P(4,2,-4%(4-2)-(4x3x2x1)/(21)-12. So there are l 2 possible permutations from a set of size 4 if we choose elements 2 at a time. Write a MIPS program which will accept 1 positive integer, in effect n. Your program is to calculate P(n.r) for all possible combinations n and r from n down to 1. For example, the user ters 3, then your program should generate as output P(3,3) 6 P(3,2) 6 P(2,2) 2 P(2,1) 2 To make you program as modular as possible, be sure to implement the factorial function and P(n,r) as functions, passing and returning parameters as discussed in class. Your output should be

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!