Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Join our platform to connect with experts ready to provide detailed answers to your questions in various areas. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

Solve using Matlab the problems:

One using the permutation of n objects formula

One using the permutation of r objects out of n objects

You can pick these problems from the textbook or you can make up your own questions.


Help me pleaseeeee


Sagot :

Answer:

Explanation:

% Clears variables and screen

clear; clc

% Asks user for input

n = input('Total number of objects: ');

r = input('Size of subgroup: ');

% Computes and displays permutation according to basic formulas

p = 1;

for i = n - r + 1 : n

   p = p*i;

end

str1 = [num2str(p) ' permutations'];

disp(str1)

% Computes and displays combinations according to basic formulas

str2 = [num2str(p/factorial(r)) ' combinations'];

disp(str2)

=================================================================================

Example: check

How many permutations and combinations can be made of the 15 alphabets, taking four at a time?

The answer is:

32760 permutations

1365 combinations

==================================================================================