+ a b b c c d d a 0 + d c c b b a 0 a d
If a , b , c and d are distinct single-digit positive integers so that the result of both additions is the same, find the number of possible quadruples ( a , b , c , d ) .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Good clear explanation of how to do the counting.
I don't think there is an easy way to do so, other than splitting it up into the cases as listed above.
Exactly same solution that I intended.
I used short and concise python code:
1 2 3 4 5 6 7 |
|
How to do this
Log in to reply
This code uses recursive to find all permutation from 1 to 4 then for each set we check the condition and increase the count. There are some methods in Python to find permutation but since I don't have Python installed, I use JS. Anyways, it's cheating :).
Well, another way is to observe that c + d = b + a
Log in to reply
Ah, then the code would be shorter (jk). Actually, I'd had this code before I got this problem so I just modified a bit to solve this problem :). But, what's next? How could we get the result with that observation? Could you post a full answer please?
Log in to reply
After that it's sort of combinatorics. I'm too lazy to post a solution though. But basically, you find the number of solutions to a + b = c + d = k from k = 2 to k = 1 7
Log in to reply
@Julian Poon – Same Method
Log in to reply
@Kushagra Sahni – Post it as solution. Please
Log in to reply
@Dev Sharma – I am an extremely lazy person once it comes to writing a solution. I know you must have got a+b=c+d. Then the value of a+b ranges from 3 to 17 so I found all possible quadrules in this way, it took me some time to do that and I hope you can easily do it.
Log in to reply
@Kushagra Sahni – yes. I found a+b=c+d but cant do after. I would try...
One message. Dont u use fb regularly?
Log in to reply
@Dev Sharma – No I don't open it regularly
Log in to reply
@Kushagra Sahni – I think you have solved this problem many days before. But how do you know solution has been provided?
Log in to reply
@Dev Sharma – I open the problems I like and reshare everyday once to see if anyone has written a solution
@Dev Sharma – Even I don't have a formal method to do that. But it is possible to count them manually :) This is only my solution.
Log in to reply
@Nihar Mahajan – Why did you delete your solution in Priyanshu Mishra's question when we had a little chat?
Log in to reply
@Kushagra Sahni – I realized my mistake which was pointed by Ivan Koswara. To avoid further misconception , I preferred deleting it. Sorry for the inconvenience caused :(
Log in to reply
@Nihar Mahajan – I also pointed out a mistake. Was I correct?
Log in to reply
@Kushagra Sahni – I don't know. But my mistake was definitely different than the thing pointed by you.
@Julian Poon – Value of k can't be 2 because a,b,c,d are distinct. It is altleast 3 and at max 17.
Yes. I manually counted few and the rest with symmetry :)
1 2 3 4 5 6 7 8 9 10 11 |
|
I used this python 3 code:
ans=0
for a in range(1,10):
for b in range(1,10):
for c in range(1,10):
for d in range(1,10):
if 1000*a+100*b+10*c+d+1000*b+100*c+10*d+a==1000*d+100*c+10*b+a+1000*c+100*b+10*a+d and a!=b and b!=c and c!=d and a!=d and b!=d and a!=c:
ans+=1
else:
pass
print (ans)
I used the same python code
Problem Loading...
Note Loading...
Set Loading...
From the conditions of the problem, c + d = a + b . We need to find ways of writing integers from 5 to 1 5 as sum of 2 distinct positive integers in 2 distinct ways.
To justify the lower bound of the sum as 5 , note that 5 is the first integer which can be expressed as sum of 2 distinct positive integers in 2 distinct ways. We can write 4 as 1 + 3 or 2 + 2 , but the latter is not allowed since the two integers must be distinct. Similarly, the upper bound of the sum is 1 5 . There is only one way to express 1 6 as sum of two distinct positive integers, that is 9 + 7 .
Below are the ways of writing 5 , ⋯ , 1 5 as sum of two distinct positive integers.
5 = 1 + 4 = 2 + 3
6 = 1 + 5 = 2 + 4
7 = 1 + 6 = 2 + 5 = 3 + 4
8 = 1 + 7 = 2 + 6 = 3 + 5
9 = 1 + 8 = 2 + 7 = 3 + 6 = 4 + 5
1 0 = 1 + 9 = 2 + 8 = 3 + 7 = 4 + 6
1 1 = 2 + 9 = 3 + 8 = 4 + 7 = 5 + 6
1 2 = 3 + 9 = 4 + 8 = 5 + 7
1 3 = 4 + 9 = 5 + 8 = 6 + 7
1 4 = 5 + 9 = 6 + 8
1 5 = 6 + 9 = 7 + 8
Let n number of possible ways to write a certain integer as sum of 2 distinct positive integers. To enumerate the number of quadruples ( a , b , c , d ) , we take 8 ∑ ( 2 n ) .
The factor of 8 is introduced to account for permutations. Note that ( a , b ) is interchangeable with ( c , d ) and the elements in ( a , b ) and ( c , d ) themselves are interchangeable.
A quick computation yields the answer.
8 ( 4 . ( 2 2 ) + 4 . ( 2 3 ) + 3 . ( 2 4 ) ) = 8 ( 3 4 ) = 2 7 2