Results 1 to 2 of 2

Math Help - Combination of codes

  1. #1
    Newbie
    Joined
    Jun 2012
    From
    ireland
    Posts
    1

    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?


    thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Apr 2012
    From
    us
    Posts
    9
    Thanks
    2

    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: September 12th 2010, 02:58 AM
  2. Codes
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: August 12th 2010, 03:36 AM
  3. Compact codes
    Posted in the Advanced Math Topics Forum
    Replies: 0
    Last Post: November 13th 2007, 04:52 AM
  4. Codes
    Posted in the Number Theory Forum
    Replies: 1
    Last Post: September 9th 2007, 02:06 AM
  5. Some codes . . .
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: June 18th 2007, 08:21 PM

Search Tags


/mathhelpforum @mathhelpforum