instruction stringlengths 35 29.1k |
|---|
Let's define the following operations:
$odd(string) = $ odd characters of $string$, $even(string) = $ even characters of $string$
Now say we have some language $L$, we will then define the following languages:
$odd(L) = \{odd(w): w \in L\}$, $even(L) = \{even(w): w \in L\}$
Need to prove that there exists a non-regula... |
A controlled not gate matrix looks like this:
$$\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
\end{bmatrix}$$
That works great when you only have two qubits and you want to use the first qubit as the control, and the second qubit as the input to be flipped (or not).
Is there a meth... |
So let's say I have an array of elements where each of the values can range from 0 to $n^2-1$. I'm trying to make an algorithm to sort this array in O(n) running time and I was thinking of using radix sort. The run time of radix sort is O(d(n+N)) or O(dn) if n is really large. So how can I modify radix sort so that it ... |
I would like to know whether we could replace the second image with first image since the second image contains less transitions and states than first image even though everyone uses second image to show construction of (a*).
|
I use a software for pollutant propagation on rivers that takes as input a set of parameters (p1, p2, ...pn) and creates an output file which is basically a matrix where on each row there is represented the concentration of pollutant in various places along the river at a given timestamp.
\begin{array} {|r|r|r|r|r...|... |
Since, I don't have strong algorithmic background my question may sound a litlle odd. Please correct me, if so.
I have quite a large bitmap (~100 Million bits) (e.g. 100100101001010001001...010010). The bitmap is just an example, it doesn't have to start with 1 or end with 0.
Now, I need to choose randomly any 0-bit f... |
Skip lists are taught as a standard of the undergrad CS curriculum at many major universities. However, from my reading* I can't find any practical situation where you would use a skip list over a treap. Also they have the same asymptotic performance for all the main operations.
As a result this left me wondering:
... |
I am looking for a better explanation (research level, papers) to answer:
Why translating a program from one high-level programming language directly into another is difficult?
Note: When I say difficult I don't mean "hard" - i.e. I am not taking about computational complexity here simply because I am unaware of such ... |
I have the following question about giving a series of examples of range spaces for my Hitting Set problem that establish a lower bound for the integrality gap (IG).
IG is the supremum of ratio of the optimum for natural integer linear programming (ILP) formulation of Hitting Set to the optimum for its (mean ILP) LP-r... |
I was reading about Cellular Automata and I read in this question that
Matthew Cook proved that rule 110 is universal, and that his proof relied upon showing how rule 110 can simulate a tag system. Is there another method or information that would still prove the universality of rule 110? In other words, is there ano... |
I try to understand balance factors change after local rotations in AVL trees.
Given the rotate_left operation:
x y'
/ \ / \
a y => x' c
/ \ / \
b c a b
and $b(x)$, $b(y)$ - balance factors for $x$ and $y$ nodes - I want to find $b(x')$ and $b(y')$.
In my reasoning I will... |
Say I have two systems that take the same drawing commands and starts drawing on their respective platforms (i.e. HTML Canvas). After this is done, I want to save and compare these two images to ensure that they are perceptually the same, even though the shapes and colors may be very slightly off (non-perceptible diffe... |
I was reading "Parsing Techniques: A Practical Guide, Second Edition" by Grune and Jacobs, which details a bunch of different parsing algorithms. In the section on $LR(2)$ parsing, they mention that unlike $LR(1)$ items, which just have an item lookahead (the token that should appear after the completed $LR(1)$ item), ... |
Let's assume the following definition of a red-black tree:
It is a binary search tree.
Each node is colored either red or black. The root is black.
Two nodes connected by an edge cannot be red at the same time.
Here should be a good definition of a NIL leaf, like on wiki. The NIL leaf is colored black.
A path from the... |
I am trying to get the a CFG for this. I got this:
L1={uv | u ∈Σ∗,v∈ Σ∗1Σ∗ and |v| ≤ |u|}
U -> A | B
A -> 0A | E
B -> 1B | E
V -> 1T | 0T | T
T -> G1
G -> I1 | I0 | E
Is this correct? UAB does the u section then VTG get the v part. Or am I completely doing it wrong?
|
Lately graph theory has come into everyday practice with graph databases. So I wonder if any object can be written as a graph? I don't have the formal definition of an object, but say it is a C struct or a Java Object, isn't it so that we can express objects as graphs and that it is a more convenient and advantageous r... |
We know that general palindromes cannot be decided by a DFA.
Howeve if you restrict to case of even length palindromes, does a DFA need exactly $2^{2k}$ states where $2k$ is length of palindrome the language needs to accept?
I get this as lower bound from Myhill Nerode aplication.
From answers below, my lower bound is ... |
I'm toying around with graph properties and I want to make some effort to check whether a given graph is Hamiltonian. I understand that the general problem is NP-complete, but I'm looking for simple checks that are easy to implement and computationally inexpensive to get some indication.
So I've implemented Dirac's and... |
I am thinking of the classical paper, https://www.cs.sfu.ca/~kabanets/Research/poly.html
Can someome link to some papers/reviews that give a sampling of what are the recent thoughts in this direction?
I am equally happy to know of what are the recent directions in the topic of pseudorandomness and derandomization.
|
Can you express evaluation order using big-step semantics?
For example, in a simple language consisting of only if t then t else t and true and false, we can decide to only step a if then else to one of its branches if its branches are already values.
Can big-step semantics express the same thing?
|
Does Schaefer's dichotomy theorem establish that a general 3-sat clause cannot be transformed into an equivalent set of 2-sat/Hornsat/affine clauses (using auxiliary variables) or just that this would be very unlikely in that it would imply P = NP? I ask because I know that there are some types of problems involving 3... |
Context: After creating the minimum spanning tree, the next step in Christofides' TSP algorithm is to find all the N vertices with odd degree and find a minimum weight perfect matching for these odd vertices. N is even, so a bipartite matching is possible.
When the N odd-degree vertices are found, there are $n \choose... |
The following exercise is inspired by an old exam question (note that this is not the question):
Let us define a single-letter alphabet $\Sigma = \{a\}$ and the language $L = \{ w \in \Sigma^*: |w| = 2^n, n \in \mathbb Z_+\}$. (In other words, $L = \{a^2, a^4, a^8, \ldots \}$.) What is an unrestricted grammar for $L$?
... |
I'm struggling with a proof in the text for my logic course, and I'm wondering if someone could offer a hint or some help. The question is basically as follows. Show that if the decision problem for satisfiability is solvable iff the decision problem for implication is solvable. Then, show that the decision problem of... |
I was thinking about the homework problem:
Given $n$ vectors in 3D: $(\mathbf{v_1},\mathbf{v_2},\dots,
\mathbf{v_n})$. Their coordinates are positive integers and less than $10^9$.
We should split this set into $k$ groups in the way that each two
vectors from one group are collinear and from different are not.
S... |
In computational theory, I came across both deterministic and non-deterministic finite state machines but I heard someone said there are no dead states in deterministic machines. I thought dead and empty states were the same. What I noticed is that empty states are represented by a special symbol called an empty set ∅.... |
Content: The Christofides algorithm finds a minimum spanning tree, then finds all the odd degree vertices, and adds extra edges using a minimum weight bipartite matching on those odd vertices to make all of them even, so that a Eulerian tour can be found (since all vertices are even now).
My question arises from a simp... |
I am thinking about the NP-completeness of two graph problems on different graph structures.
For example:
The Capacitated Minimum Spanning Tree for graph is NP-hard. However, is the problem still NP-hard for DAG or tree?
For Price Collecting Steiner Tree, it's NP-hard for graph. What about for DAG and tree?
|
Intuitively, given:
a graph
a root node
a reward mapping from node to real number
a cost mapping from node to real number
We want to find the tree that maximizes the reward while keeping a quadratic cost function under some threshold.
Formally, given:
a graph $G=(V, E, w, c)$ where $w: V \rightarrow \mathbb{R}$ and... |
Which general machine-learning methods are there that try to "learn" or interpolate a smooth multivariate function and which get to actually choose the points at which the function is evaluated during the learning process (exploration)?
The idea would be that each function evaluation is more or less costly and the algo... |
As you know a set of edges whose removal leaves $k$ connected components is called a $k$-cut. The minimum $k$-cut problem asks for a minimum weight $k$-cut.
For $k=2$ this problem is P.
Vazirani in his book says for any fixed $k$ when $3 \le k$ it is NP-hard and When $k$ is specified as part of the input this problem ... |
Suppose M is a CFL and N is aa RL. Then wouldn't the language generated by the intersection of M and N contain strings, some of which are accepted by both DFA and PDA? So if they are accepted by a DFA as well, then why is the generated language not an RL?
|
Consider the following variation on the vertex cover problem: given a tree on $n$ vertices, we are asked to calculate minimum size of a multiset $S$ such for each edge $(u,v)$ in the tree at least one of the following holds:
$u\in S$,
$v\in S$,
there are at least two vertices in $S$, each of which is adjacent to $u$ o... |
I am new here . Please forgive me if there is anything wrong in that I am going to write .
So , my question is about one problem given in last round of codeforces , pretty easy to handle it , but I do not understand the other players` solutions .
THE PROBLEM :
We have a convex polygon and numbers it's vertices 1, 2, ..... |
Best reference I could find is this one. However, I could not quite understand this one since there is no numerical example.
What I am trying to achieve with one sentence
How can I answer the following question by using constraint programming:
The Euclidean distances between a point $p_4$ and points $p_1(0,0)$, $p_2(0... |
For any $n \geq 4$, I was able to prove that every Apollonian network has $3n - 8$ triangles. An Apollonian network is a planar graph defined by recursively subdividing a triangle by three smaller triangles (adding a new vertex inside the face and connecting it to all three vertices). Now I am trying to prove a similar... |
Is the language $\{a^{n^2-1} | n \in \mathbb{N}\}$ context free? and how to prove it?
I think it is, but I could not find a way to prove it by using push down automaton or any other way.
|
I'm trying to compute a language defined as { ww | w ∈ {0,1}* } in JFlap using a Multitape Turing Machine. It seems a hard problem because there is no delimiter to know when the word w is ended.
I already checked this and this question, but this didn't helped me at all. The answers from "Construct Turing Machine which... |
I have a little problem I have been trying to solve for a hobby after a friend got me interested in fantasy football: given a list of players, positions for those players, projected points, salary, and a salary cap, build the highest projected scoring NFL team that fits the salary cap. I am interested in finding an eff... |
Just learnt that a problem in computer science can be divided into the following categories
Polynomial problems
NP problems
NP hard problems
NP complete problems
based on how long it takes to run the program
For example, suppose there is a problem P that can be solved with two algorithms say A1 and A2 where,
A1 is pol... |
I'm currently reading Introduction to the Theory of Computation by Michael Sipser and in his section on time complexity, he tries to justify why theoretical computer scientists divide problems into P and NP.
First he says:
$P$ roughly corresponds to the class of problems that are realistically
solvable on a compute... |
This question concerns the all-pairs shortest paths (APSP) problem (where we are given a graph with edge $(i,j)$ given weight $w_{i,j}$ by the distances between the two nodes $i$ and $j$, and where we want to get the lowest-weight path from every starting vertex $i$ to every ending vertex $j$),
The "Path reconstruction... |
According to the algorithm, is it true that I have to sample 1,...,D u's from the normal distribution with mean 0 and variance 1 (not sure what sigma square here refers to)? And then I have to construct the z as shown in the algorithm. However, I wonder how this will speed up gradient descend because creating sin and ... |
This the answer that was accepted for the arrangement problem of a library:
we have books with heights $H_n,$ $1 \le n \le N$ and widths $W_n,$ with heights in ascending order for each book, and we want to group them into shelves.
Reuse these numbers for solution nodes $n,$ where that node represents a solution state ... |
Say that there are $n$ days and there is $x_1, x_2, ...,x_n$ amount of data to process on each day. Your computer can process $s_1$ amount of work on the first day since rebooting your computer, $s_2$ work on the second day since a reboot, up to $s_n$. On each consecutive the day the amount of work your computer can pe... |
Given a set of integers $S=\{s_1,s_2,...,s_n\}$ and a target number $T$, find a subset of $S$ that adds up exactly to $T$ in $O(nT)$ time.
I am not quite sure how to solve this but I think I have the workings of a start in progress.
If we say the last number we choose is $s_i$, then this reduces the problem to finding ... |
I'm stuck on the following question:
How to prove the linear context free languages are closed under gsm mapping?
|
Let $G = (V,E) $ and let be $T \subseteq V$ . $T$ is called vertex cover if each edge of the graph is incident to at least one vertex of $T$ .
Let be the following decisional problem :
$PROBLEM$
Input : $G = (V,E) $ with $n$ nodes ; $k\in \mathbb{N}$ , $k \le n$
Output : $YES$ if exists $T$ such that $T$ is vertex cove... |
I know that $L=\{ \langle M \rangle \mid |L(M)| < \infty \}$ is not decidable (by Rice's theorem or using reduction, I followed it from $L$ not being decidable ). But is $L$ recognizable?
What I tried is, let $L$ have a machine that recognizes it, let it be called $H$. Then given an input $\langle M\rangle$ I would st... |
Recall that a false-biased Monte Carlo (MC) algorithm is always correct when it returns false for some decision problem i.e. it has a one sided error and its always correct on NO instances.
Assume that we have a false-biased MC algorithm. In this case when it says NO its always correct. This means that it is not allowe... |
Is the jury still out on this or do we now know which of the above mentioned ways of randomizing Quick Sort is the most optimum as far as average case running time (averaged over all possible input arrays, with all permutations of the numbers being equally likely) is concerned?
Or perhaps, has a case been made for the ... |
I am trying to prepare for a test comping up on run-time analysis. I have been hit with a for loop that is throwing me a bit. I am hoping someone can help me.
the loop is
for(j=1; j< n; j=j*2)
J is increasing at an increasing rate so it will be less than n/2 however I am having trouble concluding what exactly it ... |
I have written an algorithm for sorting that I thought of, and I'm not sure if it exists. Basically, it runs through each index of an array and if the value of index n > the value of the index n+1, they get swapped. My java code is below.
Here is the example of it running on an array of length 4.
(Given) [3,2,7,5]
(S... |
Suppose $N$ is $L$-bit long and $k$ is also $L$-bit long.
How to show that it takes at most O$(L^2)$ operations to compute it.
For example $N = 1010$ and $k = 10$. Then $N^k = 6^2 = 100100$. But I am not familiar with how $100100$ comes up without going back to decimal and using the fact that $6*6 = 36$. Therefore, I... |
I am going to consider Freivald's algorithm in the field mod 2. So in this algorithm we want to check wether
$$AB = C$$
and be correct with high probability.
The algorithm choose a random $r$ n-bit vector and if
$$A(Br) = Cr$$
then outputs YES, otherwise outputs no.
I want to show that it has has one-sided success ... |
There is a tree with $n$ nodes. All edges are of equal weights. The vertices of the tree can be of two types: 0 or 1. There are two types of queries:
Set(X): change the given vertex X from type 0 to type 1,
Dist(X): find the shortest path from X to a node of type 1 and return the length of this path. This will retu... |
My question is related to this:
Hash-Table in Practice
In [1] page 7, it is said that if we throw $n$ balls into $k$ bins, then each bin contains at most $\frac{n}{k}+O(\sqrt[2]{(\frac{n}{k})\log k}+\log k)$ elements with a high probability.
Question 1: Why is $O()$ used in the above estimation?
Question 2: Does i... |
Is infinite union of non-regular languages $L_i$ that form a chain such that $L_i\subseteq L_{i+1}$ always non-regular?
Or is there a possibility that it be ever regular?
Is there an easy way to see this?
|
Are there any examples of real-world computer languages that are non-deterministic?
By computer languages I include programming languages, markup languages, query languages, modeling language, transformation languages, etc.
By non-deterministic I mean they cannot be parsed with deterministic grammars.
|
I consider problem: proving lower bound for comparison algorithm that check whether permutation is odd or even.
I know that this bound is $\Omega(n\lg n)$.
Could you give me a clue ?
|
Is there a direct way to represent Kleene plus(+) using Thompson's construction algorithm?
When I studied Thompson's construction I learned how to transform concatenation, union and kleene star of regular expresions directly into a NFA.
In wikipedia(and other websites) I found the same thing I learned in college(nothi... |
What is regular expression for language that does not contain $1110$?
It is easy to guess for language that contains. The shortest way I know is go through DFA. Is there a better way?
|
Say that we have nodes in a tree and it has a branching factor of 3. At the leaves we have a binary value 1 or 0 (which can be viewed as "votes"). Each parent computes the majority of its children and assigns itself that value ("vote").
What I want to show is that in the worst case, a deterministic algorithm will have ... |
Can data structures be thought of as algorithms themselves?
For example, I could implement a stack data structure that has certain non-functional characteristics.
Is the separation between data structures and algorithms formally defined?
|
I have a problem how to find best, worst, average case in armstrong number algorithm?
Here the pseudo-code :
Declaration:
n : integer
Sum : integer
Temp : integer
Rem : integer
Algorithm:
Input(n)
Temp <-- n
Sum <-- 0
Rem <--- 0
While ( n != 0 ) do
R... |
I have started reading graph theory from Introduction to Algorithm. The author starts by saying that if the graph is dense then:
$$|E|\text{ close to }|V|^2$$ else if the graph is sparse then:
$$|E|\text{ is much less than }|V^2|$$
According to me the above two relations makes sense in respect of a complete graph where... |
Inspired by this quote attributed to Alan Perlis:
For every polynomial-time algorithm you have, there is an exponential algorithm that I would rather run.
How I interpret this statement is that some exponential running times should be preferred over polynomial ones for realistic problem sizes. I have never actually ... |
You are given an m x n grid. A dimensionless ball is placed at the centre of one of the grid squares and starts moving in one of 4 directions: north-east, north-west, south-east, or south-west. The ball continues moving until it reaches the edge of the board at which point, it bounces back in accordance with the laws o... |
Normally the space complexity of an Algorithm $A$ is denoted $\textrm{SPACE}(A)$, which means how much space is needed by the computation itself. I would however like to also describe how much storage an algorithm needs, i.e. if I have a Turing Machine with three tapes, one for the input, one for the computation, and o... |
Let $D=(V,E)$ be a finite directed graph with no isolated nodes(from every node there is at least one edge entering and one exiting). For $v \in V$ define the following sets: $$v^+= \left\{w \in V|(v,w)\in E \right\}, v^-= \left\{w \in V|(w,v)\in E \right\}$$
For some $S \subseteq V$ we have, $S^+= \bigcup_{v \in S} v^... |
I'm new to pathfinding algorithms and trying to find a good or even optimal heuristic for the following problem:
Say you have a 3D square-lattice cuboid graph with randomly removed edges (with probability $p$). The cuboid has a finite cross section of $n \times m$ nodes and a potentially infinite layer length $l$. Star... |
I understand that the output for Latent Dirichlet Allocation is a distribution over K topics.
Suppose I have a Dx(K+1) matrix, where rows are documents and columns are the topic distribution + one column for class. For example, each row represents one movie review. The first K columns represent the topic distribution o... |
I got a weighted, connected and directed graph $G$. There is a vector called the distance vector $Dv \in \mathbb{N}^n$ in which $Dv_i$ is the shortest distance from $1$ to $i$. All edge weights are positive integers. I have to show that every distance vector $Dv$ satisfies:
$Dv_1 = 0$.
For all $j \neq 1$ there exists ... |
With reference to the Heuristics section of Classical planning in Artificial Intelligence: A Modern Approach by Russell and Norvig, there is a question: consider
an air cargo problem with 10 airports, 50 planes, and 200 pieces of cargo. Each plane can
be at one of 10 airports and each package can be either in one of t... |
So if i only used iterative requests to a recursive dns server and since this server has cached results from recursive queries, does this mean the iterative request gets a result from the cache or just a response with a difference server to check?
Example for clarification:
User requests example.com
recursive dns serve... |
Given the PDA $P = (Q_P,\Sigma,\Gamma_P,\delta_P,F_P)$
and the DFA $D = (Q_D, \Sigma, \delta_D,q_D,F_D)$
What is the 6-tuple definition of the PDA such that: $L(P') = L(P) \cap L(D)$
I don't understand what the intersection of these two FAs represent, and my only guess at what the 6-tuple is would be something along th... |
What known NP-complete problem would one reduce to $k$-Edge-Colorability to prove that the latter is NP-hard?
|
In several papers I have read that Bit-parallel pattern matching is an NFA-simulation.
My questions are:
1- Is it true in general? Or, is there any restrictions?
2- As any regular expression can be converted to NFA, how Bit-parallelism is able to handle some regex like: a?5
Update: Bit-parallel pattern matching is a f... |
Is there a term for languages, imperative, declarative, procedural, functional alike; a term describing the quality of functions being represented as a (reversible) relationship between inputs and outputs? Or alternatively, where inputs and outputs are done away with in favor of just *puts, where any given *put can be ... |
I actually have to prove the following :
$\mathbf{NL} \subseteq \mathbf{NC_2}$
I have the following approach :
I will prove that $\mathbf{PATH} = \{〈D, s, t〉 | \text{D is a directed graph with a path from vertex s to t}\} \in \mathbf{NC_2}$.
I will show that $\mathbf{NC_2}$ is closed under log-space reductions i.e:
... |
$NP = \cup_{k \in \mathbb{N}} NTIME(n^k)$
$P = \cup_{k \in \mathbb{N}} TIME(n^k)$
Can we show that $NTIME(n^k) = TIME(n^k)$ for a specific $k$?
For how large of a $k$ can we show the above statement to be true?
|
Since we started talking about relations on languages and so on i keep on struggling with this subject.
So now iam faced with two questions where i really dont know how to start.
First of all, the natural relation of a language $L \subseteq \Sigma^*$ is the equivalence relation on $\Sigma^*$ with the equivalence cl... |
I apologize if this is the wrong place or too trivial a question for this community. What is the best data structure to store a time-windowed streaming graph in order to compute fast statistics over all nodes in the graph, for e.g., running computation of average degree?
I believe the best way to describe this is as fo... |
Is there a nice way to give context free grammar for
$$\{a^nb^ma^kb^l:n+m=k+l\}?$$
From PDA point of view it seems we just push + on stack if we see a, push + on stack if we see b, pop + from stack if we see a, pop + from stack if we see b and accept if you have empty stack.
|
This is specifically a question pertaining to solving reccurences via the Master Theorem/Method, particularly for a specified $f(n)$ (as denoted below).
For a recurrence of $$T(n) = a T(\frac{n}{b}) + f(n)$$
where f(n) is $\Theta{(n)}$, would we be comparing $n^{\log_b(a)}$ with $n^{1}$ - meaning we would be comparing... |
I'm learning about the stack but one thing I am unable to understand is how variables can be accessed in the correct order.
So if I had a basic program calculating the sum of some user entered values (pseudocode)
Input value1
Input value2
Input value3
Input value4
Input value5
result = value1 + value2 + value3 + value4... |
I need to write a context-free grammar for this Language :
$\L = {a^nb^k | 1 =< n <= 2k}
Please help me solve this problem!
Thanks.
|
At our company, we've started using Amazon Machine Learning to predict the likelihood of a certain segment of our customers cancelling their subscription.
We only have 500 customers in that segment so we uploaded training data of all our customers who
are on a subscription or
were on a subscription but cancelled
Amaz... |
My question is related to this question I posted in math forum:
https://math.stackexchange.com/questions/1512644/balls-and-bins-hash-table-a-concrete-example
but I could not get an answer that I need.
Please assume upper bound on set cardinality is $n$ (so the set has at most $n$ elements). A server wants to construct... |
I consider following problem:
It is given array with numbers, for example $[-2,0,1,-324,213,321,-2]$.
The problem is: replace elements such that negative numbers precede the non-negative. For our example: $[-2, -324, -2, 321,0,213,1]$.
Additional requirement is that algorithm should do minimal number of replacements. ... |
Suppose we have a set of functions $f_i: \mathbb Z \rightarrow \{0,1\}, i=1, \dots,n $, with the following property:
For each $i =1,\dots ,n$, there exists an $x\in \mathbb Z$ such that $f_i(x)=0$ and $f_j(x)=1$ for each $j\in \{1,\dots,i-1,i+1,\dots,n\}$. Also, there exists an $x \in \mathbb Z$ such that $ f_i(x)=1$ f... |
Good evening!
I am studying scheduling problems and I have some difficulties understanding constraints of potentials:
Let be $t_j$ the time when a task $j$ starts, and $t_i$ the time when a task $i$ starts. I'm assuming that $a_{ij}$ is the length of the task $i$ but I'm not sure. Why is a "constraint of potential" ma... |
Subset-sum problem is NP-complete. I presume so is the problem of determining, given a positive integer $p$, whether in a set of positive integers $\{x_1,x_2,...,x_n\}$ there is a subset which sums to one of the numbers $\{p-1,p,p+1\}$. Am I correct?
I've been struggling to reduce standard Subset-sum to this variation,... |
Suppose I have 2 qubits in the state a|00>+b|01>+c|10>+d|11>. And suppose I want to perform some operation between only the 1st qubit and a 3rd qubit - for example a CNOT operation. What would be the correct way to do this multiplication?
|
So I'm kind of wondering if I'm correct on something relating to an algorithms class. Let's say I want to, for whatever reason, find the maximum spanning tree of a graph such that the edge weight is at maximum instead of minimum.
In addition, let's say I want to find a spanning tree with the maximum product-sum weight ... |
From what I understand, the rules for CFL from my notes say:
If $L$ is a language and
• for all integers $N$,
• there is a string $w \in L$ of length greater than $N$ such that
• for all ways of writing $w$ as $uvxyz$ with ($v \neq \epsilon$ or $y \neq \epsilon$),
• there is an $i$ such that $u(v^i)x(y^i)z$ is not in $... |
I want to classify superpixels in a image using a Markov Random Field/ Conditional Random Field model but have found no place that can help me with this (references don't even show how the network is visually). I already have the superpixels and the features associated to those superpixels, I'm only missing the MRF/CRF... |
Let's say that we have a string "1.2.3" and want to find a match for it in the following records:
1.2.9
1.4.5
1.*.3
For each record:
The . is a separator that divides the string into segments.
Each segment can have a static value or * that matches any segment value.
There are no duplicated records. If there are multi... |
I'm new to stackoverflow so please bear with me. A tutorial question I got given was as follows:
You are given that $C \subseteq D \subseteq F^n_q$ where $|C| < |D|$ and $C$ is a perfect code. Show that $d(C) > 2d(D)$.
I have been using the fact that $C$ is a perfect code so it attains the Hamming bound then saying th... |
I am trying to find a assignment to satisfy a 2-sat statement. Problem is some of the clauses are 0 or x or 1 or x. I think the 1 or x clauses have no effect on the solution, but the 0 or x clauses determine the value for x. As I have clauses like ~x or y the determined value for x results in determining the value for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.