Tuesday, April 30, 2024

"Partial permutation" and "Combination with repetition"

What is "Partial permutation"

Partial permutation refers to selecting and arranging k elements from a set of n elements, where k is less than or equal to n. In a partial permutation, the order of selection matters, meaning that arranging the elements in different orders creates distinct outcomes. 

Example of Partial permutation

Let's say we have a basket of 5 different types of apples: {Red, Green, Yellow, Granny Smith, Fuji}. We want to select and arrange 3 apples from this basket in a specific order. (Please note that this "order" matters for Partial permutation.)

  • 1: Red, 2: Green, 3: Yellow
  • 1: Green, 2: Yellow, 3: Red
  • 1: Yellow, 2: Red, 3: Green
  • 1: Granny Smith, 2: Fuji, 3: Red
  • 1: Fuji, 2: Granny Smith, 3: Green
  • ...

etc. 


Actually there are 60 different ways to select and arrange 3 apples from the basket. This is the Partial permutation.

What is "Partial" in partial permutation

  • (Not partial but full) permutation: You're arranging all the elements of a set.
  • Partial permutation: You're selecting and arranging only a subset of the elements from a larger set.

How the partial permutation is calculated

Partial permutation, how many possible ways of selecting and arranging k elements from a set of n elements exist are often denoted by:



And it is calculated by:

.

This is equal to

.

So, when we select 3 apples out of 5 and arrange them in order, the number of possible partial permutations are:



What is "Combination with repetition"

"Combination with repetition" refers to selecting a certain number of objects from a set where the order of selection doesn't matter, and repetitions are allowed.

Example of combination with repetition

Let's say we have a basket of 5 different types of apples: {Red, Green, Yellow, Granny Smith, Fuji}. We want to select and arrange 3 apples from this basket. But the order doesn't matter this time, so, for example, {Green, Yellow, Fuji} and {Yellow, Green, Fuji} are considered to be same because the difference is only its order. 


  • Red, Green, Yellow
  • Granny Smith, Fuji, Red
  • Yellow, Granny Smith, Green
  • ...

etc. 


Actually there are 10 different ways to select 3 apples from the basket. This is the Combination with repetition.

How the combination with repetition is calculated

Combination with repetition (selecting k elements from a set of n elements) is often denoted by:


.

And it is calculated by:

.

And it is actually:

.

So, when we select 3 apples out of 5, the number of possible combinations are:

.

What if there is no disctintion among the apples


By the way... what if the 5 apples are all the same? In this case, whichever apple we choose, the result of 3 selections are always same, because there is no distinction among them.

{Fuji, Fuji, Fuji} out of {Fuji, Fuji, Fuji, Fuji, Fuji}

So there is only one way to select 3 apples in this case, which means, you don't need to even calculate to check how many possible combinations exist. 

References

Wikipedia, "Partial permutation", 2024 Apirl 30th visited


Sunday, April 28, 2024

Proof of Pythagorean theorem

What is Pythagorean theorem

The theorem states the sum of the areas of the two squares on the legs (a and b) equals the area of the square on the hypotenuse (c):

If this is depicted with squares:

image is from wikipedia "Pythagorean theorem"


Proof

The theorem can be proved algebraically using four copies of the same triangle arranged around a square with side c. This results in a larger square, with side a + b and area (a + b)2. 

image is from wikipedia "Pythagorean theorem"

The four triangles and the square side c must have the same area as the larger square,

giving,


So




References

Wikipedia, "Pythagorean theorem", 2024 Apirl 28th visited