Explore Westonci.ca, the premier Q&A site that helps you find precise answers to your questions, no matter the topic. Get detailed and accurate answers to your questions from a community of experts on our comprehensive Q&A platform. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.
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:
How many permutations and combinations can be made of the 15 alphabets, taking four at a time?
The answer is:
32760 permutations
1365 combinations
We hope our answers were helpful. Return anytime for more information and answers to any other questions you may have. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Get the answers you need at Westonci.ca. Stay informed by returning for our latest expert advice.