concept reducer in category algorithms

appears as: reducers, reducers, reducer, The reducer, reducer
Algorithms and Data Structures in Action

This is an excerpt from Manning's book Algorithms and Data Structures in Action.

And to do so, he won’t have to build anything, just getting some help and using a different algorithm will do. After doing a quick computation in his head, he estimates that there are about two hundred different type of coins. So he rounds up the whole family, and gives a task to each of them: they will have to handle 5 types of coins each, but they won’t have to count them: they will receive a few lists (well, a hundred of them) from the counting machines, but each list will only have 5 entries for the same 5 types of coins, together with how many of them the individual counting machine found.

To achieve this, he provides each counting machine with an address to locate each member of the McDuck family – for instance an email address, like huey.mcduck@duckmail.com – a dictionary that is the  same for each machine and that lists the type of coins handled by each member of the family. To simplify things, we can imagine that each member is assigned all the coins from a single Country: for instance, as shown in figure 13.5, Huey could get all US dollars, Dewey all of UK’s sterling pounds, Louie all Euros and so on… But, in a real application, each of them could get any combination of coin denominations.

Figure 13.5 Revised coin counting process, using MapReduce, and a little help. Now each counting machine produces several lists, one for each member of the McDuck family at level 2. They, in turn, will have to check a hundred lists, but each with just a few entries, and sum up the values in each list by entry.