A community for students.
Here's the question you clicked on:
 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?
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

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Here is link to the pset http://ocw.mit.edu/courses/electricalengineeringandcomputerscience/600introductiontocomputerscienceandprogrammingfall2008/assignments/pset3.pdf

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I 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.

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0on 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?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0This 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

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0sorry forgot to say in my program its if n+length+1==k but yea thats the part I don't understand.

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0i'm looking at it now. one sec

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0i'm starting to think that n+m+1=k might not be true for all possible situations especially empty string and "blah blah.. " case

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0but 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.

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0let'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"

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0first 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)

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0yes this somewhat helps how would I fix it so that it doesn't give wrong answers?

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0what 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

Shriram
 5 years ago
Best ResponseYou've already chosen the best response.0i looked at the code in http://dpaste.com/hold/528512/ you can remove "count" from subStringMatchExact function
Ask your own question
Sign UpFind more explanations on OpenStudy
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
 Engagement 19 Mad Hatter
 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.