Write a program to find the ratio in which a shopkeeper will mix two types of rice worth Rs. kg and Rs. kg, so that the average cost of the mixture is Rs. kg.
Input : X = 50, Y = 70, Z = 65 Output : Ratio = 1:3 Input : X = 1000, Y = 2000, Z = 1400 Output : Ratio = 3:2
According to Alligation rule, the ratio of the weights of two items mixed will be inversely proportional to the deviation of attributes of these two items from the average attribute of the resultant mixture.
w1 / w2 = (d - m) / (m - c)
Below program illustrate the above approach:
- How to solve RSA Algorithm Problems?
- Solve the Logical Expression given by string
- Some Tricks to solve problems on Impartial games
- Fibonacci problem (Value of Fib(N)*Fib(N) - Fib(N-1) * Fib(N+1))
- Josephus problem | Set 2 (A Simple Solution when k = 2)
- Problem of 8 Neighbours of an element in a 2-D Matrix
- Shortest Superstring Problem | Set 2 (Using Set Cover)
- Exact Cover Problem and Algorithm X | Set 1
- Twisted Tower of Hanoi Problem
- Exact Cover Problem and Algorithm X | Set 2 (Implementation with DLX)
- Travelling Salesman Problem implementation using BackTracking
- Maths behind number of paths in matrix problem
- Widest Path Problem | Practical application of Dijkstra's Algorithm
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- C Program for ID3 Tagging
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.