instruction stringlengths 35 29.1k |
|---|
Is there any known polynomial time algorithm to solve a problem which that problem is in NP. I was told is False but can't think of any counter example now.
|
How can I translate (i.e. reduce) an arbitrary instance $(S, t)$ of Subset Sum into an instance of 0-1 Knapsack? I'm also given a hint: you may assume that all members of $S$ are positive integers.
|
I am aware that the general rectangle packing problem is NP-hard. I am trying to form an estimate for a version of the problem with constraints. Consider fitting rectangles of smaller size into a larger rectangle:
I am currently using the second method on the following webpage: https://cgi.csc.liv.ac.uk/~epa/surveyh... |
Consider the following problem SQUARED-SUM-PARTITION. You are given positive integers $x_1, \dots, x_n$,
and numbers $k$ and $B$. You want to know whether it is possible to partition the numbers $\{ x_i \}$ into $k$ sets $S_1, \dots, S_k$ so that the squared sums of the sets add up to at most $B$:
$$ \sum_{i=1}^k \left... |
My assignment question as "given a multiset of symbols (letters) L from an alphabet Σ (thus, the same letter may appear in L multiple times), and a set of words W ⊆ Σ' , UseAllLetters asks if it is possible to use all letters from L to make words belonging to W. You may form the same word multiple times. Prove that Use... |
Finding the length of union of segments (1-dimensional Klee's measure problem) is a well-known algorithmic problem. Given a set of $n$ intervals on the real line, the task is to find the length of their union. There is a simple $O(n \log n)$ solution involving sorting endpoints of all intervals and then iterating over ... |
Verify that (S = {83, 88, 93, 67, 57, 89, 78, 51, 95, 98, 69, 49}, t = 492) is a positive instance of Susbset Sum.
|
How can I construct a regular expression for the language over $\{0,1\}$ which is the complement of the language represented by the regular expression $10(0+1)^*$?
|
Suppose, we have $L_1:=\{w\in\{a,b\}^*\mid \#_a(w) \equiv 0 \mod 4\}$ and $L_2:=\{w\in\{a,b\}^*\mid abaab \text{ is a substring of } w\}$. Now we want to create a Deterministic Push-Down Automaton for $L_1\cap L_2$
I've created PDA's for both languages:
$M'=(Q,\Sigma,\Gamma,\Delta,s,F)$ with $\Sigma=\{a,b\}$, $\Gamma... |
I have an associative mapped cache with 10 tag bits and an offset of 7bits.
What is the size of each main memory block in words(word addressable) and main memory size in words?
i worked it out as:
block size would 2^7bits.
main memory would be 2^17bits.
the issue I am facing is, how do I get them to be word addressabl... |
Consider a special case of the knapsack problem in which all weights are integers, and the number of different weights is fixed. For example, the weight of every item is either 1k or 2k or 4k. There is one unit of each item.
If there are $n$ items, and the number of different weights is $d$, then the problem can be sol... |
I am not from cse but trying to learn computer architecture on my own. Please clarify the following.
In case of pipelining, each stage or subcomponent or subtask is assumed to be done in 1 CPU clock cycle time. Why is it so?
some operations may exceed 1 cpu clock cycle time. I am visualising pipelining as series of... |
Consider the following game played on a graph $G$ where each node can hold an arbitrary number of tokens. A move consists of removing two tokens from one node (that has at least two tokens) and adding one token to some neighboring node. The LastToken problem asks whether, given a graph $G$ and an initial number of toke... |
I am having difficulties in understanding why the recurrence
$$T(n)=3T(n/4) + n\log n$$
is solvable with Master Method but
$$T(n)=2T(n/2) + n\log n$$
isn't?
Despite they both look very similar except the values of coefficient '$a$' and size cutter '$b$'.
I understand that the work function '$f(n)$' must be polynomial... |
A boolean algebra expression can be converted into an idempotent algebra using
$$\bar a \equiv 1-a, \qquad a \vee b \equiv a+b -ab, \qquad a \wedge b \equiv a \otimes b$$
where $\otimes$ is the idempotent product (no powers). For example, $$(a+b)\otimes(a-b) = a -ab +ab - b = a-b.$$
The CNF formula
$$\phi = (a\vee b) ... |
I was given this question:
Komplexity(S) is the length of the smallest C program that generates the string S as an output. Is the question "Komplexity(S) < K" decidable?
With respect to decidability, I only know about the Halting Problem and just learned about Rice's Theorem while searching online (though I don't think... |
The problem is given an oracle $O(G, k)$ that would say if graph G contains IS of size k devise an algorithm for finding independent set of max cardinality that makes poly number of calls to the oracle. My attempt has been that first finding the maximal possible size and then try to find the set of that size by removin... |
How to find the minimum number of vertices that need to be removed from a graph so it makes a disconnected graph?
|
Consider the recurrence
$$T(n)= 4T(\sqrt n) + \log^2n. $$
I am not able to solve this recurrence, since it involves a square root. Please help me with the solution.
|
I have the following ambiguous operator grammar:
E->E+E*E | E-E*E
E->E+E | E-E | E+E | E*E | E/E
E->(E) | x
I must convert it to an unambiguous one which is also SLR(1).
The following rules regarding precedence and associativity must hold:
Operators * and / have the highest precedence (and precedence between them mu... |
In the book 'Principles of Model Checking' by Christel Baier and Joost-Pieter Katoen they state that the CTL formula for " for every computation it is always possible to return to the initial state" as 'AGEF start'. I was wondering whether the formula 'AGF start' would also be a valid one ? Is this correct ?
|
A node is valid if its value is greater than all of its incident edges.
Task is to maximize the number of valid nodes.
Given $n$ values for nodes and $n-1$ values for edges, how do I assign these values (to nodes and edges) to a given input tree so the number of valid nodes is maximized?
|
I have a min-cost max-flow problem. The designed network (without cycles) gives correct results using cycle cancelling, but it is way too slow. I would like to get rid of negative edges so that I can use successive shortest path.
Is there a universal way how to transform a flow network without cycles?
|
The problem we were given, states that we have graph, where vertices are cities, and edges are roads. Each edge has a weight equal to the kilometers of the corresponding road. We want to get from city $A$ to city $B$, with a car that can last up to $M$ kilometers in one go, but we can refuel, every time we go to a city... |
Given a set of sets: $S = \{~\{1, 2, 3\}, \{2, 3, 4\}, \{1, 3, 4\}~\}$, I would like to find the largest common subset of $S$. If $S$ does not have a subset across all elements of $S$, I would like to find the largest common subset across the largest subset of $S$.
For example:
$S = \{~\{1, 5, 4\}, \{2, 3, 4\}, \{1, 3,... |
I was asked that how can one make a single cycle processor pipelined on a CS course without any specifications regarding the design.
I suppose, that I should answer that what should be changed on architecture level.
I am familiar with the meaning of pipelining.
I came up with the following basic idea: registers should ... |
The problem:
We have the language $L_{all} = \{\operatorname{Kod}(M) | M \text{ is a turing machine and } L(M) = \Sigma ^*\}$
Hence, $L_{all}$ is the set of all encoded Turing machines (the $\operatorname{Kod}()$ is the encoding function) which accept all words as input.
One needs to show that $(L_{all})^C$, the comple... |
For example, if it is a $ O(2^n) $ algorithm that loops through 0 to $ 2^n - 1 $ and check whether the number of 1 bits is divisible by 3, 5, 7, 9, 11, does quantum computing reduce it to non-exponential time and how?
|
There is a directed binary tree as shown in the picture (all edges are diercted from higher- to lower-level nodes). In that tree there is some specific unknown node $s$. All nodes in the $(s, root)$ path are marked somehow (yellow nodes in the picture) so we can check using a $check$ operation if a node belongs to the ... |
A glyph contour contains points set {p}, a point contains tuple (x,y,on_curve).
Now, think about this need, converting contour of glyph X, for example, into to two contour parts or two strokes, point set of each stroke is similar with contour of glyph \ and /, topologically? Forgive my mouthful description.
Other examp... |
$ \# a^nb^{2^n} \# $
such that
• The alphabet of the machine is {, a, b, x}.
• The symbol x will never appear on the input a.
• The contents of the tape at completion may be anything.
• The head begins on the lefthand #.
• n ≥ 0.
I know that a Turing machine could recognize this language. But can a NPDA recognize this ... |
This question is from chapter 8, exercise 35, of Algorithm Design by Kleinberg and Tardos.
A player in the game controls a spaceship and is trying to make money
buying and selling droids on different planets. There are $n$
different types of droids and $k$ different planets. Each planet $p$
has the following propertie... |
So I've searched around and found the algorithm to do so: How to convert finite automata to regular expressions? and I decided to test out the second-level response, Raphaels, and while I was getting correct regexes at least to my knowledge, I was having some weird issues with variables/state names. Please help me unde... |
Suppose I have a set S which is a set of points in a 3D plane. Given point P, is it possible to construct a data structure A such that the closest point to P in A can be found in o(n) time? My assumption would be to use a Kd-tree or an octree, which I think would take O(log_3(n)) to find. Any help would be greatly appr... |
Every program in high level ("industrial") programming language can be expressed as some Turing machine. I guess, that there exists universal algorithm for doing that (e.g. one can take the Cartesian multiplication of the domains of all the variables and the resulting space can be the state space of the Turing machine,... |
I'm wondering whether there exist any good hash functions with the following property: Assume that $x$ is some string over some alphabet $A$, then given $H(x)$ we can compute in $O(1)$ time both $H(ax)$ and $H(xa)$ for any letter $a\in A$. In practice one can assume that $A$ is for example the set of $8$-bit integers.
... |
I have implemented the basic algorithm. easily available but I am not getting the complete tour.
The visited square never equals N * N;
|
The solution to this problem can be found here. It says:
To multiply $k$ matrices, we generate the result entry by entry, by running a counter $t$ and generating the $it$th entry in the product of the first $k − 1$ and the $tj$th entry in the last matrix. Inductively, we need to maintain $k$ counters which can be done... |
I'm referring to a post on a black-box algorithm and the Independent Set problem.
Question
Suppose that someone gives you a black-box algorithm $A$ that takes an undirected graph $G = (V, E)$, and a number $k$, and behaves as follows.
If $G$ is not connected, it simply returns “$G$ is not connected.”
If $G$ is connec... |
Given a board of size $n \times 1$ where $n=\infty$ (basically a tape, one way infinite), and a set of colors $C$, some starting color $c_{start} \in C$, a set of templates $T$ in a form $(c_k, i, c_i, j, c_j)$ (meaning if on some position on the board there is a color $c_k$ then $i$ steps to the right of $c_k$ there i... |
I have a question about the binomial coefficient solution to the generalization of the egg dropping problem (n eggs, k floors)
In the binomial coefficient solution we construct a function $f(x,n)$, which represents the maximum number of floors we can cover with $x$ trials and $n$ eggs.
So there are two cases, if we ... |
Given that any implementable algorithm has a finite number of internal states, and given that any state is determined by the previous one, does that implies that any algorithm loops at some point?
If I run the algorithm until the number of state transitions is greater than the number of internal states, by the pigeonho... |
I'm studying the Knuth Morris Pratt pattern searching algorithm from here. I want to know the order of computing the $lps$ array in this algorithm - that is the array of longest proper prefixes that are also suffix. I studied the Wikipedia page for this algorithm and it says this part is of $O(m)$ - $m$ is the length o... |
I'm given the number:
$$8.881784197001252 \cdot 10^{-16}$$
I know it is $2^{-50}$ but suppose I didn't know. I need to convert it to binary.
One way is to apply the school taught algorithm on the fractional part. That'd be:
$.881784197001252\cdot2=1.763568394 \to 1$
$.763568394 \cdot 2=1.527136788 \to 1$
$.527136788 \c... |
I have a laptop with Intel dual core and it runs, the OS windows, and many application from Opera, age of empires, word, excel etc open at once just fine. If it only has 2 cores, how can so many programs work? How exactly does it manage to do all these? Does operating system have something to with it?
|
I am trying to create an algorithm that can find all Eulerian cycles in a directed graph. I was able to make an algorithm that can find one cycle in the graph, but I don't know how to find all the cycles. Searching around I found that I had to use BEST theorem somehow.
def eulerian_cycle_from(graph: Dict[str, List[str]... |
I would appreciate if anyone could help me with the following problem:
Given a set of 3n points in the plane with n > 0, is it possible to find a placement of a tripod such that each region contains at most n of the points?
If it is possible, then can we prove that a valid placement always exists?
If it is not possib... |
Consider a set R of n red points and B of n blue points in the plane. Let x∈R and y∈B be the shortest edge xy. Let P = R ∪ B. Let Vor(P) be the Voronoi diagram of P. Let V(x) be the Voronoi cell of x and V(y) be the Voronoi cell of y. Prove or disprove that V(x) and V(y) share an edge in Vor(P ).
Here,as per my underst... |
I am learning about Voronoi diagrams and I have seen that the Voronoi diagram of a set of points is drawn with straight line segments and rays.
Similarly how can we draw the Voronoi diagram for the following:
(a) A set of lines and points?
(b) A set of disjoint line segments?
(c) A set of line segments forming a conve... |
This is the problem I am dealing with:
Given a set P of n points in general position, let a graph G be defined as follows:
The vertex set is P. Two vertices, a and b, are joined by an edge provided there exists an axis parallel square S with a and b on the boundary and no other point of P in the interior of S.
I need... |
I am currently studying the complexity of matrix multiplication and Wikipedia's article says "The matrix multiplication algorithm that results of the definition requires, in the worst case, n³ multiplications of scalars and (n−1)n² additions for computing the product of two square n×n matrices. Its computational comple... |
My question: How is Table 6.8 shown below computed for different operands? For example, for 3 operands how did they compute:
Number of levels using (3,2) = 1
Number of levels using (4;2) = 1
Equivalent delay: 1.5
Or how about for 9 operands how did they compute:
Number of levels using (3,2) = 4
Number of levels using... |
I am studying smoothed analysis and trying to apply it to the Partition decision problem: given $n$ real numbers with a sum of $2 S$, decide whether there exists a subset with a sum of exactly $S$.
The common definition of the smoothed runtime complexity of an algorithm is:
given $n$ and $\sigma$, the smoothed runtime ... |
I have a bunch of connected walls in a list and the data for them is like so:
Wall
{
Node A;
Node B;
}
Node
{
float x;
float y;
}
I want to find the rooms from the connected walls as an array of connected points to represent each room's perimeter.
This is an example visually of what i am trying to fin... |
I have a 6-axial sensing device used to record the acceleration data. There is an algorithm used to count the number of step and walking distance of the user, but I want to further increase the accuracy of the result. I want to write an algorithm which can calculate the step size and the walking velocity of the person.... |
i=2;
while(i<n)
{
write('*');
i=i*i;
}
Why $n ≃ i$?
I mean suppose $n=1000$ and so $i= 2,4,16,32,256,65536$ is in every steps.
In the book wrote $2^2 power(k)$ is pattern for growing $i$ so $n ≃ i$ and...
Now 65536 or 256 isn't equal to 1000 or around 1000.
But why $n ≃ i$?
This chapter is about notations.
|
How to divide an unsorted list into two equal parts in linear time, where every element in the first part is smaller than every element in the second part
I tried to use QuickSort but in can result in $O(n^2)$ worst-case time complexity.
|
This is a homework problem, so I don't want the solution. I need a hint which problem to reduce to the following and/or how to start on it. We were thinking of TSP or independent set but couldn't come up with a solution.
We have $i\ldots j$ stores and $i\ldots n$ possible places to build a new warehouse. Costs to build... |
Why is the assignment rule the way it is in Hoare Logic/Axiomatic Semantics?
I can't wrap my head around why the assignment rule is backwards from what I expected.
I understand Hoare logic is use to prove formal propositions of the state of a program as commands are executed. Thus, if we execute the command $$x:=e$$ I ... |
Dominator and post-dominator trees are useful data structures which are used to encode static analysis information. Dominator trees for example are used to compute the dominance frontiers for SSA conversion, whereas post-dominator trees are used to compute control dependencies of a statement. Post-dominance is usually ... |
If we are given a set of disjoint line segments in the plane, can we prove (or disprove) that we can always join the line segments to make a simple polygon where the vertices of the polygon are the endpoints of the segments and every segment is an edge on the boundary of the polygon.
|
Given a set of disjoint line segments in the plane, prove (or disprove) that we can always join the line segments to make a tree where the vertices of the tree are the endpoints of the segments and every segment is an edge in the tree.
|
Given a set of disjoint line segments in the plane, prove (or disprove) that you can always join the line segments to make a near-triangulation where the vertices are the endpoints of the segments, the outer face is a cycle and every segment is an edge of the triangulation.
|
Is it true that if we replace in the Dijkstra algorithm + with max, then the resulting algorithm correctly solves the problem of finding the shortest paths where the length of the path is measured as the maximum of its edge weights?
|
Suppose I have a bag (or multiset) of sets $S = \{s_1, s_2, \dots, s_n\}$ and $\emptyset\notin S$. I wish to partition $S$ into groups of sets such that within each group each set has at least one element not found in any other set in that group. Formally, the criterion for a group $G = \{g_1, g_2, \dots \} \subseteq S... |
Given $n$ non overlapping points $x_i \in \mathbb{Q}$, and an integer $k\geq 2$, what is known about the complexity of finding $k$ means ($a_1, a_2, ..., a_k$) that minimize the maximum inter cluster distance:
$$\min_{a_1, ..., a_k \in \mathbb{Q}}\max_{1\leq j \leq k} \sum_{x_i \in C_j}||x_i-a_j||^2$$
Do we have any po... |
We have a binary tree with n nodes and a number k which signifies the number of nodes that we put on a set. What is the optimal algorithm to select a set consisting of k nodes, that minimizes the maximum distance of a node (of our tree) from an ancestor of his that belongs in the set we have chosen. By distance we mean... |
Online Convex Optimization sees optimization as a continuous process in which the algorithm learns new aspects of the problem and improves upon.
Every iteration consists of the player making a decision $x_t$ from a convex and bounded decision set $\mathcal{X}$. After we made our decision the adversary returns the loss... |
****The Question is here***** (in the link)
Given a nonsingular matrix A $\in$ $R^*(nxn)$, how would you solve the following problems efficiently using Gaussian elimination with partial pivoting (the same as A = PLU)?
(a) Compute $\alpha$ = $c^T$(A^-1) b, where c, b $\in$ $R^n$
(b) Solve AX = B, where X, B $\in$ $R^*(... |
I am trying to prove the theorem
A language is Turing-recognizable iff some enumerator enumerates it.
I proved the "if" part, but I have no idea of proving the "only if" part, so I searched a proof for the "only if" part of this theorem. In the proof that I found, it says
Let $\sum$ be the alphabet of the Turing ma... |
Yes, You heard it right. My title is "How to use a machine learning algorithm for different input data?",
For example, we have an algorithm called "Email spams detector". Okay, so how to apply the algorithm for 1M users with different input data? because each user creates its own data. So instead of training 1M for ev... |
I am working on a custom IEEE754 floating point vector signal processor with 64 cores and need to generate pseudo-random floating point numbers at high rate. The only numerical operation available to me is a vector wide floating point multiply-add. I cannot therefore use any of the conventional algorithms based on feed... |
I am going through some old exams in one of my courses, and I don't have access to solutions. I've found a problem which I am not sure how to tackle. I am not looking for the answer but some help/guidance if possible.
Consider a class of hash functions , $\mathcal{H}$, over a finite universe ${U}$ into $\{0, ... , n-1\... |
If any problem in NP is not in P then NPC ∩ P = ∅
The proof is: We have $X ∈ NP$ and $X \not\in P$. Assume $Y ∈ NP C ∩ P$. As $X ≤_P Y$ we have $X ∈ P$, which is a contradiction.
I have not clear the logic step why if there is a polynomial reduction from $X ∈ NP$ to Y, then $X ∈ P$?
|
I find some references say that
all the features of programming language fall within what can be captured by context-sensitive grammars. In fact, no programming language known to humankind anything that cann't.
and
Actually, most of programming language is context-free language.
Q1: Are the claims correct? I did no... |
Lets say we have model like the one above or a similar one where a node refers back to itself.
Now let's say if I want to know the validity of the formula:
$M, s_2 \models Xr$
Will this be valid or not. In my textbook it says :
$\pi \models X\phi$ iff $\pi^2 \models \phi$
If we are starting at state 2 then our path... |
I was reading through this paper, "Priority Queues and Dijkstra's Algorithm" by Mo Chen et al., which suggests using Dijkstra's without edge relaxation, but to rather to just insert new nodes. Please see the pseudo code listed on the right-hand side below, which is taken from page 16 of that paper.
But to me the code ... |
I have been reading online source and it mentioned triangle inequality TSP is NP-complete but without proof. In general, the reduction from HAM-cycle problem to TSP works for asymmetric and symmetric TSP problem. So, I wonder how to start a basic approach to prove triangle inequality TSP is NP-complete.
|
Geeksforgeeks contains a proof of Arden's theorem, asserting that $R=QP^*$ is the unique solution to $R=Q+RP$. The proof is reproduces below.
My question is:
What is the logical reasoning to prove that any equation is the unique (only solution)? Particularly in this case, how can the procedure below logically lead to ... |
I have been struggling with the below question for quite some time, and I don't have a pointer to move forward.
A certain Error Control Coding scheme using block codes takes an input block (dataword) of 500 bits
and appends a 50 bit code to produce a 550 bit codeword which is then transmitted across channel that
c... |
I am a bit confused on how I can show the finiteness problem is undecidable using Rice’s Theorem.
So I’ve got something like B = { | M is a TM and L(M)- finite}. I thought I could reduce A TM (determine whether a TM accepts a given input which I already know is undecidable) to B but then I’m not sure how I would constr... |
I am getting confused with calculation of EEMAT(Effective memory access time). I decided to close the book and think on my own and make an equation. Please see whther this is correct or not. I thought a lot and also refereed google but i am lost. Please help!
Let TLB hit ratio = x.
TLB access time = c
main memory acces... |
[1] discusses how to construct an ensemble of neural networks by giving each network a certain weight $\alpha_i$:
\begin{equation}
f_\mathrm{GEM}(\boldsymbol{x}) = \sum_{i=1}^N \alpha_i f_i(\boldsymbol{x})
\end{equation}
where each $\alpha_i$ is obtained using a correlation matrix which is defined in the following way:... |
Is there any algorithm or procedure to convert a centralized algorithm to a distributed algorithm? Is there any theoretical result or relevant complexity analysis?
|
Let's say I reduce the problem $A \in L$ to $B \in K$ , with a function $f: \Sigma^{*} \rightarrow \Gamma^{*}$ such that $w \in L \Leftrightarrow f(w) \in K$ . I know if I want to solve $A$, given some polynomial time algorithm for $B$, I just have to transform $A$ to $B$ and solve $B$. So it can be thought as:
The r... |
I want to find a Context-Free Grammar for $L:=\{a^nb^mc^{n+m}\mid n,m\in\mathbb{N}\}$
I've tried the following:
$G=(V,\Sigma,R,S)$ with $\Sigma=\{a,b,c,\lambda\}$, $V=\{S,B\}$, $S=S$ and $$R=\{S\to \lambda\mid aSc\mid B,\;B\to bBc\mid \lambda\},$$
which would output $L:=\{a^nb^mc^{n+m}\mid n,m\in\mathbb{N}\}$, in my ... |
Set Cover Problem: Given a set $X$ and a collection of subsets $S_1, S_2, \ldots S_m \subseteq S$, we want to find the smallest cardinality of a set of $k$ elements $\{i_1, \ldots i_k \}$ such that $\displaystyle \bigcup_{i = 1}^k S_{i_j} = X$.
Let $o$ be the size of optimal solution for the Set Cover problem. We know... |
$\textbf{Problem:}$
Getting a $\textit{polygon-mesh}$ as input, I have to construct a surface that looks exactly to the given input. My task is to generate a $\textit{b-spline}$ surface that exactly looks like the connected polygon mesh. It is obvious that my $\textit{b-spline}$ surface has to have a degree of one in b... |
My professor said that the non-regular language $L_{1} = \{ 0^n 1^n \space | \space n \in \mathbb{N} \}$ belongs to $\mathrm{P}$. I do understand that all regular languages belong to $\mathrm{P}$ as it's easy to determine and so can be computed in $\mathcal{O}(n^k)$, but why do most non-regular languages not belong to ... |
Consider $ab$ and $cd$ which are two words. We merge these two into 6 possibilities: $abcd, acbd, acdb, cabd, cadb, cdab$
So in general, a merge of words/sequences $x, y ∈ Σ∗$ , is a word of length $|x| + |y|$ with both $x$ and $y$ as disjoint subsequences in it.
For two languages $L1$ and $L2$ their merge is defined a... |
One of the greatest challenge in learning one is how broad the literal computer science is. Just talking about memories and CPUs would just took you to endless adventure of this technology. How does the expert manage to understand all of this if I ever want to be one of them?
Maybe someone ever be on my position, not ... |
So I can solve a given problem using dynamic programming in $O(n^2k^2)$ time complexity. This means that the problem is in P. But I am asked if it is in NP.
My answer is, "Since it is also polynomial time solvable, the problem is also in $NP$".
Is that a correct statement? If not, is a problem in P solved via dynamic p... |
I want convert timetable scheduling problems to SAT problems. Suppose there are $t$ time slots and $c$ classes. I will define $t\times c$ variables $x_{ij}$, which is true iff class $j$ takes place in time slot $i$. My problem is: suppose there is a constraint that class $a$ takes place after class $b$. How to encode t... |
Carnap's diagonal lemma asserts that for every computable formula f, accepting a natural number as argument and resolving to {false,true}, there exists a logic sentence s for which:
s $\leftrightarrow$ f($\ulcorner s\urcorner$)
With $\ulcorner s\urcorner$ the Gödel encoding for logic sentence s.
I have a problem with ... |
Are there any well-known data structures known that can handle the following (need to scope whether something is possible):
Return the k-closest points to a ray shot through the cloud.
Allows quick updates of point locations (basically every point is moved every 500000 queries or so at which point around 500000 old po... |
The paper Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism provides examples for checking if one function type is a subtype of another, which I think demonstrates checking constructors with parameters which are covariant or contravariant.
I can not see an example of the subtype rule for type co... |
I've read many blogs about this but I still get somehow confused, specially why a webhook is a thing vs an API and not just a subset of API.
The way I interpret from most places (and interpret is the key work here) is that a webhook is just a passive "webmethod" that expects a POST (from what I read in most places). H... |
Recall the rod cutting problem.
Given a rod of length $n$ inches and a table of prices $p_{i}$ for $i=1,2,3,4,\,.\,.\,.$ determine the maximum revenue $r_n$ obtainable by cutting up the rod and selling the pieces.
You may assume no cutting cost.
The following is a question from CLRS 15.1-2.
Show, by means of a cou... |
I am looking over a past exam for a theory of computation class I am taking, and unfortunately no solutions are provided. I am stuck on this question, and would greatly appreciate any help or hints.
The Myhill-Nerode Theorem provides the minimum number of states of a DFA to recognize a regular language. Argue that an... |
I am learning oracle Turing machines, which is normal Turing machines equipped with a write-only query tape and with access to a query oracle.
My question is, is there a limit of the content that can be written on the query tape?
Here is my try: Suppose the oracle Turing machine is $S(n)$ space-bounded. Then the machin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.