Hey, here Presh Talwalkar Today's rebellion is something you can meet with technical interviews.
Imagine having three people and eleven identical coins.
How much is the possibility of dividing eleven coins among three people? It depends only on the total number of coins per person.
So you can put five coins blue, six coins red and no green coins.
The second part of the question: How many options are there for each person to get at least one coin? Now, five, six, zero would not be the solution, because we have to give at least one coin to the green.
So we can give the green one, the red five and the blue five.
Try these tasks and, when you're ready, continue watching the video where you can find a solution.
Let's start by determining the number of options that you can split 11 coins among 3 people.
We will use a trick, such as the placement of two "slots" between the coins.
One color is colored blue and the other red.
The number of coins to the left of the blue divider will be the number of coins that gets blue, the number of coins between the slots will be the number of coins that gets red and the number of coins to the right of the red divider will be the number of coins that gets green.
So when I place the sliders on the following positions, the three coins to the left of the blue cutter belong to the blue, The six coins between the cuts are those that get red and two coins to the right of the red cutter belong to the green.
We can change the position of these partitions.
When I move the blue divider further, now gets the blue five coins, the red gets four coins and the green gets two coins.
Now I can change the position again and shift the blue divider to the left.
There is no coin to the left of the blue cutter so the blue gets zero coins, between the dividers there are seven coins that get red and to the right of the red divider are four coins that get green.
Suppose that moving a partition like this, now blue gets six coins, both cuts are next to each other, there is no coin among them, which means that the red does not get any coins and the green gets the remaining five coins.
I'm going to let you figure out how to divide it so the green can get a zero coin.
However, in principle, we can count the number of options for dividing 11 coins into three for the same people by determining the number of possibilities to place two slots.
Suppose we have 11 plus 2, which is a total of 13.
We will place the dividers into two of these windows and coins into the remaining windows.
So we have to select two windows for the partitions and then fill the remaining windows with coins.
So the number of options for dividing 11 coins among three people can be counted by counting the number of options we can place two partitions into 13 windows.
This is the number of choices you can choose between two elements from 13, which is a combination number of 13 over 2 that is equal to 78.
So the answer to the first part is that you can have 78 options to split 11 coins among 3 people.
Let's get generalized.
Let us assume that we have the same objects we want to share among the people.
Just like before, we use r minus one partition.
We will have to create N plus r minus 1 windows, from which we select minus 1 partitions.
The number of options by selecting r minus 1 elements from N plus r minus 1, which will be N plus r minus 1 above r minus 1, which equals N plus R minus 1 above N.
There is another way to look at the solution.
Imagine the polynomial equation of the variables x1 plus x2 and so forth to xr equal to N and we want to find a number of non-negative integer solutions.
This is actually the division of N into different parts.
So we have determined a number of different non-negative integer solutions of this equation.
Each xi expression can be interpreted as the quantity that a person receives.
So now we move on to the next question, which is the same thing, but that every person must get at least one coin.
We do not have to start over again from the beginning.
What we do is a trick when we start by giving each person a coin.
Now we know that every person has at least one coin.
Now we want to divide the remaining eight coins among three people.
And we can do this by dividing eight coins using our two-slice method.
So we want to share exactly the same way, just adding.
I will show you just one example to show you how it works.
Imagine that I place the dividers here, to the left of the blue cutter is one coin, but blue has one coin, blue ends with two coins.
There are now six coins among the slots, but we have to add one that already has red.
Put one coin to the right of the red divider to the one coin the green one has received earlier.
So all the possibilities of dividing eleven coins amongst three people, so that everyone can get at least one, giving each person a coin, and then using our two-way method on the remaining eight coins.
Let's go through this solution.
We start by giving each one a coin, that is, we have 11 minus three, eight coins.
Then we have to solve the role of dividing these eight coins among three people.
So we'll have eight plus two, that's ten windows, from which we have to select two for the partitions.
As we have just solved, it will be the number of choices to choose from two elements out of 10, that is 10 over 2, which is 45.
We can generalize it.
Imagine that we want to divide N coins among the people so that each person gets at least one.
We start by giving each coin one coin, so we will leave N minus the coin.
Then we need to divide N minus r coins among r people.
We have resolved this earlier using r minus 1 partitions for a total N minus 1 window.
This is equal to the number of options for selecting r minus 1 elements from N minus 1, which is N minus 1 above r minus 1.
Algebraically, if you have the equation x1 plus x2 and so on up to xr equal to N, we can use N minus 1 above r minus 1 to find the number of positive integers.
And in that case, we can again interpret xi as the number that a person gets.
Thanks for watching this video, please subscribe to my channel.
I'm creating videos about math and game theory.
You can find me on my blog "Mind your decision", which you can watch on Facebook, Google+ and Patreon.
You can reach me at social media @preshtalwalkar And if you liked my video, please try my books.
The links are in the video description.
The post TOUGH Interview Question – Ways To Give 11 Coins To 3 People appeared first on APNS Education News.