In a network of infinitely many computers, 650 computers got infected with certain virus. The IT support team has access to five different types of antivirus software packages (let us call them A, B, C, D and E) that can work on eliminating this virus. Each of the antivirus software packages ‘X’ can eliminate virus from Xr infected computers if there are at least Xr virus-infected computers in the network when ‘X’ is applied. But it will cause Xnew new virus-free computers in the network to be infected with the virus.
Details of the antivirus software packages are shown below:
Any of the antivirus software packages can be used any number of times in any order. But, no two antivirus software packages can be applied simultaneously. Can the network be freed from this virus using the antivirus software packages A, B, C, D and E? If yes, what is the order of the packages and if no, why?
Observe that the antivirus software packages effectively eliminate virus from 21, 14, -7, 14, 49 respectively when they are applied on the network. (-7 implies 7 new virus-free computers got infected with virus). All these number of effective changes in the virus-infected computers give zero remainder when divided by 7.
So, no matter how many ever applied how many ever times, they will not change the remainder of the total number of virus-infected systems when divided by 7. But initially 650 infected computers are there and that is 6 modulo 7. So, after any number of usages of any of A, B, C, D, or E in any order, the remainder when the total number of infected computers in the network is divided by 7 stays to be 6 constantly.
Example: Initially 650 virus-infected computers are present. Initial remainder when divided by 7 = 6
A is applied. 25 will be virus-free but 4 new are infected. So, total 629 (650-25+4) virus-infected computers are present. Remainder when 629 is divided by 7 = 6. So, on.
In short : ( 650 - 7 * some_number ) % 7 = 650 % 7 -(7 * some_number)%7 = 6 - 0 = 6 Hence , we cannot make the difference to zero in any case
This problem and solution are based on ‘principle of invariance‘.
When things are (seemingly) changing continuously, look for what core values (though hidden) are not changing.
Note that “But, no two antivirus software packages can be applied simultaneously. ” is strictly not required. Even if we apply one or more of them simultaneously, the remainder logic remains same. But it is given to ensure that we do not need to look for minimum (A+B+…) infected computers when all of the packages are applied.
- What is Computer Virus ?
- Controlled Access Protocols in Computer Network
- Types of MANET in Computer Network
- Computer Network | Quality of Service and Multimedia
- Asynchronous Transfer Mode (ATM) in Computer Network
- Multiplexing (Channel Sharing) in Computer Network
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 28 | (Newspaper Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 38 | (Tic Tac Toe Puzzle)
- Puzzle 39 | (100 coins puzzle)
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 85 | Chain Link Puzzle
- Puzzle | Elevator Puzzle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ShJos