fredreload Posted August 25, 2016 Share Posted August 25, 2016 (edited) Alright, so I think I solved this algorithm, I call it the shrink ray, I got the idea from Minions. Pretty much with any number of A-B in binary, you can reverse engineer A and B from C alone knowing how many 1's and 0's there are for A and B. For example: 1010 A (two 1's, two 0's) -0101 B (two 1's, two 0's) -------- 0101 C Note: I've only tested the condition for A>B, not negative numbers Now you reverse engineer A and B from C, you know C is 5 and A and B are bigger, so you can have A=6 B=1, A=7 B=2, A=8 B=3, A=9 B=4, A=10 B=5, A=11 B=6, A=12 B=7, A=13 B=8, A=14 B=9, A=15, B=10. Now with all these conditions available, the only set that holds true with A having two 1's and B having two 1's are A=10 and B=5. So that's the solution. I think you can reverse engineer any A and B with C and the bits information on A and B. If A and B are 32 bits each, it only takes 6 bits each to store the bit information since the largest possible sum is 32, so I think it's pretty good in terms of shrinking the size down, check the math for me will ya Strange? Edited August 25, 2016 by fredreload Link to comment Share on other sites More sharing options...
fredreload Posted August 26, 2016 Author Share Posted August 26, 2016 it seems there is an exception when C is 0 where A and B can be anything, well that's the only exception I think Link to comment Share on other sites More sharing options...
Endy0816 Posted August 26, 2016 Share Posted August 26, 2016 (edited) -snip- Edited August 26, 2016 by Endy0816 Link to comment Share on other sites More sharing options...
fredreload Posted August 26, 2016 Author Share Posted August 26, 2016 (edited) Well it's easy to bypass this exception, since you only need one set of value, A or B, so set both bit count to zero(they might not be zero but this means A and B are the same) and set C to either A or B Edited August 26, 2016 by fredreload Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now