Try this beautiful Problem based on Enumeration appeared in AMC 10A 2021, Problem 20.
AMC 10A 2021 I Problem 20
In how many ways can the sequence $1$, $2$, $3$, $4$, $5$ be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?
10
18
24
32
44
Key Concepts
Permutation
Enumeration
Combinatorics
Suggested Book | Source | Answer
An Excursion in Mathematics
AMC 10A 2021 Problem 20
32
Try with Hints
We have 5 numbers with us.
So, how many permutations we can have with those numbers?
So, $5!=120$ numbers can be made out of those $5$ numbers.
Now we have to remember that we are restricted with the following condition -
no three consecutive terms are increasing and no three consecutive terms are decreasing.
Now make a list of the numbers which are satisfying the condition given among all $120$ numbers we can have.
If $n=2$ then the permutation given by $\sigma(1)=2, \sigma(2)=1$ satisfies the given condition. Similarly, if $n=3$ then the permutation $\sigma(1)=2, \sigma(2)=3, \sigma(3)=1$ satisfies the given condition.
Now, try to use induction and extend the argument for all other valid numbers
Partition Numbers and a code to generate one in Python
Author: Kazi Abu Rousan
The pure mathematician, like the musician, is a free creator of his world of ordered beauty.
Bertrand Russell
Today we will be discussing one of the most fascinating idea of number theory, which is very simple to understand but very complex to get into. Today we will see how to find the Partition Number of any positive integer $n$.
Like every blog, our main focus will be to write a program to find the partition using python. But today we will use a very special thing, we will be usingMath Inspector - A visual programming environment. It uses normal python code, but it can show you visual (block representation) of the code using something called Node Editor. Here is a video to show it's feature.
Beautiful isn't it? Let's start our discussion.
What are Partition Numbers?
In number theory, aPartition of a positive integer $n$, also called an Integer Partition, is a way of writing $n$ as a sum of positive integers (two sums that differ only in the order of their summands are considered the same partition, i.e., $2+4 = 4+ 2$). The partition number of $n$ is written as $p(n)$
As an example let's take the number $5$. It's partitions are;
Hence, $p(5) = 7$. Easy right?, Let's see partitions of all numbers from $0$ to $6$.
Note: The partition number of $0$ is taken as $1$.
Partition of numbers from $0$ to $6$.
See how easy it is not understand the meaning of this and you can very easily find the partitions of small numbers by hand. But what about big numbers?, like $p(200)$?
Finding the Partition Number
There is no simple formula for Partition Number. We normally use recursion but if you want just a formula which generate partition number of any integer $n$, then you have to use this horrifying formula:
Scary!!!-- Try using this to find $p(2)$
Just looking at this can give you nightmare. So, are there any other method?, well yes.
Although, there are not any closed form expression for the partition function up until now, but it has both asymptotic expansions(Ramanujan's work) that accurately approximate it and recurrence relations(euler's work) by which it can be calculated exactly.
Generating Function
One method can be to use a generating function. In simple terms we want a polynomial whose coefficient of $x^n$ will give us $p(n)$. It is actually quite easy to find the generating function.
Each of these $(1+x^k+x^{2k}+\cdots+x^{rk}+\cdots)$ are called sub-series.
We can use this to find the partition number of any $n$. Let's see an example for $n=7$. There are 2 simple steps.
First write the polynomial such that each sub-series's maximum power is smaller or equals to $n$. As an example, if $n=7$, then the polynomial is $(1+x+x^2+x^3+x^4+x^5+x^6+x^7)(1+x^2+x^4+x^6)(1+x^3+x^6)(1+x^4)(1+x^5)(1+x^6)(1+x^7)$.
Now, we simplify this and find coefficient of $x^n$. In this process we find the partition numbers for all $r<n$.
So, for our example, we can just expand the polynomial given in point-1. You can do that by hand. But I have used sympy library.
The coefficients of $x^k$ gives $p(k)$ correctly up to $k = 7$. So, from this $p(7) = 15$, $p(6)=11$ and so on. But for $n>7$, the coefficients will be less than $p(n)$, as an example $p(8)=22$ but here the coefficient is $18$. To calculate $p(8)$, we need to take sub-series with power $8$ or less.
Although this method is nice, it is quite lengthy. But this method can be modified to generate a recurrence relation.
Euler's Pentagonal Number Theorem
Euler's Pentagonal Theorem gives us a relation to find the polynomial of the product of sub-series. The relation is:
The numbers $0, 1, 2, 5, 7, 12, 15, 22, 26, 35, 40,\cdots $ , are called pentagonal numbers. We generate these numbers by $\frac{k(3k+1)}{2}$ and $\frac{k(3k-1)}{2}$.
Let's try to find $p(7)$, using this.
Using this simple algorithm, we can write a code to get partition number.
def par(n):
summ = 0
if n == 0 or n == 1:
result = 1
else:
for k in range(1,n+1):
d1 = n - int((k*(3*k-1))/2)
d2 = n - int((k*(3*k+1))/2)
sign = pow(-1,k+1)
summ = summ + sign*(par(d1) + par(d2))
result = summ
return result
This is the code to generate partition number. This is not that efficient as it uses recurrence. For big numbers it will take huge amount of time. In math-inspector, we can see it's block diagram.
Here the par block represent the function par(n). Whenever i creates a variable $n1=6$ or $n3=10$, it creates a circle. To apply par on $n3$, i just need to connect their nodes. And to show the output, add the other node to output node.
So, we have seen this simple function. Now, let's define one using the euler's formula but in a different manner. To understand the used algorithm watch this: Explanation
def partition(n):
odd_pos = []; even_pos= []; pos_d = []
for i in range(1,n+1):
even_pos.append(i)
odd_pos.append(2*i+1)
m = 0; k = 0
for i in range(n-1):
if i % 2 == 0:
pos_d.append(even_pos[m])
m += 1
else:
pos_d.append(odd_pos[k])
k += 1
initial = 1; pos_index = [initial]; count = 1
for i in pos_d:
d = initial + i
pos_index.append(d)
initial = d
count += 1
if count > n:
break
sign = []
for i in range(n):
if i % 4 == 2 or i % 4 == 3:
sign.append(-1)
else:
sign.append(1)
pos_sign = []; k = 0
for i in range(1,n+1):
if i in pos_index:
ps = (i,sign[k])
k = k + 1
pos_sign.append(ps)
else:
pos_sign.append(0)
if len(pos_sign) != n:
print("Error in position and sign list.")
partition = [1]
f_pos = []
for i in range(n):
if pos_sign[i]:
f_pos.append(pos_sign[i])
partition.append(sum(partition[-p]*s for p,s in f_pos))
return partition
This is the code. This is very efficient. Let's try running this function.
Note: This function returns a list which contains all $p(n)$ in the range $0$ to $n$.
As you can see in the program, In[3] gives a list $[p(0),p(1),p(2),p(3),p(4),p(5)]$. Hence, to get the $p(n)$ using this function, just add $[-1]$ as it gives the last element of the list.
We can use a simple program to plot the graph.
import matplotlib.pyplot as plt
n = 5
x_vals = [i for i in range(n+1)]
y_vals = partition(n)
plt.grid(color='purple',linestyle='--')
plt.ylabel("Partition Number")
plt.xlabel("Numbers")
plt.step(x_vals,y_vals,c="Black")
plt.savefig("Parti_5.png",bbox_inches = 'tight',dpi = 300)
plt.show()
Output is given below. The output is a step function as it should be.
This is all for today. I hope you have learnt something new. If you find it useful, then share.
Pigeonhole Principle
“The Pigeonhole principle” ~ Students who have never heard may think that it is a joke. The pigeonhole principle is one of the simplest but most useful ideas in mathematics. Let’s learn the Pigeonhole Principle with some applications.
Pigeonhole Principle Definition:
In Discrete Mathematics, the pigeonhole principle states that if we must put $N + 1$ or more pigeons into N Pigeon Holes, then some pigeonholes must contain two or more pigeons.
Example:
If $Kn+ 1$ (where k is a positive integer) pigeons are distributed among n holes than some hole contains at least $k + 1$ pigeons.
Applications of Pigeonhole Principle:
This principle is applicable in many fields like Number Theory, Probability, Algorithms, Geometry, etc.
Problems and Solutions:
Problem 1
A bag contains beads of two colours: black and white. What is the smallest number of beads which must be drawn from the bag, without looking so that among these beads, two are of the same colour?
Solution: We can draw three beads from bags. If there were no more than one bead of each colour among these, then there would be no more than two beads altogether. This is obvious and contradicts the fact that we have chosen their beads. On the other hand, it is clear that choosing two beads is not enough. Here the beads play the role of pigeons, and the colours (black and white) play the role of pigeonhole.
Problem 2
Find the minimum number of students in a class such that three of them are born in the same month?
Solution: Number of month $n =12$
According to the given condition,
$K+1 = 3$
$K = 2$
$M = kn +1 = 2×12 + 1 = 25$.
Problem 3
Show that from any three integers, one can always choose two so that $a^3$b – a$b^3$ is divisible by 10.
Solution: We can factories the term $a^3$b – a$b^3$ = $ab(a + b)(a - b)$, which is always even, irrespective of the pair of integers we choose.
If one of three integers from the above factors is in the form of 5k, which is a multiple of 5, then our result is proved.
If none of the integers is a multiple of 5 then the chosen integers should be in the form of $(5k)+-(1)$ and $(5k)+-(2)$ respectively.
Clearly, two of these three numbers in the above factors from the given expression should lie in one of the above two, which follows by the virtue of this principle.
These two integers are the ones such that their sum and difference is always divisible by 5. Hence, our result is proved.
Problem 4
If n is a positive integer not divisible by 2 or 5 then n has a multiple made up of 1's.
Problem 5
Let $X \subseteq{1,2, \ldots, 99}$ and $|X|=10$. Show that it is possible to select two disjoint nonempty proper subsets $Y, Z$ of $X$ such that $\sum(y \mid y \in Y)=\sum(z \mid z \in Z)$.
Problem 6
Let $A_{1} B_{1} C_{1} D_{1} E_{1}$ be a regular pentagon. For $2 \leq n \leq 11$, let $A_{n} B_{n} C_{n} D_{n} E_{n}$ be the pentagon whose vertices are the midpoints of the sides of the pentagon $A_{n-1} B_{n-1} C_{n-1} D_{n-1} E_{n-1}$. All the 5 vertices of each of the 11 pentagons are arbitrarily coloured red or blue. Prove that four points among these 55 points have the same colour and form the vertices of a cyclic quadrilateral.
Try this beautiful Chessboard Problem based on Chessboard from PRMO - 2018.
Chessboard Problem - PRMO 2018- Problem 26
What is the number of ways in which one can choose 60 units square from a $11 \times 11$ chessboard such that no two chosen square have a side in common?
,
\(56\)
\(58\)
\(60\)
\(62\)
\(64\)
Key Concepts
Game problem
Chess board
combination
Suggested Book | Source | Answer
Suggested Reading
Pre College Mathematics
Source of the problem
Prmo-2018, Problem-26
Check the answer here, but try the problem first
\(62\)
Try with Hints
<br>First Hint
Total no. of squares $=121$ Out of these, 61 squares can be placed diagonally. From these any 60 can be selected in ${ }^{61} C_{60}$ ways $=61$
Now can you finish the problem?
Second Hint
From the remaining 60 squares 60 can be chosen in any one way
Total equal to ${ }^{61} \mathrm{C}{60}+{ }^{60} \mathrm{C}{60}=61+1=62$
Chocolates Problem | PRMO - 2018 | Problem No. - 28
Try this beautiful Problem on Combinatorics from integer based on chocolates from PRMO -2018
Chocolates Problem - PRMO 2018- Problem 28
Let N be the number of ways of distributing 8 chocolates of different brands among 3 children such that each child gets at least one chocolate, and no two children get the same number of chocolates. Find the sum of the digits of $\mathrm{N}$.
,
\(28\)
\(90\)
\(24\)
\(16\)
\(27\)
Key Concepts
Combination
Combinatorics
Probability
Suggested Book | Source | Answer
Suggested Reading
Pre College Mathematics
Source of the problem
Prmo-2018, Problem-28
Check the answer here, but try the problem first
\(24\)
Try with Hints
First Hint
we have to distribute \(8\) chocolates among \(3\) childrens and the condition is Eight chocolets will be different brands that each child gets at least one chocolate, and no two children get the same number of chocolates. Therefore thr chocolates distributions will be two cases as shown below.....
Now can you finish the problem?
Second Hint
case 1:$(5,2,1)$
Out of \(8\) chocolates one of the boys can get \(5\) chocolates .So \(5\) chocolates can be choosen from \(8\) chocolates in \( 8 \choose 5\) ways.
Therefore remaining chocolates are \(3\) . Out of \(3\) chocolates another one of the boys can get \(2\) chocolates .So \(2\) chocolates can be choosen from \(3\) chocolates in \( 3 \choose 2\) ways.
Therefore remaining chocolates are \(1\) . Out of \(1\) chocolates another one of the boys can get \(1\) chocolates .So \(1\) chocolates can be choosen from \(1\) chocolates in \( 1 \choose 1\) ways.
Therefore number of ways for first case will be \( 8 \choose 5\) \( \times\) \( 3 \choose 2\) \( \times\) \( 1 \choose 1\)\(\times\) $3!$=$\frac{8}{2!.5!.1!}$$\times 3$
Case 2:$(4,3,1)$
Out of \(8\) chocolates one of the boys can get \(4\) chocolates .So \(4\) chocolates can be choosen from \(8\) chocolates in \( 8 \choose 4\) ways.
Therefore remaining chocolates are \(4\) . Out of \(4\) chocolates another one of the boys can get \(3\) chocolates .So \(3\) chocolates can be choosen from \(4\) chocolates in \( 4 \choose 3\) ways.
Therefore remaining chocolates are \(1\) . Out of \(1\) chocolates another one of the boys can get \(1\) chocolates .So \(1\) chocolates can be choosen from \(1\) chocolates in \( 1 \choose 1\) ways.
Therefore number of ways for first case will be \( 8 \choose 4\) \( \times\) \( 4 \choose 3\) \( \times\) \( 1 \choose 1\)\(\times\) $3!$=$\frac{8}{4!.3!.1!}$$\times 3$
Can you finish the problem...?
Third Hint
Therefore require number of ways =$\frac{8}{2!.5!.1!}$$\times 3$+$\frac{8}{4!.3!.1!}$$\times 3$=$24$
Try this beautiful Problem on Trigonometry from PRMO -2018
Trigonometry Problem - PRMO 2018- Problem 14
If $x=\cos 1^{\circ} \cos 2^{\circ} \cos 3^{\circ} \ldots . \cos 89^{\circ}$ and $y=\cos 2^{\circ} \cos 6^{\circ} \cos 10^{\circ} \ldots \ldots \cos 86^{\circ},$ then what is the integer nearest to $\frac{2}{7} \log _{2}(\mathrm{y} / \mathrm{x}) ?$
,
\(28\)
\(19\)
\(24\)
\(16\)
\(27\)
Key Concepts
Trigonometry
Logarithm
Suggested Book | Source | Answer
Suggested Reading
Pre College Mathematics
Source of the problem
Prmo-2018, Problem-14
Check the answer here, but try the problem first
\(19\)
Try with Hints
First Hint
Given that $x=\cos 1^{\circ} \cos 2^{\circ} \cos 3^{\circ} \cdots \cos 89^{\circ}$
Try this beautiful Problem on Probability based on Dice from AMC 10 A, 2014. You may use sequential hints to solve the problem.
Dice Problem - AMC-10A, 2014 - Problem 17
Three fair six-sided dice are rolled. What is the probability that the values shown on two of the dice sum to the value shown on the remaining die?
,
$\frac{1}{6}$
$\frac{13}{72}$
$\frac{7}{36}$
$\frac{5}{24}$
$\frac{2}{9}$
Key Concepts
combinatorics
Dice-problem
Probability
Suggested Book | Source | Answer
Suggested Reading
Pre College Mathematics
Source of the problem
AMC-10A, 2014 Problem-17
Check the answer here, but try the problem first
$\frac{5}{24}$
Try with Hints
First Hint
Total number of dice is \(3\) and each dice \(6\) possibility. therefore there are total $6^{3}=216$ total possible rolls. we have to find out the probability that the values shown on two of the dice sum to the value shown on the remaining die.
Without cosidering any order of the die , the possible pairs are $(1,1,2),(1,2,3),(1,3,4)$,$(1,4,5),(1,5,6),(2,2,4),(2,3,5)$,$(2,4,6),(3,3,6)$
Now can you finish the problem?
Second Hint
Clearly $(1,1,1).(2,2,4),(3,3,6)$ this will happen in $\frac{3 !}{2}=3$ way
$(1,2,3),(1,3,4)$,$(1,4,5),(1,5,6),(2,3,5)$,$(2,4,6),$this will happen in $3 !=6$ ways
Now Can you finish the Problem?
Third Hint
Therefore, total number of ways $3\times3+6\times6=45$ so that sum of the two dice will be the third dice
Therefore the required answer is $\frac{45}{216}$=$\frac{5}{24}$
Try this beautiful Combinatorics Problem based on colour from integer from Prmo-2018.
Colour Problem- PRMO 2018- Problem 27
What is the number of ways in which one can colour the square of a $4 \times 4$ chessboard with colours red and blue such that each row as well as each column has exactly two red squares and blue squares?
,
\(28\)
\(90\)
\(32\)
\(16\)
\(27\)
Key Concepts
Chessboard
Combinatorics
Probability
Suggested Book | Source | Answer
Suggested Reading
Pre College Mathematics
Source of the problem
Prmo-2018, Problem-27
Check the answer here, but try the problem first
\(90\)
Try with Hints
First Hint
First row can be filled by ${ }^{4} \mathrm{C}_{2}$ ways $=6$ ways. Case-I
Second row is filled same as first row $\Rightarrow$ here second row is filled by one way $3^{\text {rd }}$ row is filled by one way $4^{\text {th }}$ row is filled by one way
Total ways in Case-I equals to ${ }^{4} \mathrm{C}_{1} \times 1 \times 1 \times 1=6$ ways
now we want to expand the expression and simplify it..............
Second Hint
Case-II $\quad$ Exactly $1$ R & $1$ B is interchanged in second row in comparision to $1^{\text {st }}$ row $\Rightarrow$ here second row is filled by $2 \times 2$ way $3^{r d}$ row is filled by two ways $4^{\text {th }}$ row is filled by one way $\Rightarrow$ Total ways in Case-II equals to ${ }^{4} \mathrm{C}_{1} \times 2 \times 2 \times 2 \times 1=48$ ways
Third Hint
Case-III $\quad$ Both $\mathrm{R}$ and $\mathrm{B}$ is replaces by other in second row as compared to $1^{\text {st }}$ row $\Rightarrow$ here second row is filled by 1 way $3^{r d}$ row is filled by $4 \choose 2 $ ways
$\Rightarrow \quad$ Total ways in $3^{\text {th }}$ Case equals to ${ }^{4} \mathrm{C}_{2} \times 1 \times 6 \times 1=36$ ways $\Rightarrow \quad$ Total ways of all cases equals to 90 ways