Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Describe how the bond issue price is calculated.

Answered: 1 week ago