There are N secret agents each know a different piece of
secret information. They can telephone each other and
exchange all the information they know. After the telephone
call, they both know anything that either of them knew
before the call.

What are the minimum number of telephone calls needed so
that all of the them know everything?

Answers were Sorted based on User's Feedback



There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / guest

(2N - 3) telephone calls, for N = 2,3

(2N - 4) telephone calls, for N > 3

Divide the N secret agents into two groups. If N is odd, one
group will contain one extra agent.

Consider first group: agent 1 will call up agent 2, agent 2
will call up agent 3 and so on. Similarly in second group,
agent 1 will call up agent 2, agent 2 will call up agent 3
and so on. After (N - 2) calls, two agents in each the group
will know anything that anyone knew in his group, say they
are Y1 & Y2 from group 1 and Z1 & Z2 from group 2.

Now, Y1 will call up Z1 and Y2 will call up Z2. Hence, in
next two calls total of 4 agents will know everything.

Now (N - 4) telephone calls are reqiured for remaining (N -
4) secret agents.

Total telephone calls require are

= (N - 2) + 2 + (N - 4)

= 2N - 4

Let\'s take an example. Say there are 4 secret agents W, X,
Y & Z. Divide them into two groups of 2 each i.e. (W, X) and
(Y, Z). Here, 4 telephone calls are required.

1. W will call up X.

2. Y will call up Z.

3. W, who knows WX will call up Y, who knows YZ.

4. X, who knows WX will call up Z, who knows YZ.

Take an another example. Say there are 5 secret agents J, K,
L, M & N. Divide them into two groups i.e. (J, K) and (L, M,
N). Here, 6 telephone calls are required.

1. J will call up K.

2. L will call up M.

3. M will call up N. Now M and N know LMN.

4. J, who knows JK will call up M, who knows LMN.

5. K, who knows JK will call up N, who knows LMN.

6. L will call up to anyone of four.

Is This Answer Correct ?    20 Yes 10 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / harsh

N-1

Is This Answer Correct ?    9 Yes 6 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / m.n.prakash

N-1
EX:
take N=4 then.....
N1 call to N2,N3,N4.so N1 can know information from those
three.then N2 call N3,N4 and know info from both.finally
N3 call to N4 and know the info from N4.so totally need the
only 4 calls to know each others.
so i can that only they need 4 phone calls.

Is This Answer Correct ?    6 Yes 6 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / max

The minimum number of calls required are: (n-1)+(n-2) = 2n-3

First agent needs to call n-1 agents to get all the
information. At the end of his last call i.e. (n-1)'th call,
the first and the n'th agent know all the information.
Now, if the first agent calls the remaining (n-2) agents,
all the information is shared between all agents.
It would not matter if the number of agents were even or odd.

Is This Answer Correct ?    0 Yes 1 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / manish kumar verma

a--->b = a calls to b
let say n peoples are {n1,n2,n3....nN}

step 1:n1--->n2 , n3-->n4 , n5-->n6....
step 2:n1-->n3, n5-->n7, n9-->n11 ..
step 3:n1-->n5, n9-->n13...
.
.
.
so on.
So in total minimum n-1 calls in both n even or odd..

Is This Answer Correct ?    3 Yes 5 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / fayaz

ANS:2(N-1)

Is This Answer Correct ?    0 Yes 3 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / abhinay

if we suppose n=2
then minimum 1 call is needed to share the message to each
other.
if n=3 then 2+1 call
if n=4 then 3+2+1 call
similarly for N=n then (n-1)+(n-2)+(n-3)+.........+1 call
needed to share the message to each other

Is This Answer Correct ?    2 Yes 6 No

There are N secret agents each know a different piece of secret information. They can telephone eac..

Answer / guest

N(N-1)

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Puzzles Interview Questions

How many possible combinations are there in a 3x3x3 rubics cube? In other words, if you wanted to solve the rubics cube by trying different combinations, how many might it take you (worst case senerio)? How many for a 4x4x4 cube?

1 Answers  


Please convert 13 LETTERS- "FTOGUNIROIYWA" INTO THREE WORDS RELATED TO LOVE.?

4 Answers   Infosys,


Given a sequence of integers, there are a few sequences which result in balanced binary search trees i.e., AVL trees. Write a program that takes a sequence of integers as input and outputs the number of such sequences that result in the balanced binary search trees. Input Format: Single line contains sequence of integers terminated by -1. Output format: Print the number of AVL tree possible from that input sequence. Sample Input: 1 2 3 -1 Sample Output: 2

0 Answers   TCS,


In a certain game, if 2 wixsomes are worth 3 changs, and 4 changs are worth 1 plut, then 6 plutes are worth how many wixsomes?

3 Answers  


how would u find d exact number of white maruti cars in mumbai???

15 Answers   Bhel, Infosys, RR, TCS,






Two trains at speed 60 km/hr comes in the opposite direction. At a particular time the distance between the two trains is 18km. A shuttle flies between the trains at the speed of 80 km/hr. At the time the two trains crashes what is the distance traveled by shuttle?

4 Answers   CTS, iGate, UGS,


A blindfolded man is asked to sit in the front of a carrom board. The holes of the board are shut with lids in random order, i.e. any number of all the four holes can be shut or open. Now the man is supposed to touch any two holes at a time and can do the following. ? Open the closed hole. ? Close the open hole. ? Let the hole be as it is. After he has done it, the carrom board is rotated and again brought to some position. The man is again not aware of what are the holes which are open or closed. How many minimum number of turns does the blindfolded man require to either open all the holes or close all the holes? Note that whenever all the holes are either open or close, there will be an alarm so that the blindfolded man will know that he has won.

4 Answers  


If a monkey climbs 3 mts and then slips back 2 mts in alternate hour , how much time he will take to climbs 20 mts?

10 Answers  


Substitute digits for the letters to make the following addition problem true. W H O S E T E E T H A R E + A S ------------------- S W O R D S Note that the leftmost letter can't be zero in any word. Also, there must be a one-to-one mapping between digits and letters. e.g. if you substitute 3 for the letter H, no other letter can be 3 and all other H in the puzzle must be 3.

1 Answers  


4 cards are placed on a table, each card has two colors. U don't know the color of the back side of eachcard.4 persons A B C and D are sitting on the table before the cards. They can see Red, Green Red and blue.Out of the 4 poeple 2 always lie. They see the color on the reverse side and give the following comment A: Yello/green B: Neither Blue/nor Green c: Blue/Yello D: Blue/ Yello find out the color on the other side of the 4 cards. No. of animals is 11 more than the no. of birds. If the no. of birds were the no. of animals and no. of animals were the no. of birds( ie., interchanging no.s of animals and birds.), the total no. of legs get reduced by one fifth (1/5). How many no. of birds and animals were there?

0 Answers   Infosys,


plz send me aptitude test questions on my email id bpraichur@gmail.com

0 Answers  


1. There are six columns of coins and there are eight coins in each column. One of the columns is entirely of fake coins and other five columns contain real coins. Weight of one fake coin is 1 gm more than the real coin which is 50 gm. How you can tell which column contains fake coin by single weight? 2.You want to purchase a two wheeler. You got three options from the counter. 1) Pay Rs. 40,400 on single payment 2) Pay Rs. 20,000 now and remaining by two equal annual installment of Rs. 11,600 3) Pay Rs. 15,000 now and remaining by three equal annual installment of Rs. 10,000 Which option is most attractive? (Take annual interest rate 9%)

4 Answers  


Categories