Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 beStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started