CSC_MidtermPrep_01

  1. What is a two-language problem?
    The two-language problem refers to the fact that many scientific codes are prototyped in a slow but flexible language (to test an idea quickly) but then have to be moved to a faster but less flexible language for practical applications. Translating from one language to another both slows things down and introduces bugs.
  2. How does Julia address the 2-language problem?
    Allows for flexible prototyping which can be replaced by a fast optimized code
  3. When was DNA discovered as the physical carrier of hereditary information (also which experiment?)
    • 1943, Oswald and Avery
    • "transforming principle"
    • R and S strain pneumococcus experiment in mice
  4. What was discovered in 1950, by Edwin Chargaff?
    complementary base pairing between AT and GC
  5. What was discovered by Walter Flemming, 1878?
    DNA is densely coiled and packed into chromosomes
  6. Overview of basic DNA terms (~10 terms)
    Image Upload 2
  7. Where in dna might we use motif discovery?
    to identify transcription binding sites
  8. Facts about the human genome:
    • all cells have the same genome (all cells came from repeated duplication events starting from an initial cells)
    • human genome is 99.9% similar between individuals
    • human genome is 3 billion bp long (~1.8 m stretched out)
  9. Why do we study Bioinformatics?
    • DNA sequencing has created massive amounts of data that can only efficiently be analyzed with computers
    • As the information becomes greater and more complex, more computational tools are needed to sort thru the data
  10. DNA hard drives
    • memory of every cells that tells how to create the entity it was found in
    • potential way to store computer information
    • Was able to transcribe pdfs of watson and crick, shakespeare's sonnets, and audio files of MLK's "I have a dream speech"
  11. Describe a basic computational problem:
    You have a specific input and a problem you want to solve for (the output)

    We have a task we want to solve for
  12. Principles of algorithm design:
    • Exhaustive search or brute force
    • Branch-and-bound
    • Dynamic programming
    • Divide-and-conquer
    • Randomization
    • Heuristics
  13. Time complexity of an algorithm (RAM model):
    Time Complexity: Basic operations take constant time. The running time of an algorithm is the total number of basic operations executed.
  14. What are basic operations and what are some examples?
    They are  basic computations performed by an algorithm, largely independent from the programming language

    • Examples:
    • –Evaluating an expression
    • –Assigning a value to a variable
    • –Indexing into an array
    • –Calling a method
    • –Returning from a method
    • –Comparing two values
  15. Inspect the pseudocode. What is the maximum number of basic operations executed by the algorithm, as a function of the input size?
    Image Upload 4
    • Total: 6n-3
    • Image Upload 6
    • finding index =1
    • assigning value =1
    • for each iteration in a loop, each step multiplied by (n-1) = # of steps needed

    *** we focus on characteristic operations***
  16. What is the characteristic operation here?
    Image Upload 8
    n-1
  17. When analyzing an algorithm, what is the goal?
    What is best, worst, and average case?
    • Show algorithm is correct
    • Most algorithms transform input objects into output objects, and their running time grows with the input size.

    –Identify basic operations and problem size.

    –Count number of basic operations as function of problem size.

    Worst case: MAXIMUM number of basic operations over ALL inputs of size n.

    Best case: MINIMUM number of basic operations over ALL inputs of size n.

    Average case: AVERAGE …
  18. What is an algorithm?
    An algorithm for solving a computational problem is a well-defined procedure that takes a set of values as input and produces in a finite number of steps the output.
  19. What are the main ways we have looked at analyzing an algorithm?
    Time (runtime) and space (memory)
  20. Example: Insertion sort
    Image Upload 10
    What is the best, average, and worst case?
    • Best case: (n-1) comparisons
    • Average case:
    • Worst case: if i is the smallest element among all the already sorted prefixes Image Upload 11
  21. big-Oh:
    Image Upload 12
    Image Upload 13

    if f(n) is asymptotically less than or equal to g(n)
  22. big-Omega:
    Image Upload 14
    • Image Upload 15
    • if f(n) is asymptotically greater than or equal to g(n)
  23. big-Theta:
    Image Upload 16
    • Image Upload 17
    • if f(n) is asymptotically equal to g(n)
  24. Which algorithm has the better run time?
    Image Upload 19
    • Algorithm 2 (linear)
    • Image Upload 21
  25. Image Upload 23
    Image Upload 25
  26. Image Upload 27
    • Image Upload 29
    • Image Upload 31
  27. Image Upload 33
    Image Upload 35


    The big-Oh notation gives an upper bound on the growth rate of a function

    The statement “f(n) is O(g(n))” means that the growth rate of f(n) is no more than the growth rate of g(n)

    We can use the big-Oh notation to rank functions according to their growth rate
  28. What are the three Big-Oh rules?
    Image Upload 37
  29. What should we think of when we see f<g?
    Let f<g denote "f grows asymptotically slower than g"

    • i.e. if f∈O(g) then you can use the rule for poly-logarithmic functions:
    • Image Upload 38
  30. for asymptotic comparisons in Big-Oh notation, how should we compare: n, log, log(log)?
    powers of n dominate powers of the log, which dominate powers of the log(log)
  31. Describe big-Omega in terms of a constant (c >0) and an integer constant Image Upload 39
    Image Upload 41
  32. Describe big-Theta in terms of a constant (c' and c'' >0) and an integer constant Image Upload 42
    Image Upload 44
  33. More big-Oh rules (big-Theta):
    when is f∈Θ(g)?
    Image Upload 46
  34. More big-Oh rules (little oh):
    f∈o(g)
    Image Upload 48
  35. More big-Oh rules (little omega):
    f∈ω(g)
    Image Upload 50
  36. Little 'oh' includes Big Theta?
    T/F
    False
  37. More big-Oh rules:
    all logarithms are asymptotically equivalent
    T/F
    True
  38. More big-Oh rules:
    asymptotically, exponential functions grow slower than polynomials and logarithms
    T/F
    False
  39. Lexicographical ordering for the following functions:
    a. Image Upload 51
    b. Image Upload 52
    c. Image Upload 53
    d. 1
    e. Image Upload 54
    • a. (0,-1, 0)
    • b. (0, -0.5, 0)
    • c. (1, 0, -1)
    • d. (0, 0, 0)
    • e. (0, 0, 1)
  40. Rank the following in order from fastest to slowest:
    a. Image Upload 55
    b. Image Upload 56
    c. Image Upload 57
    d. 1
    e. Image Upload 58
    c, e, d, b, a
  41. The type of problem where you can check an optimal solution but you cannot compute in polynomial time
    NP
  42. Define when problem P is called intractable
    • if there exists no polynomial-time algorithm to solve it
    • Intractability is a property of the problem not of any one algorithm to solve it.
    • note: just because we don't know the poly-time algorithm for P, does not make P intractable
  43. Why are polynomial time problems important?
    Poly-time is important because, for large problem sizes, non-poly-time algorithms will take forever to execute
  44. How is a polynomial time algorithm defined?
    • A polynomial-time algorithm has a  worst-case running bounded by a polynomial function
    • Image Upload 60
  45. How can we group different sort of computational problems into three categories?
    1. Problems for which we know poly-time algorithms

    2. Problems that have been proven to be intractable

    3. Problems for which we don’t know a poly-time algorithm, but no one has proven that one doesn’t exist either
  46. Example of a problem discussed that requires a non-polynomial amount of output/processing time
    • Determining all Hamiltonian Circuits
    • (n-1)! circuits in the worst case
  47. Example of a problem discussed for which has no algorithm that can always compute the correct solution?
    • The Halting Problem
    • these are undecidable problems and very few exists, Haltings is a classic
  48. What are some problems in the "Unknown Category" of computational problem?
    Many problems belong to the category:

    0-1 Knapsack, Traveling Salesperson, m-coloring, Hamiltonian Circuits, etc.
  49. What does the "Unknown Category" mean when describing a computational problem?
    We don't know whether they are tractable or intractable
  50. Define an intractable problem
    if there exists no polynomial-time algorithm to solve it
Author
saucyocelot
ID
362925
Card Set
CSC_MidtermPrep_01
Description
midterm prep questions
Updated