Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 20 Online
OpenStudy (anonymous):

Hi. I am just starting problem set 3 (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset3.pdf) and I am not exactly sure what they are asking in problem set one. Is there some advice someone can give me to get me started and maybe explain a little background for this homework. Thanks! (listening to Ave Maria performed by Pavarotti)

OpenStudy (anonymous):

It should work like this: there is a built-in function in Python (namely, find) that will return the starting index of the first occurrence of a given pattern. But, like it is written here, it will return in the first match, rather than checking the entire string for more occurrences. Hence, something like: find("aaatcatgcttatgc", "atgc") will return 5, while something like find("aaatcatgcttatgc", "bbb") will return -1 (default not found value). Your job is to write two functions, one recursively defined (that calls itself) and one not, to find all occurrences of a given pattern in a string. p.s.: If you like classical music, do you know contemporary classical music like Philip Glass, Max Ritchie, and Steve Reich? They are pretty good :-)

OpenStudy (anonymous):

Typo: I meant finding the number of occurrences of a given pattern in a string.

OpenStudy (anonymous):

i do like them especially philip glass....so bmp am i supposed to be using the find() function in my program or am i supposed to make my own find function that finds all the patterns?

OpenStudy (anonymous):

erthbound0, write functions that use the find function. The find function by itself stops searching after it finds one match. You need to find all matches. Also, Phillip Glass is really good.

OpenStudy (anonymous):

guys i need some help. Im going back to school for a second bachelors in computer science. I was always the top of my class and did well on tests, but I seem to be struggling with this stuff and am worried about being able to do the classwork. Is this common to all people starting out? Am i expecting too much of myself at this stage?

OpenStudy (anonymous):

@erthbound0 Mate, I consider myself a somewhat intelligent person, at least, someone with a mind to search and discover, and I found programming, in the beginning, very hard. I quit watching 6.00 lectures online for some time. I returned to it after a while with a fresh mind and a bit more mature, and I still found it hard, but this time extremely fascinating, and eye-opening. I do believe that it is normal that the course is hard, especially for us beginners. With hard work, you will start to find it really cool. You might even have an epiphany :-) If anything, don't give up. Fiddle around Python, start programming your own stuff, read what you think suits you, and you will be fine.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!