Amicable Numbers Definition Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor of a number does not include the number itself. For example, the proper divisors of

Introduction One of the - confusing - topics in Algorithm design is the concept of NP completeness. If you search the topic on the internet you will probably find tons of articles and lectures on the subject however in this short article I will summarize it so that it is easy to remember by the

Problem 5 cards are randomly drawn from a standard 52 card deck. What is the probability to get four of a kind. For example 4 different aces plus some additional card Solution The total number of ways to choose 5 cards from 52 cards is straight forward and given by the formula n choose k

Problem A computer language is usingĀ 10 symbols and 26 letters. How many 6 digit words can be constructed using 3 different letters and 3 different symbols. How many different symbols can be constructed if the word has to start with letter Z for example. Solution For the first part of the question we need to

Problem You have 6 red balls, 7 green balls and 4 blue balls. You are asked to choose two balls. How many different ways you can select the balls if the color should match. How many different ways you can select the balls if the color does not match. Solution There are 6 choose 2

Problem How many different couples we can make if we are asked to select 5 women from 10 candidates and 5 men from 12 candidates. Solution There are 10 choose 5 different ways to select the women: 10!/(10-5)!5! = 252 There are 12 choose 5 different ways to select the men: 12!/(12-5)!5! = 792 Total

Problem We have 4 drivers and 4 cars. If two cars can only be driven by two drivers and the other two cars can be driven by any driver. How many different ways the drivers can drive the cars. Solution Let us assume driver 1 and driver 2 can only drive car 1 and car

Problem In playing cards what is the probability that each of the four players gets an ace Solution Each player gets 13 cards out of 52 so there are: (52 choose 13)(39 choose 13)(26 choose 13)(13 choose 13) = (52!/39!13!)(39!/26!13!)(26!/13!13!) different ways to distribute 52 cards among the four players. There are 4 aces already

Problem We want to generate a random number between 100 and 499. what is the probability of generating a random number which has at least one digit = 1 for example 115. What is the probability of generating a random number that has exactly two digits = 2 for example 221 Solution Let us first

Problem A bag of marbles containing 4 white marbles and 6 red marbles. If we randomly select two marbles from the bag what is the probability that the selected marbles are of different colors in other words one white and one red Solution Selecting (k) objects from (n) objects is given by: n!/(n-k)!k! so the