Suppose our input data to a map-reduce operation consists of integer values (the keys are not important). The map function takes an integer i and produces the list of pairs (p,i) such that p is a prime divisor of i. For example, map(12) = [(2,12), (3,12)].
The reduce function is addition. That is, reduce(p, [i1, i2, ...,ik]) is (p,i1+i2+...+ik).
Compute the output, if the input is the set of integers 15, 21, 24, 30, 49. Then, identify, in the list below, one of the pairs in the output.
(5,49)
(3,107)
(5,45)
(3,75)
3 answers
(3,90)
(3,75)
prime no:2,3,5,7,11,..........
15:[3,15],[5,15]
21:[3,21],[7,21]
24:[2,24],[3,24]
30:[2,30],[3,30],[5,30]
49:[7,49]
by combining all common elements part i.e compare left element and add rightmost element of that to get the solution.
[2,(24+30)],[3,(15+21+24+30)],[5,(15+30)],[7,(21+49)]
so, Ans:([2,54],[3,90],[5,45],[7,70])
according to question:Ans is [5,45] .
15:[3,15],[5,15]
21:[3,21],[7,21]
24:[2,24],[3,24]
30:[2,30],[3,30],[5,30]
49:[7,49]
by combining all common elements part i.e compare left element and add rightmost element of that to get the solution.
[2,(24+30)],[3,(15+21+24+30)],[5,(15+30)],[7,(21+49)]
so, Ans:([2,54],[3,90],[5,45],[7,70])
according to question:Ans is [5,45] .