On a paper form, people are presented with 7 options, 1, 2, 4, 8, 16, 32, 64 (it doesn't what these numbers correspond to). They can select any or all of these options.
However, what is recorded in the database is a single number. If the person selected 1 and 4 and 16, the number is (1+4+16=) 21. There is no other way to achieve a score of 21 - it will always be 1+4+16. This is the same for any of the score combinations (I think!). The problem I'm now faced with is to return these scores to their constituent combinations. I could do this the long way, i.e. write down all the possible combinations and proceed from there. (We can ignore the base numbers themselves).
I'm hoping though that there is an easier way to do this. For example, 2 = 2 to the power of 1, 4 = 2 to the power of 2, 8 = 2 to the power of 4 etc etc. Can I use this in some way to achieve what I want?
Thanks for any help.
However, what is recorded in the database is a single number. If the person selected 1 and 4 and 16, the number is (1+4+16=) 21. There is no other way to achieve a score of 21 - it will always be 1+4+16. This is the same for any of the score combinations (I think!). The problem I'm now faced with is to return these scores to their constituent combinations. I could do this the long way, i.e. write down all the possible combinations and proceed from there. (We can ignore the base numbers themselves).
I'm hoping though that there is an easier way to do this. For example, 2 = 2 to the power of 1, 4 = 2 to the power of 2, 8 = 2 to the power of 4 etc etc. Can I use this in some way to achieve what I want?
Thanks for any help.