A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

Pset3 Problem 3 I don't understand what the code is supposed to do? Can someone please explain in simpler terms?

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

    I made the program without really knowing in full how the code works. I understand what the outputs should be and how to get em to output but I don't understand why the outputs are what they are.

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

    on the last page of the link you posted, , it talks about substitution or finding matches, does that help in understanding the use of the output?

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

    This is what I did http://dpaste.com/hold/528512/. Its kind of hard to explain I understand the syntax of how the program works but I guess what I don't understand is the mathematics on how the n+m+1==k gives you possible solutions

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

    sorry forgot to say in my program its if n+length+1==k but yea thats the part I don't understand.

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

    i'm looking at it now. one sec

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

    i'm starting to think that n+m+1=k might not be true for all possible situations especially empty string and "blah blah.. " case

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

    but thats what it said to do in the pset directions. Can you explain what it actually does to me because I only put it in because thats what the directions said I have no clue what it means.

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

    let's take the example 'a' and 'gc' 'a' is at index 5 , and 5+ (length of a)+ 1 gives 7 the index of gc in the target string or the large string " ATGACATGCA"

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

    does this help any?

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

    first tuple really is ( 0,3,5,9) and 0,3,9 don't satisfy the condition n+m+1 = k - > 0+1+1, 3+1+1, 9+1+1 -> 2,5,11 is not equal to 7 (index of gc in the target string)

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

    yes this somewhat helps how would I fix it so that it doesn't give wrong answers?

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

    what part of n+m+1 = k doesn't help at the moment? what input gives you errors? is that input appropriate at all? Remember it says split the key string into two parts

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

    i looked at the code in http://dpaste.com/hold/528512/ you can remove "count" from subStringMatchExact function

  14. 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.