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.
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.
- Computer Network | DNA Cryptography
- Computer Network | TCP flags
- Computer Network | TCP Connection Establishment
- Computer Network | Inside a Router
- Computer Network | Types of MANET
- Computer Network | Token Bus (IEEE 802.4)
- Computer Network | Image Steganography
- Computer Network | Address Resolution in DNS
- Computer Network | Efficiency Of Token Ring
- Computer Network | Classification of Routing Algorithms
- Computer Network | Controlled Access Protocols
- Computer Network | Quality of Service and Multimedia
- Computer Network | Multiplexing (Channel Sharing)
- Computer Network | Asynchronous Transfer Mode (ATM)
- Computer Network | Framing In Data Link Layer
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.