**Thanks to Simon Foundation : a youtube video.**

# combinatorics

# Inequalities and mathematical induction: RMO sample problems-solutions

**Problem:**

1. Prove the inequality —- for all natural numbers greater than or equal to 1.

Proof 1:

First consider the following: . Let us prove this claim first and then use it to prove what is asked: Towards, that end, consider

, cancelling off the common factors in numerator and denominator of RHS. (note this can also be proved by mathematical induction! 🙂 )

In the given inequality:

we need to prove

consider where

LHS = , this is an AP with first term 2 and nth term and common difference 4; there are n factors “2”; hence, we so we get

; multiplying and dividing RHS of this by , we get the desired inequality. Remember the inequality is less than or equal to.

**Problem 2:**

Establish the Bernoulli inequality: If , then .

**Solution 2: **

Apply the binomial theorem, which in turn, is proved by mathematical induction ! 🙂

**Problem 3:**

For all natural numbers greater than or equal to 1, prove the following by mathematical induction:

**Proof 3:**

Let the given proposition be P(n).

Step 1: Check if P(1) is true. Towards that end:

and $latex RHS=2-\frac{1}{1}=2-1=1**$** and hence, P(1) is true.

Step 2: Let P(n) be true for some , . That is, the following is true:

Add to both sides of above inequality, we get the following:

Now, the RHS in above is . We want this to be less than or equal to . Now, , , so what we have to prove is the following:

, that is, we want to prove that

, that is, we want , that is, we want , which is obviously true. **QED.**

*Cheers,*

Nalin Pithwa.

# RMO Training: more help from Nordic mathematical contest

**Problem:**

32 competitors participate in a tournament. No two of them are equal and in a one against one match the better always wins. (No tie please). Show that the gold, silver and bronze medal can be found in 39 matches.

**Solution:**

We begin by determining **the **gold medallist using classical elimination, where we organize 16 pairs and matches, then 8 matches of the winners, 4 matches of the winners in the second round, then 2-semifinal matches and finally one match making 31 matches altogether.

Now, the second best player must have at some point lost to the best player, and as there were 5 rounds in the elimination, there are 5 candidates for the silver medal. Let be the candidate who lost to the gold medalist in round i. Now, let and play, the winner play against , and so forth. After 4 matches, we know the silver medalist; assume this was .

Now, the third best player must have lost against the gold medalist or against or both. (If the player had lost to someone else, there would be at least three better players.) Now, won k-1 times in the elimination rounds, the 5-k players and if k is greater than one, one player with . So there are either or candidates for the third place. At most 4 matches are again needed to determine the bronze winners.

*Cheers to Norway mathematicians!*

Nalin Pithwa.

**Reference: Nordic mathematical contests, 1987-2009.**

**Amazon India link:**

# RMO 2017 Warm-up: Two counting conundrums

Problem 1:

There are n points in a circle, all joined with line segments. Assume that no three (or more) segments intersect in the same point. How many regions inside the circle are formed in this way?

Problem 2:

Do there exist 10,000 10-digit numbers divisible by 7, all of which can be obtained from one another by a re-ordering of their digits?

*Solutions will be put up in a couple of days.*

Nalin Pithwa.

# Math concept(s) : simple yet subtle

Most math concepts are intuitive, simple, yet subtle. A similar opinion is expressed by Prof. Michael Spivak in his magnum opus, Differential Geometry (preface). It also reminds me — a famous quote of the ever-quotable Albert Einstein: “everything should be as simple as possible, and not simpler.”

I have an illustrative example of this opinion(s) here:

Consider the principle of mathematical induction:

Most students use the first version of it quite mechanically. But, is it really so? You can think about the following simple intuitive argument which when formalized becomes the principle of mathematical induction:

**Theorem: First Principle of Finite Induction:**

Let S be a set of positive integers with the following properties:

- The integer 1 belongs to S.
- Whenever the integer k is in S, the next integer must also be in S.

Then, S is the set of all positive integers.

The proof of condition 1 is called basis step for the induction. The proof of 2 is called the induction step. The assumptions made in carrying out the induction step are known as induction hypotheses. *The induction situation has been likened to an infinite row of dominoes all standing on edge and arranged in such a way that when one falls it knocks down the next in line. If either no domino is pushed over (that is, there is no basis for the induction), or if the spacing is too large (that is, the induction step fails), then the complete line will not fall. *

