instruction stringlengths 35 29.1k |
|---|
I am trying to use machine learning to detect and locate an object in a greyscale image. I have about 700 images which are 360x360 pixels in size.
See below for an example of the object and image:
In the first image, the object is indicated by the red arrow. In the second image, the object doesn't exist. Additionall... |
Is there an explicit term for a member of a class that is not inherited from any parent class?
class Vehicle {
int weight;
}
class Car extends Vehicle {
int numDoors;
}
Car car = new Car();
car.weight = 10000; // weight is an "inherited member"
car.numDoor = 4; // what's the term for numDoor?
|
There's an n x n chessboard where some cells are instead holes. I want to have as many rooks as possible in a way that the rooks won't be able to capture each other. Rooks cannot be placed on the holes but can jump over them. How can I solve this problem using the finding maximum matching principle in a bipartite graph... |
It is mentioned in Sipser's text that the complement of SAT is in $IP$, before $IP$ is formally introduced. After looking at the definition and some of the results, I still don't see why this is the case.
Is this supposed to be seen directly? Or is it easier to show that it is in $NPSPACE$, which would prove the claim ... |
If I know all the distances between a set of nodes and I also know that one of the nodes is at location (0,0), using the distances between the nodes, can I calculate the absolute positions between all of the nodes? I feel that this will involve some form of trilateration but only a single node position is known. Will I... |
I have an array of known patterns with optional wildcards. For example this array that has 5 patterns:
ab*e
hkl
abcd*
ab
sdfs?f
now I need to find the elements within the array that match an arbitrary string.
This can be solved with regular expression by converting the patterns to regexp and looping over the array an... |
I understand that $(0 U 1)^*$ is the set of all binary strings. However, what do the other two expressions create?
Could someone please provide examples of what strings these languages would accept?
$L = \{0,1\}^*$
$L = \{0,1\}^+$
|
If I had to write the Huffman encoding as a recursion in terms of the cost $C_{ij}$, given weights/frequencies $W = [w_1,\ldots,w_n]$, how would I do it? (where this is creating a minimum cost tree, $C = \sum_i w_i \cdot \mathrm{depth}_i$).
I am going off of Dasgupta's Huffman procedure:
procedure Huffman(f)
Input: ... |
I'm looking to classify words into type categories like sushi to food, baseball to sports, happy to emotions, panda to animals etc.
What is this type of classification called? I see lots of NLP-related articles discussing parts-of-speech classifiers. This isn't helpful.
I know any word has many possible categories. For... |
I developed an algorithm and have a recurrence for its runtime; I want to show the expected runtime is $O(\sqrt{n})$.
At each iteration $i$, I have a random variable $k_i$ that is equal to the number of heads after flipping $\frac{n}{2^i}$ coins minus $\frac{n}{2^{i+1}}$ (i.e. a binomial distribution centered at 0 with... |
So I'm working on a project and I'm totally stuck right now on how to generate an nxn matrix in Matlab (where n is defined by user input). I need to make a matrix that has ones diagonally, zeroes below it, and values of negative one above. As a 2x2 example shown right here:
[1 -1
0 1]
I would show the code that I h... |
My question is in the context of a paging virtual memory system.
THE PREMISES:
The function of resident set management (RSM) is to:
Impose an upper bound on the cardinality of a process' resident set.
The ostensible benefits of RSM are:
Reduce the overall page fault rate by preventing one process from dominating... |
So I'm watching an Algorithms course in Coursera, and we are currently discussing hash tables. He's talking about the importance of a good hash function, and about how an ideal hash function would be a "super clever hash function guaranteed to spread every data set evenly".
Then, he explains that the problem is that su... |
I am trying to solve the following:
Given a set $S_0$, find min $|S|$ where $S_0 \subseteq S$ subject to:
$\forall s \in S$ $\exists$ $s_a, s_b \in S $ $|$ $ ( s_a \neq s, s_b\neq s ) \land ( s = s_a + s_b \lor s = 1 \lor s=2 ) $
Or in english, forall s in S there exists sa, sb in S such that sa != s, sb != s AND ( s =... |
Given disjoint languages $X$ and $Y$, where $X$ is NP-complete and $Y\in P$ , how do I prove that $X\cup Y$ is NP-complete?
My idea is to prove that $(X\cup Y)\in NP$ and then prove that $X\cup Y$ is NP-hard:
I can prove $(X\cup Y)\in NP$ by saying that since both are in NP, they each have polytime verifiers. Thus we c... |
I have two functions $T_1(n),T_2(n)$. How do I decide which is asymptotically faster?
One is given by the recurrence relation
$$ T_1(n) = \sqrt{n} T_1(\sqrt{n}) + 3 n, \quad T_1(1) = T_1(2) = 1. $$
The other is given by the recurrence relation
$$ T_2(n) = 3 T_2(n/3) + 2n \log n, \quad T_2(1) = T_2(2) = 1. $$
For the fi... |
If I can easily state the number of steps for an algorithms for certain values of $n$, e.g. for $n = 2^k$, where $k$ is a whole number, the number of steps is $n\log n$, is this enough to allow me to state the complexity is amortized $O(n\log n)$?
I have a tree building algorithm - when adding elements a rebalancing op... |
I'm a self-taught and I'm studying from CLRS.
I'm having difficulty with this recurrence relation:
$$T(n)=3T\left(\left\lfloor\frac{n}{2}\right\rfloor\right) + n$$
The problem is that I can "prove" that $T(n) = \mathcal{O}(n)$. It's absurd.
My inductive hypothesis about $\mathcal{O}(n)$ is:
$$\exists c \gt 0 \,\,\exist... |
I was reading page 6 of https://www.cs.cmu.edu/~reids/planning/handouts/Linear.pdf
And it is not clear to me that the STRIPS algorithm necessarily terminates.
Namely if we have a simple goal sg on the stack, and CANNOT find an operator O whose addlist includes all of sg, how do we go about picking operators? At this po... |
I am having a simple doubt in C programming language.
In any simple C code snippet, if by mistake suppose i have written intmain() instead of main().
Then it represents what type of error ?
It will not be a lexical error as compiler will correctly make a token for it and it is also not a syntax error clearly.
I thin... |
We know $$\mathsf{PP=RP},\mathsf{coPP=coRP},\mathsf{PP=coPP=coRP=RP=ZPP=BPP\subseteq P/poly}$$ are equivalent and the polynomial hierarchy collapses to $2$nd level.
What are the other non-trivial collapses and consequences?
|
Could anyone kindly point me to revenant literature in computer vision/graphics that detail on metrics for image/visual complexity and how to regularize that?
More specifically, I am trying to design a neural algorithm for creating business logos and one major difference from image generation problems in CV/CG is the s... |
Permutation rules are called those which are of the form $AB\Rightarrow^*BA$1. It is also proven that permutation rules expand context-free grammars and allow them produce non-context-free languages.
My question is: are any examples of context-sensitive grammars, which doesn't contain any permutation rules but still ab... |
The following question is supposed to give you insight on how to maintain logic when making programs. Please be open minded as this may not look like a Computer Science Problem, but it definitely contains logic that you will use when making If statements and Booleans, so PLEASE keep that in mind.
Who Robbed the Nationa... |
I've read a lot about batch normalization and how it is implemented. But I couldn't understand when to use batch normalization or not. What should we notice about the CNN to know that a batch normalization would give us an improvement on the accuracy?
|
There are two factors that decide the running time of the insertion sort algorithm:
the number of comparisons, and the number of movements.
In the case of number of comparisons, the sorted part (left side of $j$) of the array is searched linearly for the right place of the $j^{th}$ element. If instead, we use a binary ... |
I have two sets $S,T$ of points in the 2-dimensional plane. I want to find the closest pair of points $s,t$ such that $s \in S$, $t \in T$, and the Euclidean distance between $s,t$ is as small as possible. How efficiently can this be done? Can it be done in $O(n \log n)$ time, where $n = |S|+|T|$?
I know that if I'm... |
how is it possible to calculate this kind of problem that asks to find the maximum amount of nodes in ternary tree where the maximum distance from a node to another node is 3?
if the maximum distance was 1, the answer would be 4.
|
First, a few vague definitions:
Circular queues (or circular buffers) are data structures like normal queues but with their ends connected together (forming a "circle").
wikipedia
Let's say that 2 circular queues are equal if they have the exact same elements in them and the order of items in them are exactly the same.... |
I read about TRIE data-structure and is slightly confused about detecting end-of-word. Why do we create another node to detect end-of-word? why cant same node be used it. For example, we have to construct a TRIE for word CAT. Now, as per specification, there will be 4 nodes; in which last node will contain a field
"i... |
My attempt is this:
This is similar to proving whether a language {w^p|p is prime} is regular or not.(For the prime case)
Suppose on the contrary that this language L is regular. Let p be its pumping length and t be a prime greater than p. (Note that t exists since the number of primes is infinite.) Then, wt ∈ L, and b... |
First time posting.
I know this is a very generalized question, sorry for that, I don't know how to more appropriately word this.
I've noticed a tread, a pattern in methods, it seems in almost all methods, for example, in Java (haven't programmed much in other languages although I would imagine it's the same) the meth... |
I'm (foolishly it turns out) confident that the answer to this question is no. So why am I asking?
Because Dr. Aleksandar Prokopec at EPFL in his parallel programming course introduces a data-structure for which he asserts various properties. If these properties hold then it seems to me that it must be possible to buil... |
I have to build a cycle with fixed length $n$ that includes exactly $k$ corners inside $w$ x $h$ rectangle.
For example:
$w = 5\\h=3$
$n = 12\\k = 6$
I have already found out that I need at least $4$ corners and number of corners and number of non-corner elements needs to be even number.
Then I write an recursive algo... |
The complexity of Dinitz's algorithm (used to find maximum flow in a network) is O(V²E). I am trying to find a network, which is forcing the algorithm to use as much steps as possible.
I was thinking about a complete graph with some smart configuration of capacities, but I am not able find anything, that would seem to ... |
Given a dense assignment problem ($n$ tasks assigned to $n$ workers, where each worker can do any one of the tasks), I understand the best complexity is $O(n^3)$, using the Hungarian Algorithm or variants.
However, if $n$ is large, $O(n^3)$ may not be feasible from a timing perspective. Moreover, storing the complete $... |
An elevator with a capacity of N people in a building with E floors works in a pretty unusual way.
The elevator starts at the first floor and it goes to the top floor before returning to the first floor.
It stops at every floor that is a destination of a person in the elevator.
It also stops when 1) there is someone... |
In Sebesta's Concepts of Programming Languages 10th edition on page 189 he explains the concept of $\text{FIRST}$ sets using the following example:
$A \rightarrow aB \ | \ bAb \ | \ Bb$
$B \rightarrow cB \ | \ d$
The $\text{FIRST}$ sets for the RHSs of the $A$-rules are $\{a\}$, $\{b\}$, and $\{c, d\}$, which are clea... |
The question is related to databases:
There is a relation $R(A_1,A_2,...,A_n)$. Every $(n-2)$ attributes of $R$ forms candidate key. Number of superkeys of $R$ are?
I thought if any one of the $(n-2)$ attribute combinations is chosen then the number of superkeys that can be formed with it will be 4, as there will be ... |
My apologies in advance if this is going to cause further confusion. So, I wrote a very simple recursive method shown below. As you see line # 3 keeps track of value of n before recursive call and line # 5 keeps track of n after recursive call. As you can see both lines # 3 and 5 are printed to see the change in n val... |
Suppose I have a graph on which I've run the Bellman-Ford algorithm. Now I change the weight of subset of edges. Is there an efficient way to re-run the algorithm without having to completely start over? That is, can I update the shortest path in an "online" manner, if I'm only changing a subset of weight edges each ti... |
There are mentioned many classes of undecidable formulas in the book "The Classical decision problem" http://www.springer.com/la/book/9783540423249. Kahr formulae is one class of undecidable formuls and it can be expressed in prenex normal form by $[\forall\exists\forall, (\omega, 1), (0)]$.
There are two questions.... |
I would like to ask under which circumstances can these optimizations be used,supposed that they are part of a bigger NFA and when can they lead to an error ??
|
I know that set cover problem is NP-complete. We are given a universe $U$ (a set) of $n$ elements and a collection $S$ of $m$ sets whose union equals the universe and an integer $k$. The set cover problem is to identify a sub-collection of $S$ of size $k$ or less whose union equals the universe?
Now if I remove or les... |
Sorry if this is the wrong forum for this question. My understanding was GPUs were more efficient for running neural nets, but someone recently suggested GPUs are only needed for the training phase. Once trained, it's actually more efficient to run them on CPUs.
Is this true?
|
Prove that $H_r(S) = H(s) / \log_2r$.
I'm not sure how to prove this. Any help would be greatly appreciated!
|
G=(V,E) is an undirected simple graph in which each edge e has a distinct weight, and e is a particular edge of G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE?
I. If e is the lightest edge of some cycle in G, then every MST of G includes e.
II. If e is the heaviest edge of... |
Question: Are there any introductory texts in formal language or programming language theory which discuss how to apply it to the study of optimal notation?
In particular, I am interested to learn what stack-languages, parse trees, and indices are, and how to predict when a certain type of notation will lead to exponen... |
Currently I read up on unifiers, however have some problem understanding its concept. Thus far I found an example of an equation:
add(suc(x); y) $\stackrel{.}{=}$ add(y; suc(z))
and unifiers to it:
$\omicron$ = [suc(x)/y; x/z],
$\omicron'$ = [suc(suc(z))/y; suc(z)/z; suc(z)/x] and
$\omicron'$ = $\omicron$[suc(z)=x]
H... |
If one was given a tree in the form of a list of $A,B$ (not implying which one is the parent) pairs implying that node $A$ and $B$ were connected by an edge, how could a root node be determined and each node be assigned children and a parent such that by recursing up through its parent, its parents parent and so on the... |
On the begining: It is a programming contest problem, but not from on-going one. Unfortunatelly, I can't provide any link to this task, because it is not publically available. It was from one of the Polish local programming contest in 2011 organised by Warsaw School of Computer Science.
I have a graph with $V$ $(1 \le ... |
This question refers to steps Q2, Q4 and Q6 of Algorithm Q, described in the paper "A Block-sorting Lossless Data Compression Algorithm", by M. Burrows and D.J. Wheeler, SRC Research Report, 1994.
My question is: how can in step Q6, the sorting work, if we only compare the values in the array W, which are just the firs... |
I have a database that consists of PHOG and LPQ features for each image. Now, I wish to train an SVM on these features for emotion recognition i.e SVM classifies the images on basis of emotion in the image.
Please provide a detailed procedure on how to use these features to train SVM.
|
Given an undirected connected graph with N nodes and N-1 edges.
Out of N nodes, 1...k nodes are selected, out of which 2 nodes are selected randomly (uniformly).
How do I calculate the expected distance between those 2 points?
By the way, I tried using sum of distance between all pairs of k nodes and divided it by k t... |
Access to registers claimed to be faster then cache. Why is it? Is it because cache has less wires or spatially further from functional units?
|
Is it required that a NP-hard problem must be computable?
I don't think so, but I am not sure.
|
I'm trying to understand a problem that's more mathematical in nature that I'm accustomed to. Below I'll try to present the problem and what I have so far understood of it.
The problem
We have $X_1,..,X_n$ i.i.d. binary outcomes distributed according to Bernoulli distribution. The probability that $X_i = 1$ is given by... |
NOTE: This question is NOT the same as this other nearly-identically worded question with some amazing answers. I learned a lot from it regarding the mathematical importance of the empty string, but my question is specifically regarding its usage and purpose in a context-free grammar.
Update: After @Raphael's comments,... |
I am dealing with the following statement:
the run time for Dijkstra's on a connected undirected graph with positive edge weights using a binary heap is $\Theta$ of the run time for Kruskal's using union-find.
However, this is false and I fail to see why this is so. Dijkstra's algorithm when using binary heap is $O(|... |
I'm not too sure about how to calculate hashing probabilities, and can't find much documents online to help me with it. Am looking to solve this question "If we hash N items into M buckets using a simple uniform hash, what is the expected number of buckets that have exactly 1 item? What is the expected number of bucket... |
can anyone describes the more simplified mathematical formulation of learning rate, lr, and momentum constant, mc in Neural Networks while training the data?
|
I know the definition of a Turing machine but I am trying to find a practical way to characterize a Turing-complete language.
For example, an imperative language is Turing complete if it has conditional branching (e.g., "if" and "goto" statements, or a "branch if zero" instruction) and the ability to change an arbitrar... |
Consider the following situation: given a triangle $ABC$ inscribed in a circle, define $f$ as the product
$$f(P) = d(P, A) \; d(P,B) \; d(P,C)$$
where $P$ is a point on the circle and $d$ are distances between points.
Now, every point $D$ in the interior of the circle can be written as a convex combination of points $D... |
Consider a graph $G=(V,E)$ and two vertices $s,t$.
What is the complexity of finding the length of the shortest simple $s-t$ path that has even length?
Does the problem become harder if the graph is edge weighted?
Note that the requirement that the path is simple makes it harder than to simply to use two copies of t... |
If we have the function $f : \mathbb{N}_0 \rightarrow \mathbb{N}$ with $f(n) = n^2$ and we look at the following representations of the sets $\mathcal{o}(f),\mathcal{O}(f),\Theta(f),\Omega(f),\omega(f) $:
Now I have to list all necessary statements which are proving that the illustration is correct.
The necessary st... |
We suppose we have a polynomial algorithm which receives a graph $G$ (any graph) and returns a stable set of $G, SA(G)$ with the following property:
$\alpha(G) − |SA(G)| \leq k$ , for every natural $k$ ($k$ is a constant)
$\alpha(G)$ is the stability number
I need to show that this algorithm can be used to find(in poly... |
It's the continuation of the exercise: https://cs.stackexchange.com/questions/65384/tree-elements-influence-on-another-elements-searching-for-specific-elements
I need to say how many elements do I have in specific subtrees.
Input: n - how many elements are in the tree, k - around how many elements should be in the subt... |
I have an NP-hard 0-1 integer program that I need to solve. The issue with this problem is that even finding a feasible solution (ignoring the objective function) is NP-hard.
Let us look at two examples to illustrate my problem. On the one hand, the knapsack problem is an NP-hard problem which is defined as follows:
$$... |
I am looking for a $O(|V| + |E|)$ algorithm for finding transitive reduction of a rectangle containment hierarchy DAG, i.e. a directed edge exists from one rectangle to another if the first rectangle contains the second.
That is, remove as many edges as possible so that if you could reach v from u, for arbitrary v and ... |
I have a question regarding the solution provided by Karolis Juodelė.
Given in this question; Colour a binary tree to be a red-black tree
Black = black nodes, white = red nodes
So for this tree when I try to manually work out the code, it seems to fail on the node 17. E.G. I have a black quota of 3 so I color the root... |
I stumbled on the Hungarian algorithm during my personal research when I was assigned interesting problem as homework:
Given a list of objects $L$ and a pairing function $\delta : L \times L \rightarrow \left[0, 1\right]$, pair each object $\alpha$ in $L$ with exactly one $\beta$ in $L$ such that:
$\sum_{i = 1}^n \del... |
Objective: We want to generate a unique and reproducible identifier for a given slice of bytes and avoid collisions.
High-level idea: Compute $$fK := hash(k_1)\; and\; sK := hash(k_1^{-1})\; where\; k_i^{-1}\; is\; the\; reversed\; bitstring\; k_i$$
We then proceed to set, our identifier to be: $$<value\_of\_fK>\_<valu... |
I'm new to DNS and I'm trying to understand the DNS packet format. From what I understand, the authority section of a DNS packet gives information about servers that are authoritative for the domain name in question. From playing around with dig on UNIX (and from intuition), it seems as though records in the authority ... |
I know there might be some situations where we want transitions to be only taken when the stack is empty, and transitions to be taken only when the input stream is empty.
We can create an additional start state, and push a special key like "#" on the stack to start. We can also append the input stream with a "$" so we ... |
At least in Java, if I write this code:
float a = 1000.0F;
float b = 0.00004F;
float c = a + b + b;
float d = b + b + a;
boolean e = c == d;
the value of $e$ would be $false$. I believe this is caused by the fact that floats are very limited in the way of accurately representing numbers. But I don't understand why jus... |
I'd like to prove by reduction that given a Turing machine $M$, there exists no Turing machine that decides whether $M$ ends in polynomial time on any input.
Any idea as to what problem to reduce, as a first hint?
|
I have an NP-complete decision problem. Given an instance of the problem, I would like to design an algorithm that outputs YES, if the problem is feasible, and, NO, otherwise. (Of course, if the algorithm is not optimal, it will make errors.)
I cannot find any approximation algorithms for such problems. I was looking s... |
I have the following multiple dimensional scaling (MDS) minimization problem in vectors $v_1, v_2, \dots, v_n \in \mathbb R^2$
$$\min_{v_1, v_2, \dots, v_n} \sum_{i,j} \left( \|v_i - v_j\| - d_{i,j} \right)^2$$
which I wish to solve numerically using gradient descent. I know all the values of $d_{i,j}$.
I am confused ... |
I am trying some methods to solve the graph coloring problem with large data sets. I decided to start off with the total space search but to eliminate certain combinations that are same due to symmetry. So for instance, if we code the color by a natural number, graph coloring 1-2-1-1 is the same as the coloring 2-1-2-2... |
I am going through the book of Parallel Programming and a parallel algorithm is often classified as Efficient, Optimal or Suboptimal. I googled these terms but I didn't found a clear definition for them.
Define $T(n)$ as the running time of the sequential algorithm, $t(n)$ as the running time of the parallel one, $p(n)... |
Suppose one wants to reason about properties of code beyond things like totality and functional purity - one also cares about the memory consumption, or algorithmic complexity of a function. Can this be done through dependent typing and effects systems?
|
I am currently a high school 12th grader and am very interested in computer theory and pure mathematics. I also have a strong interest in astronomy and a desire to study quantum information.
However, physics and I really don't have a nice relationship. I am having trouble figuring out what major holds the topics I am ... |
In my understanding, if a unification solves equations of terms that are not higher-order terms, then it is a first-order unification.
If a unification solves equations of terms that are higher-order terms, then it is a higher-order unification. Therefore a unification solves equations of $\lambda$-terms should be a hi... |
I have been debating with someone about the big O complexity of the following algorithm. We have a different understanding of the theory. Basically one of us thinks that this algo is automatically O(N^2) since there is a loop over N elements and another potential other loop over N elements inside the loop. The other on... |
I have been given a tree with n nodes and n-1 edges with it's weight.
There are two people A and B.
I have been given a list of nodes of size k.
A will pick a random node x from this list and B will independently pick a random node y from this list.
I have to find expected distance between these two nodes.
My way of so... |
I am building a 64 bit CPU in Minecraft and I'm stuck on adding division into the ALU. I was told I should ask this here. Does anyone know how to divide in binary using only logic circuits? I can't use any counters or registers, just logic gates.
|
Given following question:
Let $G$ be a context-free grammar, $G=(V, \Sigma, R, S)$, that has start
variable $S$, set of variables $V = \{S\}$, set of terminals $\Sigma = \{0, 1\}$, and set of rules $R = \{S \rightarrow \epsilon , S \rightarrow 0 , S \rightarrow 1 , S → 0S0 , S \rightarrow 1S1\}$. Describe $L(G)$,
the l... |
Given the following function:
function split(G)
if (all vertices of G have even degree) then
return (V (G), ∅)
else
Let a ∈ V be a vertex of odd degree;
S ← NG(a);
G ← G − a;
for ((∀)u, v ∈ S, u != v) do
if (uv ∈ E(G)) then
E(G) ← E(G) − uv... |
I am working on a compiler optimisation routine for GPUs that optimises nested loops which has unpredictable number of iterations. To test my routine I need some real-life algorithms that include this kind of loop construct.
For example, there is a queue A with an arbitrary number of elements of type a each of which co... |
I'm working on the following exercise and can't get the calculations right:
Assume an OS uses:
33 bits for physical address
34 bits for logical address
2KB frame size
Calculate:
How many bits are used for the offset
How many bits are used to identify a frame
How many bits are used to identify a page
And then:
Assu... |
I'm talking about first-order existential types, as summarized here, with pack as the introduction form that bundles up a type with an expression of that type, and open as the elimination form that unpacks the type and its representative expression.
This seems just as fundamental as parametric polymorphism (universal t... |
In chapter 3 book how to triangulate a polygon is explained, however it doesn't seems to me that how to handle the faces are explained. My guess would to add two new face and erase the old one every time a diagonal is inserted (both while decomposing the polygon in monotone pieces, and during the actual triangulation).... |
Is the MinMax/optimization/search variant of a decision problem always easier/equal in complexity because we can always reduce them to their decision variant?
From Wikipedia:
If the longest path problem could be solved in polynomial time, it could be used to solve this decision problem, by finding a longest path and t... |
In a directed acyclic graph (DAG), what is the name for a vertex with only one predecessor and one successor?
|
Im having a hard time trying to figure out how to find an upper bound to the following recurrence:
$T(N)=T(N-1)+\mathcal{O}(n)$
where i know initially $N=\lfloor\tfrac{n}{logn}\rfloor$
I believe it can be solved as a linear recurrence, but i don't know how to put $n$ in terms of $N$.
|
I have a homework problem: Calculate the overall speedup of a system that spends 40% of its time in calculations with a processor upgrade that provides for 100% greater throughput.
Which is a pretty straightforward calculation with Amdahl's Law
$S = \frac{1}{(1-f)+(\frac{f}{k})} $
$f$ = fraction of work performed by c... |
There are $n$ stairs and a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs every time. What is the total number of ways they can reach the top?
There are many ways to do this by using code. But when I first read this problem was to use a combinatorics approach. This... |
Problem
You've periodically helped the medical consulting firm Doctors Without Weekends on various hospital scheduling issues, and they've just come to you with a new problem. For each of the next n days, the hospital has determined the number of doctors they want on hand; thus, on day i, they have a requirement that e... |
Wikipedia has several languages listed as declarative languages. One of these languages listed is XSLT, which is a language for applying transformations to XML.
https://en.wikipedia.org/wiki/XSLT
As I understand it though, imperative languages say HOW to do something, while declarative languages only say WHAT to do an... |
When compressing multiple files, is it more efficient to (1) first compress each individual file separately and then concatenate/merge the results, or (2) first concatenate/merge the files into a single archive and then compress that archive? Which one will be faster, in terms of running time?
From what I understand b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.