answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Your rank is 44336 and 346 rank in girls and2370 rank in sc?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How many 3-digit numbers can be formed using the digit 123456 and 7 if no digit can be repeated in number?

With questions like these it is often difficult to remember whether we are looking for permutations or combinations. In English we use these two terms interchangeably but in mathematics we must be more precise. The way to remember is that if the order matters, then position matters, thus position = permutation. If order does not matter then we're looking for combinations. Put simply, 123 and 321 are the same combination but different permutations. In this case we're looking for permutations (thus combination locks should really be called permutation locks).The formula for calculating permutations is fairly simple: given 7 digits from which we must select 3, we have 7^3 = 7 x 7 x 7 = 343 permutations in total. However, in order to exclude repeated digits we must use a different formula. When we select the first digit we have 7 choices (just as we do with repetition allowed), but when we choose the next digit we only have 6 choices remaining and for the final digit we only have 5 choices remaining.To express this more mathematically, we need to use factorials. Factorial 7 (written 7!) is 7 x 6 x 5 x 4 x 3 x 2 x 1 = 5040. This tells us there are 5040 different ways we can write all the digits from 1 to 7 without repetition. In order to calculate all the 3-digit permutations we need to stop multiplying when we reach 4. To achieve this, we use the following formula:n! / (n-m)!where n is the number of elements in the set and m is the number of elements we wish to select.Thus we get:7! / (7-3)! = 7! / 4!If we (partially) expand this we find we have:7 x 6 x 5 x 4! / 4!The 4!s above and below the division will cancel each other out, so we get:7 x 6 x 5 = 210 permutations without repetition.If we were to fully expand this out we find we have:(7 x 6 x 5 x 4 x 3 x 2 x 1) / (4 x 3 x 2 x 1) = 5040 / 24 = 210 permutations without repetition.Note that if we were only interested in the number of combinations (without repetition), we divide the number of permutations by 3! For that we use the following formula instead:n! / (m! x (n-m)!)Thus we'd get:7! / (3! x 4!) = (7 x 6 x 5 x 4!) / (3 x 2 x 1 x 4!)The 4!s cancel each other out so we get:(7 x 6 x 5) / (3 x 2 x 1) = 210 / 6 = 35 combinations without repetition.


Print the digits in a number in ascending or descending order c program?

#include/* In case pow does not work from math.h */int my_pow( int x, int y ){int i, result = 1;for( i=1; i temp2 ){if ( 1 == j ){printf(" %d, ", i );break;}j--;}else{break;}}while(1);}printf("\n");return 1;}OUTPUT:------------[~/temp-satish]$ ./a.outEnter number of digits :212, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89,[~/temp-satish]$[~/temp-satish]$ ./a.outEnter number of digits :3123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789,[~/temp-satish]$ ./a.outEnter number of digits :41234, 1235, 1236, 1237, 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1256, 1257, 1258, 1259, 1267, 1268, 1269, 1278, 1279, 1289, 1345, 1346, 1347, 1348, 1349, 1356, 1357, 1358, 1359, 1367, 1368, 1369, 1378, 1379, 1389, 1456, 1457, 1458, 1459, 1467, 1468, 1469, 1478, 1479, 1489, 1567, 1568, 1569, 1578, 1579, 1589, 1678, 1679, 1689, 1789, 2345, 2346, 2347, 2348, 2349, 2356, 2357, 2358, 2359, 2367, 2368, 2369, 2378, 2379, 2389, 2456, 2457, 2458, 2459, 2467, 2468, 2469, 2478, 2479, 2489, 2567, 2568, 2569, 2578, 2579, 2589, 2678, 2679, 2689, 2789, 3456, 3457, 3458, 3459, 3467, 3468, 3469, 3478, 3479, 3489, 3567, 3568, 3569, 3578, 3579, 3589, 3678, 3679, 3689, 3789, 4567, 4568, 4569, 4578, 4579, 4589, 4678, 4679, 4689, 4789, 5678, 5679, 5689, 5789, 6789,[~/temp-satish]$