So, also remember that the validity of the induction step does not necessarily depend on the truth of the statement that one is endeavouring to prove.

More later,

Nalin Pithwa.

# Learn hardcore math and programming through games :-) The Game of Nim

**Reference: Introductory Combinatorics, **fourth edition, **Richard A. Brualdi**

**Example : The Game of Nim:**

It is a return to the roots of combinatorics —- which does lie in recreational mathematics and we investigate the ancient game of Nim. (Nim derives from the German word Nimml, meaning Take!) Its solution depends on parity, an important problem-solving concept in combinatorics. We can use parity argument in investigations of perfect covers of chessboards when we show that a board has to have an even number of squares in order that it have a perfect cover with dominoes.

Nim is a game played by two players with heaps of coins (or stones or beans or gems or diamonds !!! 🙂 🙂 …).. Suppose that there are heaps of coins that contain, respectively, , , , coins. The object of the game is to select the last coin. The rules of the game are the following:

i) The players alternate turns (let us call the player who makes the first move I and then call the other player II).

ii) Each player, when it is his or her turn, selects one of the heaps and removes at least one of the coins from the selected heap. (The player may take all of the coins from the selected heap, thereby leaving an empty heap, which is now “out of play.”)

The game ends when all the heaps are empty. The last player to make a move, that is, the player who takes the last coin(s), is the *winner. *

The variables in this game are the number k of heaps and the numbers , , , of coins in the heaps. The combinatorial problem is to determine whether the first or second player wins and how that player should move in order to guarantee a win — a *winning strategy.*

In order to develop some understanding of Nim, we consider some special cases. **(This is an important principle to follow in general: Consider small or special cases in order to develop understanding and intuition. Then try to extend your ideas in order to solve the problem in general.) **If there is initially only one heap, then player 1 wins by removing all its coins. Now, suppose that there are heaps, with , and coins, respectively. Whether or not player I can win depends not on the actual values of and but on whether or not they are equal. Suppose that . Player I can remove enough coins from the larger heap in order to leave two heaps of equal size for player II. Now player I, when it is her turn, can mimic player II’s moves. Thus, if player II takes c coins from one of the heaps, then player I takes the same number c of coins from the other heap. Such a strategy guarantees a win for player I. If , then player II can win by mimicking player I’s moves. Thus, we have completely solved 2-heap Nim. An example of play in the 2-heap game of Nim with heaps of sizes 8 and 5, respectively, is

The preceding idea in solving 2-heap Nim, namely, moving in such a way as to leave two equal heaps, can be generalized to any number k of heaps. The insight one needs is provided by the concept of the base 2 numeral of an integer. Recall that each positive integer n can be expressed as a base 2 numeral by repeatedly removing the largest power of 2 which does not exceed the number. For instance, to express the decimal number 57 in base 2, we observe that

, ,

, ,

, ,

, .

Thus, ,

and the base 2 numeral for 57 is 111001.

Each digit in a base 2 numeral is either 0 or 1. The digit in the ith position, the one corresponding to , is called the ith bit (). We can think of each heap of coins as consisting of *subheaps *of powers of 2, according to its base numeral. Thus, a heap of size 53 consists of subheaps of sizes , , , and . In the case of 2-heap Nim, the total number of subheaps of each size is either 0, 1, or 2. There is exactly one subheap of a particular size if and only if the two subheaps of each size is even if and only if the two heaps have the same size — that is, if and only if, player II can win the Nim game.

Now, consider a general Nim game with heaps of sizes , , , . Express each of the numbers as base 2 numerals:

(By including leading 0’s we can assume that all of the heap sizes have base 2 numerals with the same number of digits.) We call a Nim game *balanced*, provided that the number of subheaps of each size is even. Thus, a Nim game is balanced if and only if:

is even,

is even,

is even,

A Nim game that is not balanced is called *unbalanced.* We say that the ith bit is *balanced, *provided that the sum is even, and is *unbalanced* otherwise. Thus, a balanced game is one in which all bits are balanced, while an unbalanced game is one in which there is at least one unbalanced bit.

We then have the following:

Player I can win in unbalanced Nim games, and player II can win in balanced Nim games.

