Electronics Forum  Help Search Members Calendar 
Welcome Guest ( Log In  Register )  Resend Validation Email 
dmg 
Posted: December 17, 2016 10:26 pm

Forum Addict ++ Group: Trusted Members Posts: 1,270 Member No.: 36,860 Joined: June 06, 2012 
okay it does sound stupid, but geesh.. i can't figure this out.
the "problem" we take a 4 digit number, and add to it it self without its last digit, then again without 2 digits, then without 3 digits, and then we get 2016. what was the number we where thinking about? so if my 4 digit number is ABCD, then ABCD+ABC+AB+A = 2016 how on earth you make an equtation that can describe this at all ?? 
PIC 
Posted: December 17, 2016 11:54 pm


Forum Addict ++ Group: Cleanup Taskforce Posts: 1,093 Member No.: 6,662 Joined: October 08, 2006 
Hi, Say the digits are A, B, C, D. That means each letter stands for a number that is between 09. ABDC (e.g 1234) is made by A*1000 + B*100 + C*10 + D ABCD doesn't mean A x B x C x D, as the letters are simply each digits 09 which you shift into the right position using x10, x100, etc. When we do that adding operation you described: 2016 = A*1000 + B*100 + C*10 + D + A*100 + B*10 + C +10*A + B + A The first line is a summation which converts the single digits A, B, C, D (each of which is 09) into the number ABDC, and same idea for ABC, etc. Collecting terms: 1111*A + 111*B + 11*C + D = 2016 You have 4 unknown digits and only one equation, whereas you need the same number of equations as unknowns in order to solve. However, from the way the question was set up, you do know that each variable must be whole number that is from 09. The only way I know how to go about this is by brute force  to try every possible combination of A, B, C, D and see if you find a solution along the way. Matlab script that does this:
Completes in an instant, and of the 10, 000 combinations it iterates through (0000 to 9999), there is one solution: A=1, B=8, C=1, D=6. So if we say the number ABCD corresponds digitwise to 1816, then 1816+181+18+1 = 2016 as sought.
I can't answer that I just coded it up I shared your confusion up that point it's more involved than it first seems.


gremlinsa 
Posted: December 18, 2016 09:09 pm

