A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

umm well a string of three characters ( T,C,G,A) , from among these, will be given to the hash function which will generate an index. Can i simply do something like this, if the input is TTT index is 0 , if TCT , index is 1 and so on

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Okay, you have 4 distinct characters and a hash function. You input a string, of a certain length and only containing only those characters, into this hash function Now, is the input string of fixed length? Like is it always three characters long?

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    just take the lexigraphical value of the string (ie. T-84, C-67, G-71, A-65) add them all together (if string is "AAA" then 65+65+65) and then modulo (%) that result by the size of your hash table. (if hash table has index size of 10 then result%10) and thats your index

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yes, the input string is of fixed length i.e 3 like TGC or TTT etc.

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    umm can you tell me what is lexigraphical value ? :$

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    A character's ASCII value: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters ChadBro's hash function is sufficient, though not perfect. This is because you can have two inputs that have the same group of characters but in different ordering. In other words, TAG and GAT would collied.

  6. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ohh yes this is what i was thinking :) Thanks alot

  7. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i don't think there can be a perfect hash function for this problem :S Some collissions would be there :S

  8. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    can you please help me with this ?? How to make a hash function with minimum number of collissions in this case ? :(

  9. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.