Amcat Number System 2


In the recent TCS placement test, the following question was asked.  Do you know how to solve this?

can be packed in sets of 10 oranges in box type A or 25 oranges in box
type B. A carton comprising of 1000 oranges of type a and b is packed.
How many different combinations are possible in the number of type A and
type B boxes while organizing the oranges?

a. 21
b. 20
c. 19
d. 18

integers solutions is one of the important question that is being asked
in the recent exams. We will discuss some interesting methodologies to
solve them.
a system of equations has two variables, we need atleast two equations
to solve them.  But what if, we are given only one equation?
taking my date of birth, my date is multiplied by 31 and month is
multiplied by 12 and given the product as 494.  Can you determine my
birth date and month?
Take an equation ax+by=kax+by=k. 
This is in the format of A+B=kA+B=k. As kk is constant, If AA increases, BB should decrease.  The question is, by how much?  Simple. If “AA” reduces by “bb” (the coefficient of y), B should increase by “aa” (the coefficient of x) and vice versa.
example, 5x + 3y = 100. One solution for this equation is (20, 0). Now
the next solution is (23, -5), (26, – 10) …. or (17, 5), (14, 10),

But some times this is not that much straight forward. 

Interesting Question:

By multiplying my birth date by 31 and month by 12, I got a total of 494.  Can you tell me birth date and month? 
31x + 12y = 494.
Finding the first solution is not easy in this case. So we follow a special procedure:
Now certain other clues might help us to solve this questions. Here date and months cannot be negative and both are integers.
So follow a special procedure to find the answer to this questions.
We now send the intezer terms to the left and assume the expression on the left side as ‘k’.
we use a simple trick here. We multiply both sides with an intezer so
that after dividing the ‘7x’ term by 12 we have to get remainder of ‘x’.
 Here we have to multiply it by 7.
Again send the intezers to the left and assume it as “mm”.
⇒x=2−12m⇒x=2−12m  – – – – – –  (1)
Now we substitute this value of x in original equation.
=> 31(2–12m)+12y=49431(2–12m)+12y=494
y=31m+36y=31m+36 – – – – – (2)
We got ⇒x=2−12m⇒x=2−12m and y=31m+36y=31m+36
So x, y and positive numbers. So m can take 0, -1, -2 …
For m = 0, we get x = 2 but y = 36. But month cannot be more than 12.
For m = -1, we get x = 14, y = 5. This is a possible solution. For m = -3 we see month becomes negative.
So 14th May is the given date and month.