# Puzzle | Eliminating Virus from a Computer Network

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 X_{r} infected computers if there are at least X_{r} virus-infected computers in the network when ‘X’ is applied. But it will cause X_{new} new virus-free computers in the network to be infected with the virus.

Details of the antivirus software packages are shown below:

Antivirus Software | X_{r} |
X_{new} |
---|---|---|

A | 25 | 4 |

B | 14 | 0 |

C | 8 | 15 |

D | 32 | 18 |

E | 50 | 1 |

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?

**Answer:**

No.

**Solution: **

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.

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.

## Recommended Posts:

- 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
- Controlled Access Protocols in Computer Network
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 85 | Chain Link Puzzle
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle | 3 Priests and 3 devils Puzzle
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 36 | (Matchstick 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 contribute@geeksforgeeks.org. 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.