Five ways to deal with classic "Chicken and Rabbit Problems" with Excel

Source: Internet
Author: User

"Chicken and rabbit Problem" is a classical mathematical problem, originated from the ancient Chinese four or five-century mathematical works "grandson Count". The 31st of the books is entitled: "There are pheasants, rabbits and cages, with 35 heads and 94 feet below." How about the pheasant and the rabbit geometry? The solution to the original works is: "On the head of the department, the foot is placed." Half a foot, to the head to remove the foot, to the foot to remove the head, that is. "The specific solution namely: the total number of heads (35) and the total foot (94), the total number of feet divided by two, and then subtract the total number of head (94÷2-35), the number of rabbits to 12, total head minus the number of rabbits 35-12 to get the number of chickens 23."

The chicken rabbit problem itself is not difficult, using the 2-yuan 1-time equations of the elimination algorithm, you can quickly get the answer. We can try to use Excel to provide a variety of computing tools to calculate, not only fun, but also to deepen the integration of Excel features, for the teaching of Excel teachers, is a typical problem more than the solution of the material.

First, using the IF function to test the solution

As shown in Figure 1, create a two-dimensional table, assuming that the number of chickens is B2 as the cell that requires solution, the total head number and the number of feet of the chicken Rabbit were written into D2 and D3 cells respectively, and the formula was written in other cells using the known conditions: the number of rabbit heads = Total number of heads-head count, so the =d2-b2 in C2 cells; chicken feet = number of chickens * 2, the B3 cell is written to =b2*2, the number of rabbit feet = Rabbit head number *4, so C3 cell write =c2*4.

Next we enter a judgment formula in any other cell (using the F1 cell in this example), the formula is =if (D3=B3+C3, "positive solution!", IF (D3>B3+C3, "High", "low")). The essence of the formula is to judge the relationship between the number of chicken feet + the number of feet and the total number of feet, if the expression d3=b3+c3 result is true, it means that we have got the correct answer.

Finally, an arbitrary integer in the B2 of 35 is applied to the heuristic solution. If the input value is higher than the positive solution, the Judge cell F1 will prompt "high", if the value is less than the positive solution prompts "low", the user prompts to continue to enter another number, until the correct answer 23,f1 cell will display "positive solution!".

This method is more intuitive, but very clumsy, requires manual intervention. Even if the user is smart enough to use the split test, it requires multiple inputs to solve the problem, which is almost impossible for a larger problem.

Fig. 1 using the IF function to test the solution

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.