Velocer › Flashcards › University of Wisconsin–Madison › BME 603: Computational Biological Modeling · UW-Madison
BME 603: Computational Biological Modeling · UW-Madison
My BME 603 cards from this semester, mostly computational biological modeling. good to run through before the midterm. · door quiet_kernel · 129 kaarten
- What is the focus of computational methods in biological modeling and simulation?Using computational techniques to build and simulate models of biological systems.
- Why is Git important in a computational modeling course?It provides version control, letting you track changes to code and collaborate reproducibly.
- What is the role of simulation in biological modeling?Simulation runs a model numerically to predict or explore the behavior of a biological system over time.
- In Python, what index refers to the first base of a DNA sequence stored as a string?Index 0, written seq[0].
- What does seq[-1] return for a DNA string?The last base of the sequence.
- In Python slicing seq[start:stop], is the base at index stop included?No, slicing excludes the stop index; seq[0:3] returns the first three bases (the first codon).
- Which string method returns the first position of a motif in a sequence?.find(motif) returns the first position of the motif.
- How do you transcribe a DNA string to RNA using a string method?Use .replace('T','U') to replace thymine with uracil.
- Which string method counts occurrences of a motif, and what does .upper() do?.count(motif) counts occurrences; .upper() normalizes case by converting to uppercase.
- How is GC content calculated?GC content = (#G + #C) / sequence length.
- What are two ways to compute GC content in Python?A counting loop (optionally with a dictionary) or using .count('G') and .count('C').
- What Python construct would you use to repeat population doubling until a time limit is reached?A while loop.
- What does enumerate provide when looping over a sequence?It yields both the index and the value of each element.
- What is a list comprehension used for?To build a list concisely from an iterable, often applying a condition or transformation in one expression.
- What is a default argument in a Python function, and give an example from the section?A parameter with a preset value used when no argument is supplied, e.g., a motif finder with overlap=False.
- What do classes bundle together?Data (attributes) and behavior (methods).
- What does it mean to view a matrix A as a linear map?It maps a vector x to Ax = b, and it is linear: A(αx + βy) = αAx + βAy.
- What geometric effect do orthogonal matrices have?They rotate or reflect vectors while preserving lengths.
- What geometric effect does a diagonal matrix have?It stretches (or scales) vectors along the coordinate axes.
- What does a projection matrix do geometrically?It drops vectors to a lower-dimensional subspace.
- In NumPy, what does an array's .shape attribute tell you?It gives the dimensions as (rows, columns).
- What is the difference between A @ B and A * B in NumPy?A @ B is matrix multiplication (composition), while A * B is element-wise multiplication.
- Give the formula for the entries of a matrix product AB.(AB)_{ij} = Σ_k A_{ik} B_{kj}.
- What is the trace of a matrix?The sum of its diagonal entries.
- Why is np.linalg.solve(A, b) preferred over forming A^{-1}?It solves Ax = b directly and is numerically more stable and efficient than computing an inverse.
- When is an n×n matrix A invertible?Exactly when its rank equals n.
- How do you set up a matrix to balance a chemical reaction using a nullspace?Rows are elements and columns are compounds, with reactants positive and products negative; solve Ax = 0.
- After finding the nullspace vector for a chemical reaction, what must you do to get the balanced equation?Scale the nullspace vector to the smallest integers.
- Which NumPy function builds an identity matrix?np.eye.
- Which NumPy function builds a diagonal matrix or extracts a diagonal?np.diag.
- What do np.triu and np.tril do?They return the upper or lower triangular part of a matrix, respectively.
- Which NumPy function computes the Frobenius norm of a matrix?np.linalg.norm.
- What is the goal of interpolation?To find a function that passes through all measured data points, allowing estimates at intermediate values (e.g., estimating blood glucose at t = 3 h from readings at 0, 2, 4, 6 h).
- Given n+1 data points, what degree polynomial is guaranteed to interpolate them uniquely?A unique polynomial of degree at most n satisfying p(x_i) = y_i for all points.
- What is the Vandermonde matrix in polynomial interpolation?The matrix arising from the monomial basis 1, x, ..., x^n, where row i is (1, x_i, x_i^2, ..., x_i^n); solving A c = y gives the coefficients.
- What are the main drawbacks of the monomial basis for interpolation?Solving the linear system is costly, and adding a new data point changes all the coefficients.
- What property defines the Lagrange basis polynomials L_j?L_j(x_i) = 1 if i = j and 0 otherwise, so each basis polynomial is 1 at its own node and 0 at all others.
- Give the formula for the Lagrange basis polynomial L_j(x).L_j(x) = product over i ≠ j of (x − x_i)/(x_j − x_i).
- What is a key advantage of the Lagrange basis over the monomial basis?No matrix solve is needed, and the coefficients in p(x) = Σ y_j L_j(x) are simply the data values.
- What basis functions are used in the Newton basis?1, (x − x_0), (x − x_0)(x − x_1), and so on, with each new basis function multiplying by another (x − x_k) factor.
- What are the coefficients in the Newton basis called and how are they obtained?They are divided differences, computed recursively.
- What is the main advantage of the Newton basis when a new data point is added?Only one new term is added and earlier coefficients stay fixed, so the interpolant can be updated cheaply (e.g., for a new hourly sensor reading).
- How should a Newton-basis polynomial be evaluated efficiently?Using nested (Horner-style) multiplication.
- What is the motivation for numerical differentiation in oral absorption pharmacokinetics?To estimate dC/dt from measured plasma concentrations, which helps determine absorption rate k_a and elimination rate k_e.
- How are finite difference formulas derived, and where does the truncation error come from?They are derived from Taylor expansions of f(x_0 ± h); the leftover higher-order terms give the truncation error.
- What is the forward difference formula for the first derivative and its error order?(f_1 - f_0)/h, with error O(h) (first order).
- What is the backward difference formula for the first derivative and its error order?(f_0 - f_{-1})/h, with error O(h) (first order).
- What is the central difference formula for the first derivative and its error order?(f_1 - f_{-1})/(2h), with error O(h^2) (second order).
- What is the second-order forward difference formula for the first derivative?(-3f_0 + 4f_1 - f_2)/(2h), with error O(h^2).
- What is the central difference formula for the second derivative and its error order?(f_{-1} - 2f_0 + f_1)/h^2, with error O(h^2).
- How does halving h affect the error of a first-order method versus a second-order method?First-order: halving h halves the error. Second-order: halving h quarters the error.
- What important application uses the three-point second-derivative stencil?It is the building block of the discrete Laplacian used in diffusion PDEs.
- How much does halving h reduce the error when using Richardson extrapolation?It cuts the error by a factor of 16 (16×).
- What are the costs of Richardson extrapolation?More function evaluations and a wider stencil.
- In the notation f_j = f(x_0 + jh), what does the subscript j represent?The grid offset from x_0: j = 0 is x_0, j = 1 is x_0 + h, j = -1 is x_0 - h, etc.
- What does the area under the plasma concentration-time curve (AUC) represent?Total drug exposure (bioavailability). Because concentration data are discrete, the AUC is computed by numerical integration.
- What does the precision ρ of a quadrature rule measure?The highest polynomial degree that the rule integrates exactly.
- Which nodes does the trapezoidal rule use, and what is its precision?It uses only the endpoints of the interval; its precision is ρ = 1.
- What is the composite error order of the trapezoidal rule?O(h²) accuracy in the composite sense.
- Where is the node of the midpoint rule located, and how does its order compare to the trapezoid?One node at the interval midpoint (a+b)/2; precision ρ = 1, the same order as the trapezoidal rule.
- State Simpson's rule formula on [a,b] with midpoint m.∫ f ≈ (b−a)/6 · [f(a) + 4f(m) + f(b)], obtained by integrating the interpolating parabola.
- What is the precision and error order of Simpson's rule?Precision ρ = 3 with O(h⁴) error.
- What requirement does composite Simpson's rule place on the number of pieces r?r must be even (the interval is split into an even number of equal-width pieces).
- By what factor does the error shrink when h is halved for the trapezoidal rule versus Simpson's rule?Trapezoid: error shrinks 4×; Simpson: error shrinks 16×.
- What is interpolatory (Lagrange) quadrature?Integrating the interpolant of the function, which yields a weighted sum of function values using precomputed weights.
- What does scipy.integrate.quad do, and what does it return?It integrates a callable (e.g., the closed-form one-compartment curve) and returns an error estimate; it also accepts an infinite upper limit.
- What is the general form of an initial value problem for an ODE system?y'(t) = f(t, y) with y(0) = y₀.
- Why do nonlinear ODE systems require numerical solvers?They generally lack closed-form solutions, unlike linear systems which have closed forms.
- Write the update formula for backward (implicit) Euler.y_{i+1} = y_i + h·f(t_{i+1}, y_{i+1}), requiring a solve at each step.
- How is each backward Euler step solved for linear versus nonlinear f?A linear solve for linear f, or Newton's method for nonlinear f.
- For the linear system y' = Jy, what is the backward Euler update in matrix form?y_{i+1} = (I - hJ)^{-1} y_i.
- What stability property does backward Euler have for linear problems, and what is it used for?It is unconditionally stable for linear problems and is the tool for stiff systems.
- Write the RK4 update formula.y_{i+1} = y_i + (k₁ + 2k₂ + 2k₃ + k₄)/6.
- What is the global error order of RK4, and how many function evaluations per step does it use?Global error O(h⁴), with four evaluations per step.
- Which SciPy function and method are used for adaptive-step IVP solving, and which tolerances control it?scipy.integrate.solve_ivp with method='RK45', controlled by rtol and atol.
- What is the difference between the out-degree and in-degree of a node in a directed graph?Out-degree is the number of edges leaving the node; in-degree is the number of edges entering it.
- How does PageRank differ from simple degree-based ranking?Degree only counts connections, while PageRank scores importance recursively so that links from important nodes count more.
- Describe the random surfer model underlying PageRank.With probability α the surfer follows a random out-edge; otherwise they teleport to a uniformly random node. PageRank is the long-run fraction of time spent at each node.
- How is the transition matrix M built from the adjacency matrix A?Divide each column of A by the out-degree of that column's node, making M column-stochastic; M_ij is the probability of moving from j to i.
- What equation defines PageRank as a stationary distribution?r = M r, i.e., the eigenvector of M with eigenvalue 1.
- What are dangling nodes and how are they handled?Dangling nodes have no out-edges, producing zero columns in M. They are fixed by replacing each zero column with 1/n.
- Define the Google matrix G.G = αM + (1−α)(1/n) 1 1ᵀ, a blend of the link-following transition matrix and uniform teleportation.
- What damping factor α did the original PageRank use?α = 0.85, meaning an 85% chance of following an out-edge and 15% chance of teleporting.
- What problems does the Google matrix fix?It fixes disconnected, periodic, and absorbing graph structures that would otherwise break the stationary distribution.
- What does the Perron–Frobenius theorem guarantee for the Google matrix?A positive column-stochastic G has a unique positive dominant eigenvector, and all other eigenvalues have magnitude less than 1.
- Describe the power iteration method for computing PageRank.Start with a uniform vector and repeatedly apply r ← G r until the change falls below a tolerance.
- What is a biological application of PageRank?Ranking proteins in interaction networks by their importance.
- What two components must every recursive function have?A base case (which stops the recursion) and a recursive case (which calls the function on a smaller problem).
- What two properties must a problem have for dynamic programming to apply?Optimal substructure (optimal solutions built from optimal subproblem solutions) and overlapping subproblems (the same subproblems recur).
- What is memoization?Top-down recursion combined with a cache (e.g., a dictionary) so each subproblem is solved only once.
- What is tabulation?A bottom-up approach that fills a table with a loop, solving problems from smallest to largest; it is the most common DP pattern.
- In the longest common subsequence problem, what does a subsequence allow that a substring does not?A subsequence keeps characters in order but need not be contiguous.
- In the LCS DP table, what does dp[i][j] represent?The length of the LCS of the first i characters of one string and the first j characters of the other.
- What are the base row and column values for the LCS table, and its time complexity?The base row and column are all 0; the algorithm costs O(mn).
- How do you recover the actual longest common subsequence from the DP table?Trace back through the table from the bottom-right cell, following the choices that produced each value.
- When counting occurrences of pattern Q as a subsequence of S, what is the recurrence if the last characters match?Count both possibilities: using the match (recurse on both prefixes) plus skipping it (recurse on S without its last character).
- When counting subsequence occurrences of Q in S, what happens if the last characters do not match?You can only skip the last character of S and recurse; the match branch is unavailable.
- What are the base cases for counting subsequence occurrences of pattern Q in string S?An empty pattern counts as 1 occurrence; an empty S with a nonempty Q counts as 0.
- What three operations does edit distance allow, and what does it measure?Insertions, deletions, and substitutions; it measures the minimum number of these needed to transform one string into another.
- What is the edit distance recurrence when characters match versus mismatch?Match: take the diagonal value. Mismatch: 1 + min(diagonal, top, left).
- What are the base cases for the edit distance DP table?dp[i][0] = i (delete all of the first string) and dp[0][j] = j (insert all of the second string).
- In a pairwise alignment, what do mismatches and gaps represent?Mismatches imply substitutions; gaps imply insertions or deletions (indels).
- How is an alignment score computed?It is the sum of state scores (match, mismatch, gap). For example, with match +1, mismatch 0, gap -1, an alignment with 8 matches, 2 mismatches, and 1 gap scores 7.
- In a dynamic programming alignment grid, what do the diagonal, down, and right moves represent?Diagonal = (mis)match, down = deletion, right = insertion.
- What is the Needleman-Wunsch recurrence?M(i,j) = max{ M(i-1,j) + gap, M(i,j-1) + gap, M(i-1,j-1) + S(i,j) }, starting at M(0,0)=0 and tracing back from the bottom-right.
- What type of alignment does Needleman-Wunsch perform and what is its complexity?It performs global alignment in O(mn) time and space.
- How does Smith-Waterman differ from Needleman-Wunsch?It is local alignment: the recurrence adds a 0 option, the first row and column are 0, and traceback starts at the highest cell and stops at a 0.
- When should you use global vs. local alignment?Global suits similar, equal-length sequences; local suits finding shared domains within dissimilar sequences.
- Why are affine gap penalties biologically motivated?A long gap is usually a single evolutionary event (e.g., a transposon insertion/deletion), so it should cost less than many separate short gaps.
- What are the common types of gap penalty schemes?Constant, linear (length × cost), affine (opening + extension × (length − 1)), and convex (e.g., logarithmic).
- Are transitions or transversions usually penalized less, and why?Transitions (purine↔purine A/G, pyrimidine↔pyrimidine C/T) are cheaper than transversions (purine↔pyrimidine), since they are more common substitutions.
- What substitution matrix is standard for protein alignment?BLOSUM62.
- Why do protein alignments need a full amino-acid substitution matrix?Because amino acids have varying chemical similarity and substitution frequencies, so scoring must reflect conservative vs. radical replacements rather than simple identity.
- Why can ties in the DP recurrence produce multiple optimal alignments?When several moves yield the same maximum score, more than one traceback path is optimal, giving multiple optimal alignments.
- What is the key difference between rational design and directed evolution in protein engineering?Rational design uses knowledge of protein structure and function to make targeted changes; directed evolution generates random variants and selects those with desired traits.
- What is a perceptron?A perceptron computes a weighted sum of its inputs and applies a threshold to produce an output.
- How does the perceptron learning rule update weights?It updates weights when the perceptron makes a mistake, adjusting them to reduce the error.
- What kind of problem can a perceptron not solve, and why?It fails on data that are not linearly separable, such as XOR, because a single threshold can only separate linearly separable classes.
- What does backpropagation do in a neural network?Backpropagation computes the gradients of the loss with respect to the network's weights, enabling gradient descent updates.
- What role does the learning rate play in gradient descent?The learning rate sets the step size of each weight update during gradient descent.
- How do regression networks learn?They minimize a loss function by gradient descent, using backpropagation to compute gradients.
- What is stochastic gradient descent?A gradient descent variant that updates weights using subsets of the data rather than the full dataset.
- What is mini-batch gradient descent?Gradient descent that updates weights from small subsets (mini-batches) of the training data.
- What is a multilayer perceptron (MLP)?A network of stacked fully connected layers, which can solve XOR when it uses nonlinear activations.
- Why can an MLP solve XOR when a single perceptron cannot?Nonlinear activations in its hidden layers let it learn nonlinear decision boundaries.
- What is a dead neuron?A neuron that stops contributing to learning, typically because its activation or gradients become stuck at zero.
- What is the difference between overfitting and underfitting?Overfitting means the model fits training data too closely and generalizes poorly; underfitting means it fails to capture the underlying pattern even on training data.
- What is the difference between parameters and hyperparameters?Parameters are learned from data during training (e.g., weights), while hyperparameters are chosen beforehand (e.g., learning rate).
- What is a fully connected layer?A layer in which each neuron is connected to every neuron in the previous layer.
Velocer is gratis: gespreide herhaling en je eigen kaarten uit elk document.
PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import
Meer decks van University of Wisconsin–Madison
- comp sci 240 midterm 1
- comp sci 240 midterm 2
- COMP SCI 240 Midterm 3
- COMP SCI 240 Final
- comp sci 300 full course review
- Math 234 - every chapter (multivariable calc)
- PSYCH 202 Exam 1 Review
- PSYCH 202 Exam 2 Review
- PSYCH 202 Exam 3 Review
- STAT 441: Advanced Sports Analytics · UW-Madison
- ECE 752: Advanced Computer Architecture I · UW-Madison
- CS 639: Introduction to Reinforcement Learning · UW-Madison