Question
In the Least Recently Used (LRU) page replacement
algorithm, given the following reference string 4, 2, 4, 1, 5, 2, 3, 4, and assuming 3 frames, how many page faults will occur?Solution
LRU page replacement works by replacing the page that has not been used for the longest time. For the reference string 4, 2, 4, 1, 5, 2, 3, 4 with 3 frames, the page faults occur as follows: • Insert 4 (fault), Insert 2 (fault), Access 4 (hit), Insert 1 (fault), Insert 5 (fault, replace 4), Access 2 (hit), Insert 3 (fault, replace 1), Access 4 (fault, replace 5). Thus, there are 6 page faults in total. LRU minimizes page faults compared to other algorithms by always keeping the most recently used pages in memory. Why other options are wrong: A) 3 faults would require the reference string to contain repeated pages with no replacements. B) 5 faults underestimate the replacements required after the first few frames fill up. D) 7 faults occur in algorithms with more aggressive replacements like FIFO. E) 8 faults assume no page hits at all, which is incorrect since some pages are reused before replacement.
The cost price of an article is Rs. 2500 and a shopkeeper wants to earn 12% profit on it after giving 20% discount on marked price. Find the marked pric...
A shopkeeper allows a discount of 20% on the marked price of an article and still makes a profit of 12% on the cost price. Had he allowed a discount of ...
Amazon allows 15% discount to his customers and still earn 19% profit. If the production cost of the product is increased by 12% therefore Amazon issued...
When the printer is sold for Rs. 34000, the owner loses 15%. At what price must that printer be sold in order to gain 15%?
Neha sold a product to Sanjana at a 20% profit. Sanjana then sold it to Meera, earning the same absolute profit (in Rs.) that Neha made. Finally, Meera ...
On selling an item for Rs. 900, the profit earned by the seller is 20% more than the profit earned on selling the same item for Rs. 850. If the seller a...
A retailer sells two items, K and L. He gains a 12% profit on item K, which costs Rs. 3600. If the overall profit from selling both items is 15%, what i...
A seller marked his article 65% above the cost price and sold it after offering two successive discounts of 60% and 25% respectively. In the whole trans...
A company produces two types of products, A and B. The production cost per unit for product A is ₹600 and for product B is ₹800. The company produce...
Cost price of a bag is Rs.700. The shopkeeper marked it 80% above the cost price and sold it after giving a discount of 25%. If the shopkeeper had sold ...