You are not logged in.
There are 2 types of red pens, 3 types of blue pens, and 4 types of green pens.
You want to purchase 4 pens, each of a different type, containing at least one of each color.
In how many ways can you do this?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
There are 2 types of red pens, 3 types of blue pens, and 4 types of green pens.
You want to purchase 4 pens, each of a different type, containing at least one of each color.
Let's say you have these colours red1, red2, blue1, blue2, blue3, green1, green2, green3, and green4. That's nine colour choices.
So choose a red, then a blue, then a green .... how many ways ?
Then choose anything as the fourth pen out of the 6 remaining choices.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Hi Bob
That is not going to yield a correct answer.
Hi Agnishom
Are pens of same color the same or different?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
My first attempt at this question interpreted the problem differently. Then I deleted it and tried again. Now I'm not sure. We await Agnishom's clarification.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
I'd say the answer is 3 if same-coloured pens are the same and 72 if they are different.
The GFs are:
and
Last edited by anonimnystefy (2013-09-21 00:18:29)
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
I think they are different
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
There are 2 types of red pens, 3 types of blue pens, and 4 types of green pens.
You want to purchase 4 pens, each of a different type, containing at least one of each color.Let's say you have these colours red1, red2, blue1, blue2, blue3, green1, green2, green3, and green4. That's nine colour choices.
So choose a red, then a blue, then a green .... how many ways ?
Then choose anything as the fourth pen out of the 6 remaining choices.
Bob
So, it should be 2*3*4*6 = 144. But why is it 72?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
I already said that isn't correct. If you did it like that, you would count picking red1, red2, blue1, green1 and red2, red1, blue1, green1 as different picks, when they are truly the same.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hi Agnishom
I checked the answer with them and it is correct.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
I already said that isn't correct. If you did it like that, you would count picking red1, red2, blue1, green1 and red2, red1, blue1, green1 as different picks, when they are truly the same.
I am sorry, I could not follow. How is it coming to 72?
I too checked that it is correct
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
You can do it by casework or using the GF above.
If you did it by casework you'd do it by choosing one colour and calculating the number of possibilities in which you buy two lens of that colour and one pen of each other colour. Then do that for the two other colour and sum them. The result should be: 1*3*4+2*3*4+2*3*6=72.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hmmm.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I don't know how I would program this one, and it's a simple enough a problem that it doesn't need to be programmed.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Hmmm.
I don't know how I would program this one
So then it is not so simple. DZ says you do not understand the problem until you program it. This always lends insight and satisfies the "two solution rule."
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I have two solutions. Classic casework and the GF.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
And if the problem were say 20 pens and 16 to 1 types would you still want to casework it?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
And if the problem were say 20 pens and 16 to 1 types
What?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
What I am saying is casework is a very clumsy way of working sufficient for small problems only.
You are right, it is difficult to program though.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
I know, I dislike casework, too, but tend to use it if it seems possible.
Have you programmed it?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
Yes I did. But it refuses to get the answer I want.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Can you post the code you currently have?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
s = {{r, 1}, {r, 2}, {b, 1}, {b, 2}, {b, 3}, {g, 1}, {g, 2}, {g,
3}, {g, 4}};
ans = Permutations[s, {4}];
ans1 = Select[ans, Length[Union[#[[All, 1]]]] >= 3 &];
ans2 = Select[ans1, Length[Union[#[[All, 2]]]] == 4 &];
Union[Sort[#] & /@ ans2]
This is the output
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
The definition of ans2 is incorrect.
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
What would you do from there?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
What did you try to do to get ans2, ie. what did you think Select[ans1, Length[Union[#[[All, 2]]]] == 4 &]; would do?
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline