So one of my colleagues reading yesterdays blog shouted out to me across the office “You only like architecture because you are a c**p developer”. I took this as British humour (I hope!) however it is reasonably accurate; I am a poor programmer. The last time I had to do any serious programming was 5 years ago when I had just started at the Office Strategy Group in Microsoft at

So whilst I am a poor developer I am actually a pretty good architect. Indeed most architects I know are not great programmers and most great developers I have come across are not very good architects. This is of course a generalisation but I think its a reasonably valid one (and please lets not have the “My Aunty Gertrude is a red hot C# programmer working on the Longhorn Kernel and she architected the whole of the Megabank customer processing systems in a day on a napkin” comment, there are always exceptions!)

I think this is because the skills required to be a good architect are subtly different from that of a good developer; typically an architect is working with complex, multidimensional and in many cases conflicting requirements and solutions whilst a developer is working a complicated set of programming constructs and techniques. Typically developer problems are solved by the well known divide and conquer (D&C) approach; however D&C does not work for architectural problems because of their multidimensional nature. Typically good architects work with a simulated annealing approach to problem solving where you expand the problem domain and then use D&C. This means that architects are much more comfortable with multidimensional complexity; it also means they are a lot slower in getting a solution, especially if the problem is simple!

I have done a ton of interviewing of architects and typically look for this simulated annealing in their problem solving approach using a number of architectural problems that I have come across that cannot be solved by D&C (in fact make the problem worse). One of my favourite non technical interview questions is very simple and designed to see how people analyse problems. Their response allows you to categorise them roughly into mathematical, logical or analytical thinkers. Developers tend to be logical, architects tend to be analytical, I not sure what the mathematicians are! Again, these are generalisations so please don’t tell me about your Auntie Gertrude. Here’s the question if you want to see what you are:

I have a cup of coffee and a cup of tea. I take a teaspoon full of coffee and put it in the tea. I then take a teaspoon of the tea and put it in the coffee. Which is the purest, the coffee or the tea? Explain your thinking.

I will put the answer to this in the feedback. Have fun!

Most people use a logical approach to this problem the first time and that will give you the coffee as the purest. This is the wrong answer. You tell them it is wrong and ask them to do the problem again, again explaining their thinking. There are now two approaches, the mathematical (which is actually quite difficult) and the analytical which is very easy. The key to the analytical approach is to take the limit case, if I put a cup full of coffee in the tea and then a cup full of the tea + coffee in the coffee cup then the answer becomes obvious… they are the same.

WHAT?!?!?!?!?!

ðŸ™‚

How about physicist, who will ask you to accurately define term ‘purity’, cofee and tee surface tension and their density to evaluate the ‘purity’? Do I have a chance to be a good archtect? ðŸ™‚

Nope, that’s a pretty typical dev response actually! ðŸ™‚

Hehe – I thought logical (probably why i am still a programmer!)

Well I dont want to sound strage or anything, but, even without using the limit I’d have said "the same" after some thinking but not thanks to the limit case. You brought back some coffee with you when you took a spoon of tea+coffee, so you’d intuitivly think you made the coffee more pure by bringing back some coffee into it, but doing so, you removed some coffee from the tea ðŸ™‚ And the exact quantity you removed that made the cofee "purer" is also what made the tea "purer", so they’re the same… I don’t know, just seems more intuitive to me that way, than the limit (which I agree works too) ðŸ™‚

To easily quantify the problem, think of ten atoms of coffee in a nano-teaspoon. Put them in the tea.

Then whatever ten atoms you take from the tea will leave the opposite matter behind. If you return 7C and 3T then 3C and 7T will remain in the tea and therefore both retain the same purity.

Now apply to any dimension and quantities and the result will always be the same.

Rule: Assuming that the structure of atoms don’t change ðŸ˜‰

I came up with the same answer as Julien Ellie for the exact same reason. It was almost intuitive that they would be the same, but I recognise this as the mathematician’s approach and in order to prove Julien’s theory is correct you have to prove that the amounts are all equivalent, which is non-trivial.

So, I still don’t get it.. ðŸ™‚ I mean, I get the answer, but I don’t get which answer maps to developer versus architect in your original post ðŸ™‚

The person who says the coffee is purer is the developer or the architect? And since that is the "wrong" answer – what does that say about the difference between developers and architects?

I sort of get the analytical approach but I find it easier to justify it mathmatically:

C – Cup of coffee

T – Cup of tea

x – Tablespoon

Tc – Final state of cup of tea after a tablespoon of coffee has been added and a tablespoon of tea+coffee has been removed.

Ct – Final state of coffee after a tablespoon of coffee has been removed and a tablespoon of tea+coffee has been added.

Tc = T + xC – xTc ………..1

Ct = C + xTc – xC ………..2

Assume C = T = y

Tc = y + xy – xTc ………..3

Ct = y + xTc – xy ………..4

Solve 3

Tc = y + xy – xTc

Tc + xTc = y + xy

Tc(1 + x) = y(1 + x)

Tc = y

Sub value of Tc into 4

Ct = y + xy – xy

Ct = y

Meaning both are the same. I’m a developer so what does this make me?

the easy way is to reduce cup to one teaspoon

Ok, so I wasnt very clear on the answer. After someone has got it wrong they can do one of 3 things:

1 Redo the Logic correctly as Julien and Sam did – that is the developer approach

2 Do the Math – I suspect that is an algorithmic person who is happiest doing the structure which the underpin the program – Is that right Confused?

3 Do the Analytic approach which is the architectural way – like Madhatter and Ian

Again milage may vary and so on

Dont think so, that was one of the best math solutions I have seen. Of course your assumtion C=T=y may not be true but simplifies things no end. Try without that and it gets much more difficult (which is where I failed when I first did it)

Maybe, but I think it could be down to a lack of imagination on my part ðŸ™‚

Definitions

V = vol in 1 cup of tea

s = vol in 1 teaspoon

dC = final vol of coffee in Tea

dT = final vol of tea in coffee

Description 1: We start with 1 cup of liquid, remove 1 teaspoon, add 1 teaspoon, the result is: V – s + s

Description 2: We start with 1 cup of cofee, remove some cofee and add some tea, the result is: V – dC + dT

Since it is the same operation (we’re just describing it differently), the resulting volume is the same. We have 1 linear equation (1st degree):

V – s + s = V – dC + dT

==> dC = dT

There is as much tea in the coffee as coffee in the tea.

Up to here, I’m on the same line as the previous answers, however for a full analysis, I think

If we define impurity as the relative volume: dC/V and purity as its one’s complement 1 – dC/V (and 1 – dT/W for the other cup) we can see that the bigger cup will be "purer". Purity will be the same only if both cups have the same size.

Assumptions

1-The spoonfuls have the same size (if the cups are the same and the spoons are different, the cup that ends up with more liquid will be purer, if both the spoons and the cups are different, it is not possible to determine the result without having more information)

2-We’re dealing with reasonably "real world" items (e.g., no negative volumes, no zero volume cups, no infinite sizes

or spoonfuls that are bigger than cupfuls)

3-We’re considering a closed system (volumes don’t change because of external reasons e.g., none of the cups have a leak, nobody takes a sip from one of the cups, evaporation doesn’t have to be considered, there are no significant temperature or pressure changes that affect the volume, etc.)

Thank you Michael, I’d heard this a long time ago but revisiting the problem was a fun exercise on examining assumptions and thinking out of the box ‘:)

At the end of the day, both tea and coffee are comprised of some molecules of tea/coffee and many more molecules of basic water with the atoms of tea and coffee simply in suspsension within the water. (a basic assumption here is combining all of the chemicals outside of the pure distilled water as tea and coffee molecules).

You have to make a lot of assumptions going either route or define a good number of givens and confirm those with the person giving the question.

Of course this thinking tends to approach the physicist approach which seemed to get lumped into the developer approach. Eusebio’s answer is the most thought out and logical, however, there should probably be some degree of bonus points for intuitive nature. You see I think architects tend to have an intuitive nature that leads them to thinking outside of the box. Architects would probably take your question, and go to Starbucks with a new drink idea. Or is that an entirely different grouping of people?

In addition to ‘divide & conquer& and ‘simulated annealing’ another approach that I have found to be very beneficial is the ‘Pareto Law’ (http://www.paretolaw.co.uk/principle.html). Tackle 20% of the complexity that gives you the 80% of the gains first. There are exceptions, of course and is dependent upon the nature of the problem to be solved.

I don’t know how coffee contributes to ‘architectural thinking’ but there are other benefits to it (http://www.sciencedaily.com/releases/2003/10/031015031251.htm).

Simulated Annealing is a good analogy and a nice way of looking at things. However, even in architectural thinking you must be able to divide and conquer to come up with an effective solution (e.g. an architectural design is made up of a number of smaller designs). The annealing analogy is a good one because as you circle your problem you are looking for flaws but the total rate of change (to the design goes down); however, I don’t really buy the "good architect/bad developer" versus "bad archtiect/good developer" metaphor.

I follow a different line of thinking. Do you possess the raw intelligence and what are your passions? The rest follows just follows suit. In my experiences, people who tend to do one thing well tend to do many things well. It’s just a matter of passion. Do you want to live in the abstract (e.g. architecture) or the concrete (e.g. implementation/developer). I do however think that if you have never done architectural work that it does take getting used to.

My 2 cents anyway.

-Mathew Nolton

BTW. I got the correct answer (but only after I circled the problem ðŸ˜‰ ) and I love doing both. Whether I am any good at one versus the other is up for debate ;).

I would assume that the cup that contained the most liquid to start with would come out the purest on average.

Look at an extreme example: take a 2 spoonful cup of coffee next to a 999 spoonful cup of tea. In the average case you will end up with a cofee that is almost 50% tea, but the tea wil at most be 0.1% coffee.

(I am probably more leaning towards your "architect" side, but I am also the one people call on when after 2 days they still can’t find the problem. Not because I have better dev. knowledge, but I am good at guiding people through the process of discovering what is wrong.)

I think coffee is a more dense extract compared to tea. The coffee stays the purist.

Whoever mentioned that the cups contained liquids? It could be ground cofee powder, and dry tea leaves. What kind of coffee it is? Mocha, French Arabica, May be there is a tea blend! Now the definition of purity is blurred…

I guess I come under the lateral thinkers…

The truth of the matter is however you slice it and dice it you are working with time sensitive contraints that define the architecture (and validate it for that period)

You have to redesign it based on real world requirements that keep changing and taking new forms. A good architecture in such scenarios lasts longer. Good architectures are never an individual’s contribution . It comes from a team whose perspectives differ on the same problem.

Because the volumes of Coffee and Tea are supposed equals, the only problem is the "net" quantity of coffee which has been exchanged by tea.

– first extreme : all the coffee is taken back

– 2nd extreme : no coffe is taken back

the result is evident : same purity

I will show that the quantity of coffee taken back is irrelevant :

suppose that you take back x quantity of coffee

Then we can simplify and simulate a spoon which size is "Normal-x"

what happen is that we are back to one of the extremes

Thanks for the sample

ok … we all agree that the purity of the coffy and the tee is the same …

(even if as noted by jay the coffe has more dense extract compared to tea)

The probleme is that the way "Analytic" guys solved the problem is totaly wrong.

Saying the purity is the same because in the limit case (taking a big spoon)

the purity is the same, is like saying 1/x equal exp(-x) because in the limit case

where x goes to infinity both functions are equal. It’s one more time an exemple

where false resoning gives good result.

By the way I am a developper with some concerns with architecture

Sorry if I mis-expressed myself

I just wanted to add a "human view" (bon sens) of the problem, that I would consider as an elegant solution

the general case is

100% coffee forth [(100-x)% + x%]

(100-x)% tea back + x% coffee

it is equivalent to

(100-x)% coffee forth

(100-x)% tea back

that is to say 100% of a logical spoon whose size is 100-x

I begin to understand the main cause of microsoft product problems ðŸ˜‰

Hi Michael,

Although I am exhausted from my Tucson trip, I came home to read your Blog page and found this problem…I hope you don’t mind, but I thought it would be fun to respond to.

I have not read the other’s responses, so that you might see into my non-technical thinking process…

Considering that the spoon size transfers of each the tea and coffee are equal, and the amount of each in each cup is also equal, I think that the coffee would be more inclined to have more of the product in question.

My reasoning: a teaspoon of coffee gets put into the tea. This becomes mixed into the tea and becomes part of it. Now, taking a teaspoon of tea (which contains an ever so small portion of coffee) and putting it into the coffee, returns an ever so slight, but a portion of the coffee back into the coffee.

How did I do…for a non technical person?

I’m sorry, I did not know what to put in the URL box, so I left it blank.

Sam

Just taste it.

But then, it’s probably a developper reaction.

Well guys, sorry to say you don’t have the right answer…

Developer or architect? neither.

You’ve go to be consultant. Isn’t a consultant someone who comes up with questions where there is no real problem, then does not provide solutions (or maybe bad ones)?

A cup of tea?

Do architects drink tea?

Programmers seem to only drink coffee.

Both cups were ruined in the expermiment.

Another solution… another way of thinking

Lets consider a red pot with 10 red marbles and a blue pot with 10 blue marbles

Take 5 from the red pot and put them into the blue one

Take any 5 marbles from the blue pot and put them into the red one.

As you are not creating marble, and because the numbers are eventually kept the same in the pots (10)

If you look at the final state, each missing blue marble in the blue pot has been replaced by a red one AND Inversely.

If it’s ok with 10 and 5, then it should be ok with the number of molecules of coffee/tea within a pot and a spoon.

As a trainer, I respect all the way of thinking that can help oneself to understand problems.

Seems a "real" architect would be asking what the original intent was behind merging the coffee and the tea in the first place? Since neither is functionally improved, more efficient, elegant or better documented… *smile*

A real architect would ask for a use-case for both, and depending on the market needs, would propose to provide a modular cup system so that we can ship the two cups and the spoon, with tea and coffee, but by making sure the design is as such that it can be replaed by orange juice and milk for the next iteration (NerdMix v.Next, to be shown in early preview at the next PDC).

ðŸ™‚

I’m not convinced by the ‘intuitive’ argument:

"And the exact quantity you removed that made the cofee "purer" is also what made the tea "purer", so they’re the same…"

Yes, removing a bit of coffee from the tea makes the tea a bit purer, and returning some coffee to the coffee makes the coffee a bit purer, but "a bit" is a bit imprecise. It doesn’t seem obvious to me that each makes its respective target purer by the same amount. It’s clear that the balance has been redressed somewhat, but by exactly the same amount? Rather than a little bit more or a little bit less?

I tend to be an intuitive thinker, but I don’t find it intuitively obvious from this argument that the two end up in exactly the same ratio. In this case my intuition tells me that it’s a close call, and I won’t know for certain without doing the maths.

I wasn’t happy until I had done the maths. The ‘analytical’ approach of examining the limits occurred to me, but while it’s instantly obvious that doing either all or nothing leaves you with equal mixes, it still didn’t seem obvious that proving the two extreme cases necessarily proved anything about the ones in between. Particularly not when one of the limit cases didn’t actually involve doing any mixing at all. All you’ve done there is drawn a straight line between one point on your scale and a point that isn’t on the scale at all.

There’s another problem. Try applying that analytical approach to deciding what the function y=x*x looks like. At x=1, we get y=1. At x=-1, we also get y=1. We therefore conclude that the function is a horizontal line…

If you’re going to plot to points and extrapolate between them, you are making an implicit assumption about the validity of that extrapolation. In this puzzle (and also my last example) you’re assuming linear behaviour – straight lines. You need to state and validate that assumption before this approach holds water. (In my last example, it does not hold, and the technique gives the wrong result – the function actually draws a parabola.)

So to me these ‘analytical’, ‘intuitive’, and ‘mathematical’ approaches seem like Hand waving, more hand waving, and maths. (I probably sound like a raving mathematician now…)

Incidentally, what is the fallacious logical argument that most people come up with to say that the coffee is purest? I’m having trouble guessing how people come to that conclusion.

You are clearly an out and out mathematician! it’s funny how different approaches are completely non intuitive to different people.

Actually even the mathematical approach makes some assumptions so could be called had waving

The strange thing is that I never really think of myself as a mathematician. I know some of my friends who are mathematicians would agree strongly. ðŸ™‚

So what is the false argument that people use to say that coffee is the purest?

(Part of me thinks: I hate tea, so to start with, the teacup is a cup of pure evil. By the end, the tea is still mostly tea, nearly pure evil, whereas the coffee is only marginally sullied, so the tea is therefore the more pure…)

Best explanation:

Both cups have the same volume (before and after the transfer). If so, after the transfer, a volume X (teaspoon) of coffee travelled to the teacup and the same volume X of tea travelled the other way. Therefore, both cups will have the same percentage purity.

My response to this question "Which is the purest, the coffee or the tea?"

=> What is the "purest" for you and after,maybe, i can answer.

I think, if there are many approach, it’s because the question is not define!!

It’s not a physic question but metaphysic question!

I’d keep it simple : usual coffee is stronger in taste than usual tea, so IMHO at the end, both in taste and colours, the tea appears to be further from its initial state, compared to the coffee.

I’ll make a real test and keep you posted!

What’s my profile then ðŸ˜‰

As I personally preferred the math way, I’ve been a bit confused by all the "demonstrations". I don’t know if I’m a developer (I began by an Excel proof of concept) or an architect (I picked the first wrong answer, checked with the one spoon limit), or an epicurean (I’ve been chocked by the mix).<br />

Doing the math way isn’t that horrible (and you said architects are not in a hurry!) if you take some simple definitions: measure cups in spoons, compare "impurity", valid that the cups contain at least a spoon of tea/coffee and of course that coffee and tea mix well physically (argghhh).<br />

Then you can say you added 1 (spoon of coffee) to the tea and then took back 1/(t+1) (t is the tea quantity in the cup at the beginning). The same way, you added t/(t+1) tea to the coffee.<br />

That way, the "coffee impurity" is (t/(t+1))/c (c is the coffee quantity in the cup at the beginning). "Tea impurity" is (1-(1/(t+1)))/t, which is (((t+1)-1)/(t+1))/t=(t/(t+1))/t. On both sides of the "impurity comparison" we can safely drop t/(t+1) as t>1 and obtain a comparison between 1/c and 1/t which means the bigger cup is the purest and if c=t, 1=1 and purity is equal.<br />

That (not so horrible) math to say a problem, IMHO, can often be seen globally (multidimensional as you say) and some simple and interesting points can be found… and proved.

I think the best approach is to submit the problem to the Open Source community and wait for 50 really smart people to figure out the answer. ðŸ˜‰ Throw in a free T-shirt to the first person with the right answer and you will get hundreds of developers looking to join in.

I think the best approach is to submit the problem to the Open Source community and wait for 50 really smart people to figure out the answer. ðŸ˜‰ Throw in a free T-shirt to the first person with the right answer and you will get hundreds of developers looking to join in.

I think the best approach is to submit the problem to the Open Source community and wait for 50 really smart people to figure out the answer. ðŸ˜‰ Throw in a free T-shirt to the first person with the right answer and you will get hundreds of developers looking to join in.

I disagree with Michael Platt analysis of the problem. If I put a teaspoon of coffee into the tea then I’ve diluted the new content to be 90% tea and 10% coffee (assuming a teaspoon is 10% of the cup). Now if I take 10% of the new content and dilute it with the coffee I get another new content consisting of 90% coffee and 10% of the diluted stuff (which consist of, assuming equal distribution, 90% tea and 10% coffee) so I would have 91% coffee and 9% tea. Now if I compare the two new diluted content A with 90% tea and 10% coffee with content B with 91% coffee and 9% tea the answer to which is the purest would imply that the coffee is the purer.

The boundary condition in this case is when you take the entire cup of coffee and dilute with the cup of tea. So the answer would be that they’re the same but this is the only condition.

Are you suggesting that to be a good architect the boundary conditions take precedence over the solution? Then I would say that good architects make poor business person. As for good developers, they would not solve the problem because there aren’t enough information ðŸ™‚

Why am I wrong…

I see that at _best_ they are equally pure.

But it is also possible that the coffee is ever-so-slightly purer, as it is possible that some percentage of the coffee is returned to the coffee cup from the tea cup so…

…oh wait, lightbulb coming on…

…however much coffee is put back into the coffee cup implies that the tea is equally purer, right?

Darn!

I hate other smart people! (j/k)

So what does this make me? Am I logical or analytical type?

…and what does it mean that:

a) I seldom have the patience to work out the numbers like Phan Le over there

b) To solve this type of problem I usually try a simplified model of the problem at one value (1 cup/1 tbsp) then change the numbers and repeat to test in different values to see if I got the same answer (1 cup/ .5 cup)

I think this problem seems so complex because we are looking at the wrong way. We should not focus on the content of the cups, but on the CONTENT OF THE SPOON.

Let’s say the first spoon pushes ‘x’ quantity of coffee in the tea cup.

The second spoon pushes back ‘y’ quantity of coffee and x-y quantity of tea.

So, there is left x-y coffee in the tea (x pushed by the first spoon, y pushed back by the second one), and there is left x-y tea in the coffee (pushed by the second spoon).

The final volumes being the same as initial volumes, and the cup sizes being supposed equal, purity are the same.

This shows also that the result is true whatever the way the tea is mixed between the 2 spoons.

I’m sorry but there IS NO spoon.

The easy way is to reduce cup to one teaspoon,in my opinion!