*To see this, we generalize the strategies used in 2-pile Nim. *Suppose the Nim game is unbalanced. Let the largest unbalanced bit be the jth bit. Then, player I moves in such a way as to leave a balanced game for player II. She does this by selecting a heap whose jth bit is 1 and removing a number of coins from it so that the resulting game is balanced. No matter what player II does, she leaves for player I an unbalanced game again, and player I once again balances it. Continuing like this ensures player I a win. If the game starts out balanced, then player I’s first move unbalances it, and now player II adopts the strategy of balancing the game whenever it is her move.

For example, consider a 4-pile Nim game with heaps of sizes 7,9, 12 and 15. The base 2 numerals for these heap sizes are, respectively, 0111, 1001, 1100, and 1111. In terms of subheaps of powers of 2 we have:

This game is unbalanced with the 3rd, 2nd, and 0th bits unbalanced. Player I can remove 11 coins from the pile of size 12, leaving 1 coin. Since the base 2 numeral of 1 is 0001, the game is now balanced. Alternatively, player I can remove 5 coins from the pile of size 9, leaving 4 coins, or player I can remove 13 coins from the pile of size 15, leaving 2 coins.

**A quiz:**

- Consider 3-heap Nim with piles of sizes 1, 2 and 4. Show that this game is unbalanced and determine a first move for player I.
- Is 4-pile Nim with heaps of sizes 22, 19, 14, and 11 balanced or unbalanced? Player I’s first move is to remove 6 coins from the heap of size 19. What should player II’s first move be?
- Consider 5-pile Nim with heaps of sizes 10, 20, 30, 40, and 50. Is this game balanced? Determine a first move for player I.

Have fun with math games !

Cheers,

Nalin Pithwa.

# Inclusion Exclusion Principle : further RMO Basics

**Note: ***continued from previous blog article of same topic; same reference text (by the way, this is a beautiful introductory classic in Combinatorics, but a “thick, huge” text !!! :-))*

https://madhavamathcompetition.com/2017/07/13/the-inclusion-exclusion-principle-again/

**Theorem 1.1: (or 6.1.1 of text):**

The number of objects of S that have none of the properties is given by:

**Some remarks on the theorem 1.1 before we present the proof:**

If , the statement of the theorem becomes:

Note that there are terms on the RHS. If , then the statement of the theorem becomes:

In this case, there are terms on the right side. In the general case, the number of terms on the right side of the equation/theorem statement is:

.

**Proof of theorem 1.1:**

The LHS of the theorem statement (equation) counts the number of objects of S with none of the stated properties. We can establish the validity of the equation by showing that an object with none of the properties makes a net contribution of 1 to the right side, and an object with at least one of the properties makes a net contribution of 0. First, consider an object x with none of the properties. Its contribution to the right side of the equation is :

,

since it is in S, but in none of the other sets. Now, consider an object y with exactly of the properties. The contribution of y to is . Its contribution to is since it has exactly n of the properties and so is a member of exactly n of the sets . The contribution of y to is since we may select a pair of the properties y has in ways, and so y is a member of exactly of the sets . The contribution of y to the RHS of * Equation I* is

, which equals , since and , if . Since this last expression equals 0 according to the * identity 5.4, *the net contribution of y to the RHS of

*is 0, if y has at least one of the properties.*

**Equation I****QED.**

*PS: By the way, identity 5.4 *is as follows:

, when .

**Corollary 6.2:**

The number of objects of S which have at least one of the properties is given by

…call this relation as 6.2

where the summations are as specified in theorem 6.1.1(that is, theorem 1 of the previous blog mentioned above)

**Proof of the above corollary:**

The set consists of all those objects in S which possess at least one of the properties. Also,

.

Since, as is readily verified, , we have

.

Combining this equation with 6.1, we obtain equation or relation 6.2. **QED.**

**Example:**

Find the number of integers between 1 and 1000, inclusive, that are not divisible by 5, 6 and 8.

**Solution:**

**Method 1: **use some properties of number theory.

**Method 2: use some properties of number theory and figure out how to apply the theory given above !*** I agree it seems a very simple illustration of this generalized inclusion-exclusion principle, but we learn here to apply this technique with “clarity”…*

To solve this problem, we introduce some notation. For a real number r, recall that stands for the largest integer that does not exceed r. Also, we shall abbreviate the LCM of two integers, a and b or three integers a, b and c by and respectively. Let be the property that an integer is divisible by 5, the property that an integer is divisible by 6, and the property that an integer is divisible by 8. Let S be the set consisting of the first thousand positive integers. For , let be the set consisting of those integers in S with property . We wish to find the number of integers in .

We first see that ; ;

Integers in the set are divisible by both 5 and 8. But, an integer is divisible by both 5 and 6 iff it is divisible by lcm{5,6}, which is, 30. Also, lcm{5,8}=40 and lcm{6,8}=24. Hence, we get

; ; and

Because lcm{5,6,8}=120, we conclude that .

Thus, by the inclusion-exclusion principle, the number of integers between 1 and 1000 that are not divisible by 5, 6 and 8 equals:

.

**Example: **

How many permutations of the letters M,A,T,H,I,S,F,U, N are there such that none of the words MATH, IS, and FUN occur as consecutive letters ?(Thus, for instance, the permutation MATHISFUN is not allowed nor are the permutations INUMATHSF and ISMATHFUN.)

**Solution:**

*We apply the generalized inclusion-exclusion principle (theorem 1).*

Step 1: Identify the set S as the set of all permutations of the 9 letters given.

Step 2: Let be the property that a permutation in S contains the word MATH as consecutive letters; let be the property that a permutation in S contains the word IS and let be the property that a permutation contains the word FUN. For , let be the set of those permutations in S satisfying property .

Step 3: To find the number of permutations in .

*Solution:*

We have . The permutations in can be thought of as permutations of the six symbols: MATH, I, S, F, U and N.

Hence, .

Similarly, the permutations in are permutations of the eight symbols: M,A,T,H,IS,F,U,N. So, ; and the permutations in are permutations of the seven symbols : M,A,T,H,I,S,FUN so .

The permutations in are permutations of the five symbols: MATH, IS, F,U,N; the permutations in are permutations of the four symbols: MATH, I, S, FUN; the permutations in are permutations of the six symbols : M,A,T,H,IS,FUN.

Hence, we get the following:

; ; and .

Finally, consists of the permutations of the three symbols MATH, IS, F, U, N; therefore,

Substituting into the equation of the theorem 1.1, we get:

.

*(I hope you liked it!):-)*

*Remarks:*

Later on, we consider applications of the inclusion-exclusion principle to some general problems. The following **special case of the inclusion-exclusion principle **will be useful:

**Assume that the size of the set** that occurs in the inclusion-exclusion principle * depends only on k and not on which k sets are used in the intersection. *Thus, there are constants such that

**In this case, the inclusion-exclusion principle simplifies to **

Slatex |\overline{A_{1}}\bigcap \overline{A_{2}}\bigcap \ldots \bigcap \overline{A_{m}}|=\alpha_{0}-{m \choose 1}\alpha_{1}+{m \choose 2}\alpha_{2}-{m \choose 3}\alpha_{3}+\ldots+(-1)^{k}{m \choose k}\alpha_{k}+\ldots + (-1)^{m}\alpha_{m}$….call this **equation III** (or equation 6.3 as the book calls it).

This is because the kth summation that occurs in the inclusion-exclusion principle contains summands, each equal to .

**Example:**

How many integers between 0 and 99999 (inclusive) have among their digits each of 2,5, and 8?

**Solution:**

Let S be the set of integers between 0 and 99999. Each integer in S has 5 digits including possible leading zeros. (Thus, we think of the integers in S as the 5-permutations of the multiset in which each digit 0,1,2,3,4,5,6,7,8,9 has repetition number 5 or greater).

Let be the property that an integer does not contain the digit 2; let be the property that an integer does not contain the digit 5, and let be the property that an integer does not contain the digit 8. For , let be the set consisting of those integers in S with property .

We wish to count the number of integers in .

Using the notation in the preceding example, we have:

.

For instance, the number of integers between 0 and 99999 that do not contain the digit 2 and that do not contain the digit 5, the size of , equals the number of 5-permutations of the multiset

,

and this equals . By the corollary, we get the answer as : .

*Did you like this? I hope to continue it further by also putting up some exercise problems from Brualdi’s Combinatorics book. *

*Nalin Pithwa.*