Forum Addict Group: Trusted Members Posts: 830 Member No.: 3,112 Joined: August 25, 2005 
Given the way the 'equation' is given you need to look at it a little differently...
Firstly: break it down and add a few of your own unknowns.. A+B+C+D = X6 ( or rather X*10 + 6) A+B+C+X = Y*10 + 1 A+B+Y = Z*10 + 0 A+Z = 2 Now we need to apply a few rules... 0<=A<=9; 0<=B<=9; 0<=C<=9; 0<=D<=9 ... But also, X>=0, Y>=0, Z>=0 So with A+Z=2 that reduces A and Z to <=2 If B, C & D = 9 then X<=3, and Y<=2.... (Maximum possible Carry's, Our unknowns) So now we look at A+B+Y .... if A=2, Y=2 and B=9 the max Z could be is 1... Ahh now .. we have.. 0<=A<=2; 0<=B<=9; 0<=C<=9; 0<=D<=9 ... 0<=X<=3; 0<=Y<=2; 0<=Z<=1 ... So now .. A+B+Y = Z10 (0 or 10) But A+Z = 2 so A>=1 BUT if A=2 then B+Y=8 and Z=1. Thus A=1 and Z=1... Now we have... 1+B+Y=10 or B+Y =9 1+B+C+X = Y10+1 or B+C+X=Y10 (10,20) : Ahh Y>0 Because 9+1=10 (if B=9 and leave C+X out), So now 1<=Y<=2, 7<=B<=8.. Dig in again, If B=7 then 1+8+C+X = 10+1 or C+X = 2 1+8+C+D = X10 + 6 or C+D+3 = X10 (10,20) : X cant be 0 or 3 because C or D cant be negative.. So now 1<=X<=2, 0<=C<=1.. Dig in once more, If C=0 then X=2 and D=17, No good... So C=1 and X=1.. Now we get left with 1+8+1+D=10+6 or: D=6 Solved... Without Brute Force..... ...EDIT... Fixed a error in calculations..  Give me a Break... I'm diklicsic, duskiklic.... Gawd ... F'ed in the Head...

dmg 
Posted: December 18, 2016 09:36 pm

Forum Addict ++ Group: Trusted Members Posts: 1,270 Member No.: 36,860 Joined: June 06, 2012 
uuu thank you a lot
i was able to figure out the answer, but i found no way to write it down with math. thank you for the help 
Sch3mat1c 
Posted: December 19, 2016 12:30 am

Forum Addict ++ Group: Moderators Posts: 20,553 Member No.: 73 Joined: July 24, 2002 
Nice.
 Answering questions is a tricky subject to practice. Not due to the difficulty of formulating or locating answers, but due to the human inability of asking the right questions; a skill that, were one to possess, would put them in the "answering" category.

MacFromOK 
Posted: December 19, 2016 01:53 am


Forum Addict ++ Group: Spamminator Taskforce Posts: 15,202 Member No.: 5,314 Joined: June 04, 2006 
Brute force has gotten me through a lot over the years...  Mac *
"Basic research is what I'm doing when I don't know what I'm doing." [Wernher Von Braun] * is not responsible for errors, consequential damage, or... anything. 

phin 
Posted: December 23, 2016 02:41 am


Newbie Group: Members+ Posts: 11 Member No.: 40,315 Joined: December 19, 2016 
While working as an EE manufacturing engineer, I had to come up with a program to determine how much metal to cut from a rotating part to bring it into balance. Now, I was never a math wiz and this was well beyond me. I told my boss the problem and he called in a mathematician to give me an equation. After a week of beating his head against the wall, he told me to brute force the solution. ie try an answer, look at the error resulting and modify the answer until the result was within tolerance. Worked fine and the computer did not seem to mind. Although MANY electrons were mistreated along the way! 

gremlinsa 
Posted: December 23, 2016 07:20 pm


Forum Addict Group: Trusted Members Posts: 830 Member No.: 3,112 Joined: August 25, 2005 
In a case like that you need a Engineering Mathematician... Knowledge of metal density's, rotational balancing sensor sensitivity, etc.... Bet you this is where he was banging his head!!!  Give me a Break... I'm diklicsic, duskiklic.... Gawd ... F'ed in the Head...


Ratch 
Posted: December 29, 2017 03:01 am


Newbie Group: Members+ Posts: 29 Member No.: 9,581 Joined: May 25, 2007 
This is one of the easiest problems I have come across. No need for high power math or brute force computer programs. I will let you figure out how to "mathmatize" it after I tell you how to do it. As other have pointed out, the equation for the problem is 1111 A + 111 B +11 C +D = 2016. One equation with 4 unknowns, right? How do you find A, B, C, D ? Easy. You know that A has to be less than 2, because otherwise the left side of the above equation will be greater than 2016. So A = 1. Subtract 2016  1111 = 905. You know B has to be less than 9, otherwise the above equation will be greater than 905. So B = 8. Subtract 905  888 = 17. You know that C has to be less than 2, otherwise the left side of the above equation will be greater than 17. So C = 1. Subtract 17  11 = 6. That leaves D = 6. Putting it all together we get A = 1, B = 8, C = 1, D = 6. Ratch  Hopelessly pedantic


MacFromOK 
Posted: December 29, 2017 09:46 pm


Forum Addict ++ Group: Spamminator Taskforce Posts: 15,202 Member No.: 5,314 Joined: June 04, 2006 
So where were you last December...?  Mac *
"Basic research is what I'm doing when I don't know what I'm doing." [Wernher Von Braun] * is not responsible for errors, consequential damage, or... anything. 

Ratch 
Posted: December 29, 2017 11:14 pm


Newbie Group: Members+ Posts: 29 Member No.: 9,581 Joined: May 25, 2007 
I don't get around to reading this forum very often because it moves so slowly. Especially the math thread. I will try to keep up with it and view it more often from now on. Ratch  Hopelessly pedantic


:: support us ::