Results 1 to 2 of 2

Thread: Combination of codes

  1. #1
    Jun 2012

    Combination of codes

    Hi all,

    I have been trying to figure a way of combining many codes per each individual subject ID. (each code represents a food consumed). What is the best programme to do this and how would this be done?

    Follow Math Help Forum on Facebook and Google+

  2. #2
    Apr 2012

    Re: Combination of codes

    IF each food was either consumed or not and wasn't trying to count how many times it was consumed AND you didn't have too many different foods THEN you could create a list 1=banana, 2=apple, 4=potato, 8=pork, 16=etc, etc, etc. You just add up all the numbers and the total includes all the codes for all the foods. To extract the individual food codes you use remainder after division. What you are really doing is using one bit per code here.

    You have not provided any information about what application this needs to be compatible with or how many codes you need to use. Some applications are more likely to accept long strings than they are huge numbers. If you need more than will fit in your number then you could use a similar encoding with ascii characters, except you start with a string of blanks. You are using the same one bit per code and just starting with blanks instead of zero because many applications might be less happy with a string containing nulls or control characters. Look at ASCII - Wikipedia, the free encyclopedia and try to see how you might be able to get six or seven bits in every character to represent six or seven foods and use a string long enough to have one bit for every food you need.

    Lots of programs could do things like this, the choice depends on what you are familiar with, what other people you are working with are familiar with, whether you want to pay for this or must get it for free, how much time you want to spend learning how to use this, etc, etc, etc
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. linear codes
    Posted in the Advanced Algebra Forum
    Replies: 0
    Last Post: Sep 12th 2010, 01:58 AM
  2. Codes
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: Aug 12th 2010, 02:36 AM
  3. Compact codes
    Posted in the Advanced Math Topics Forum
    Replies: 0
    Last Post: Nov 13th 2007, 03:52 AM
  4. Codes
    Posted in the Number Theory Forum
    Replies: 1
    Last Post: Sep 9th 2007, 01:06 AM
  5. Some codes . . .
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: Jun 18th 2007, 07:21 PM

Search Tags

/mathhelpforum @mathhelpforum