instruction stringlengths 35 29.1k |
|---|
We consider a partially filled starting grid, where $n^2$ is the side size of the grid, $m$ is the number of non-empty initial squares, $f$ is the function that places randomly initially the integers into the squares of the grid, the $((x_i,y_i))$ are the coordinates of the initial non-empty squares, $p_i$ are the init... |
i would like to perform a reduction for my novel problem to preferably the set cover problem, but i am a bit lost..
My problem can be described as follows:
Suppose you have given an binary word as input =101101…, an integer and a set of smaller binary words $_1,_2,…,_$
with $length(w)$ is a strict divisor of $length(u... |
I was trying to figure out how can I construct a non-deterministic Turing machine that decides the language $L = \{0^{n^2} | n \geq 1\}$
I looked at some of the proposed solutions here :
Turing machine for unary encoded quadratic numbers
and here:
How to check if a number is a square with deterministic single-tape Turi... |
In Java, I'm getting the error for all my return statements that I can't return a value with a void result type, but I don't declare the return type as void anywhere, and I'm really not sure what the issue is. Here's my code:
public class Card {
private int suit;
private int rank;
public Card(int suit, int rank) {
... |
A set of n independent tasks, each having integer execution times,
are to be executed using three identical processors. A task can be
executed in any of the three processors. Develop a sequential
algorithm to find minimal total execution time for scheduling all the
tasks. For this develop an initial recursive definitio... |
I'm aware that the worst case scenario recurrence relation corresponding equation is:
$$
T(n) = T(n-1) + T(0) + \Theta(n)
$$
However, I really don't get how the last term $ \Theta(n)$ was determined.
I dont understand why $ \Theta(n)$ and not $ \mathcal{O}(N) $
I don't get why it is $ \Theta(N) $ and not $ \Theta(N-1... |
The C semantics treat the result of a comparison or any true/false operation as just an int with value 1 for true or 0 for false. This is simple and intuitive.
However, mainstream processors do not work this way. Comparison instructions do not output a byte or integer or any value with 1 or 0 as the result of the compa... |
From a list of practice problems for a graduate Theory of Computation course. I've done quite a few problems at this point on deterministic Turing Machines, I just don't think I have fully grasped the notion of non-determinism in the context of TM's yet.
I suppose this TM would work something like this: Given an input ... |
Find an algorithm for edge connectivity in undirected graph using flow networks. Try to use $O(m)$ edges.
So basically the flow network should be used as a "helper function" and the graph that I give this helper function should have $O(m)$ edges.
How can I do that? So far I know about Ford-Fulkerson algorithm and Dinic... |
There exist plenty or practical FEC algorithms - RS, Golay, convolutional codes of all sorts. All of them assume that the original data and the FEC code are sent over the same channel with the same error rate. Are there any algorithms where the size of the error correction code can be reduced, assuming that the code is... |
I am currently studying algorithms and computational complexity at University.
I have recently got through three questions I found in an old exam:
Is it possible to sort in asymptotically linear time an array of rational numbers between $[1, 1.5]$ with limited numerator?
Is it possible to sort in asymptotically linea... |
In version gamma of the ACM/IEEE/AAAI Computer Science Curricula 2023, on page 50, one of the illustrative learning outcomes for the "Computational Models and Formal Languages" section of the curriculum states that students should be able to
Use arithmetization and diagonalization to prove Turing Machine Halting/Undec... |
I'm performing a sequence of text formatting using regex in Python.
I'm curious to know if it's possible to formally verify whether a single (or a sequence of) regex modification(s) is idempotent, which means that for every text, d ∘ d (text) = d (text), where d denotes the resulting total modification.
To be precise,... |
The problem of interest is
$$
\min_{x\in\mathbb{Z}^n} \frac{1}{2}x^\top Q x + c^\top x
$$
where $Q$ is a positive definite matrix. I am reasonably sure this can't be solved in poly-time, since the closest lattice vector problem (in $\ell_2$ norm) can be reformulated in the above form. Do we have a proof of $\mathsf{NP}... |
I looked through many sources which give this as an example for cfl. It also makes sense according to this:
But it fails the pumping lemma test.
Let's take n=5.
According to the Pumping Lemma, we can decompose
s into uvxyz like:
u=0, v=0, x=0,y=01, z=111
If we pump it, it clearly fails.
So, is 0^n1^n context free or n... |
There is this paper in which HIV is modelled using cellular automaton. I am trying to replicate this work but I am not getting the same results as the authors. In this paper the authors describe the rules they are implementing. I will post my implementation of the code after the rules description.
constants and other v... |
I recently faced this problem in CLRS ed.4 and couldn't find out how to attack it and solve it. Here's the recurrence:
$$T(n)=3T(\frac{n}{3})+8T(\frac{n}{4})+\frac{n^2}{\log{n}}$$
Here's what I tried:
$$\frac{3}{3^p}+\frac{8}{4^p}=1$$
For $p=1$, we get $\frac{3}{3}+\frac{8}{4}>1$ and for $p=2$, we get $\frac{3}{3^2}+\f... |
This is a problem inspired by a video game that I've been thinking about for a long while, and I haven't convinced myself that I can do any better than brute force + pruning techniques, which would still take way too long to solve.
Is there anything better? Any class of algorithm I should look into more?
Problem descri... |
As far as I and this wikipedia page know, there are no collisions (2 inputs with the same output) found in SHA-256 (yet).
what would happen if a collision were to be found,
1. would it be easier to find more collisions? (based on the first collision found)
2. is a single collision found a major security risk as the onl... |
Suppose $L_1\preccurlyeq_T L_2$, and $L_1$ is unrecognizable, can $L_2$ be recognizable?
With decidability, if $L_1$ is undecidable, then $L_2$ is undecidable, because $L_1$ is the “easier” question. Would this apply to recognizability, too?
|
This cstheory.SE post gives various randomized approximation algorithms for the set cover problem. Is there a randomized algorithm (which runs in $\mathrm{poly}(n)$ time) for the set cover problem which achieves an approximation ratio of $1$ (with high probability)? Is it possible to achieve such an algorithm, or is th... |
Assume we have:
$$T(n)=7T(\frac{n}{2})+n^2\lg{n}$$
Can we solve it using master theorem?
As we know $n^{\lg_2{7}}\approx n^{2.81}$. On the other hand, we have $f(n)=n^2\lg n$. So we should compare $n^.081$ and $\lg{n}$. As I know, $\lg{n}=\mathcal{O}(n^{0.81})$. So the answer should be $T(n)=\Theta(n^{\lg7})$. Am I rig... |
Given a set of 2D vectors. Find maximum magnitude of sum of a subset of the set.
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? I need research papers specifically.
|
I have a solid grasp on why we minimize the L2 norm of the weight vector ( w ) in Support Vector Machines (SVM) for classification problems — it maximizes the margin between classes and helps the model generalize well to unseen data. However, I'm finding myself lost when trying to understand the analogous concept in Su... |
Assume this recurrence:
$$T(n)=T(n-1)+\frac{1}{n}$$
As we can use Master Theorem and Akra-Bazzi method here, I tried to draw a recurrence tree and I reached the whole cost of this tree is $\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{n}$. What's a tight upper and lower bound for this recurrence (I'm talking about... |
Assume this recurrence:
$$T(n)=T(n-2)+\frac{1}{\lg{n}}$$
I tried to draw its recurrence tree and I reached that the whole cost is $\dfrac{1}{\lg{n}}+\dfrac{1}{\lg{n-2}}+\dots+\dfrac{1}{x}$ that $x$ is $2$ if $n$ is even, otherwise is $3$. So somehow we should solve $\sum_{i=1}^{\frac{n}{2}}{\dfrac{1}{\lg{2i}}}$ or $\su... |
Is my proof that FINIT is undecidable correct?
FINITE= { ⟨M⟩ | M is a Turing machine that accepts only finitely many strings } is undecidable.
Answer:
To prove this we can use reduce to Halting Problem, which is a known to be undecidable problem.
to prove that FINITE is undecidable, assume for contradiction that there ... |
how to prove that in the Nearest Neighbor algorithm for the Traveling Salesman Problem with one modification, if it finds a hamiltonian cycle, it's the optimal cycle. the modification is if the shortest path it could choose is an edge to a node already visited, the algorithm stops.
|
For an integer linear program: Given a matrix $A \in \mathbb{Z}^{n\times d}$ and two vectors $b \in \mathbb{Z}^{n}$, $c \in \mathbb{Z}^{d}$, compute $max\{ c^{\top}x|Ax \leq b, x\geq 0, x\in \mathbb{Z}^{d}\}$ is an NP hard problem.
Also given matrix $A \in \mathbb{Z}^{n \times d}$ and a vector $b \in \mathbb{Z}^{n}$, d... |
In exercise 22.3-13 of CLRS (Intro to Algorithms 3rd edition), the authors provide the following problem:
A directed graph $G = (V, E)$ is singly connected if the existence of a path from $u$ to $v$ implies that $G$ contains at most one simple path from $u$ to $v$ for all vertices $u, v\in G$. Give an efficient algorit... |
Here's the problem statement (as given on GeeksForGeeks website):
Given a sorted dictionary of an alien language having N words and k starting alphabets of standard dictionary, find the order of characters in the alien language.
Explanation: We're given a sorted dictionary having N words. Here a dictionary is an ordere... |
If I am doing a many-one reduction from L1 to L2, since it is described as a total function, does that mean that every possible encoding in L2 should have been achieved from L1 or is it possible that there might be some encodings of L2 that cannot be derived from this reduction.
If such encodings exists in my reduction... |
In the Narasimha's data structure book, there is a line
The amortized time of a push operation in the incremental growth of array stack (realloc on every push) is $O(n) [O(n^2) / n]$.
I am confused with this Big-O notation here, what does it mean? Is arithmetic legal on big-o notation functions?
|
This is from the Narasimha's data structure book
For nth element (n - 1 index), if we want to push an element, create a new array of size n and copy old array to the new, and at the end assign the value of n-1 index.
After n push operations the total time T(n) is proportional to 1 + 2 + 3 + 4 .... + n ≅ $O(n^2)$.
Sho... |
I'm working on a problem from the Digital Design and Computer Architecture course on Systolic arrays.
The question set up is as follows:
The following diagram is a systolic array that performs the multiplication of two 4-bit binary numbers (a
and b). For example, if a=1110 and b=1011, the result of the multiplication ... |
Given a range of "K" bit numbers, we want to identify the whole range by using a subset within that range, with the following criteria -
If there are > "n" consecutive 0s, it becomes the 1st [00] prefix identifier value - case (a)
If there are <= "p" consecutive 0s, (where p < n), that value has to be identified as ... |
I am interested in finding an efficient algorithm for the following problem:
Let $x \in [0,1]^n$ be some vector, with $x_n = 1$.
We want to recover $x$, solely by asking queries of the form $\texttt{argmax}(x + v)$ where $v \in \mathbb{R}^n$ is an arbitrary additive shift.
A simple algorithm is to do binary search over... |
Here, flip() is a function that returns 0 or 1 with equal probability. It can be proved function Random(n) returns a number from 0 to n-1 with identically distributed probabilities (using loop invariant).
function Random(n):
v = 1;
c = 0;
loop
v = 2v;
c = 2c + flip();
if (v >= n) the... |
The runtime of Quicksort can be significantly reduced if multiple threads running on multiple cores can be used. With just two cores, just partition an array into two halves and let another thread sort the second half.
The problem is that with many cores, say eight, the initial partition of the array takes a very signi... |
I want to define a typed domain-specific lambda calculus which can simulate the sequence execution like common programming language. I wonder how to give its corresponding BNF, can I use p;F, let x=I in F in and If p then F1 else F2 to denote the sequential structure, let blinding and conditional branch?
|
I want to learn how to write objective functions for any problem or real-life action(not mathematical problems) can anyone suggest a good source? On online I am mostly finding objective functions for mathematical problems. Can anyone tell from where can i learn or practice those ?
|
I am trying to understand the personalised page rank algorithm. I have a graph with multiple types of nodes and I want to calculate how important other nodes are w.r.t these nodes. I am using personalised page rank algorithm for the same.
I followed the notes from this blog https://medium.com/polo-club-of-data-science/... |
According to my CS knowledge so far, a lexer uses DFA(which takes linear time) for 'each' token type to find the next token, so in the worst case, it should try 'all possible' token types of a language. (there are some other reasons, e.g. to find the 'longest matching pattern' to distinguish between if a(keyword) and i... |
Most papers that I have seen on proving digital logic focus only on the combinational circuits (ie using boolean logic). But real life circuits also have flip-flops, ie a time element an a clock. How to model such time and clocks in theorem provers, eg in hol or coq?
(as a very simple example) how do I model a modulo-1... |
For example if the condition is i<=n, and the n is decreasing in the loops, how can i calculate the time complexity?
Lets say we have nested loops like below:
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
x = x + 1;
}
n = n - 1;
}
Or if the decrement of n is being done ... |
Let
$U \subset \mathbb{N}$ be a finite universe set;
$B$ be a set of nonempty subsets of $U$ such that $B$ covers all elements in $U$, i.e. $\bigcup_{b \in B} b = U$, and if $b \in B$ then $b \subseteq U \wedge b \neq \emptyset$;
$c(i) = \{ b \in B : i \in b \}$ be the set of all subsets containing element $i \in U$;
... |
Given a length N (e.g. 20) and an array of lengths which are all <= N (e.g. [15, 1, 6]) I'd like an algorithm that finds the minimum number of N lengths necessary to be cut into the array of lengths.
The practical application here is for ordering steel: given a design from an engineer I'd like to specify how many lengt... |
I am trying to prove by the pumping lemma that $L=\{0^m1^n:0\le m\le n^2\}$ is not a CFL. Here is what I have so far.
Suppose for contradiction that it is a CFL and let $N$ be the pumping length. Set
$$ s = 0^{N^2} 1^N $$
Let $u,v,x,y,z$ be a decomposition $s = uvxyz$ such that $uv^ixy^iz\in L$ for every $i\in \Bbb N... |
I know that Dijkstra's algorithm is used to find the shortest path between nodes in a weighted graph. And I know that this can be used to model road networks.
Somebody online asked (but nobody answered) how one would go about modifying Dijkstra's algorithm to determine if an electric car can travel to every town in a w... |
Firstly, we define A and B as two decision problems with the same set of inputs.
Define a new decision problem "A AND B" as follows: The input to "A AND B" is any valid input x for A and for B. The output is to decide if A(x) = Yes and B(x) = Yes. For example, in the "Independent Set AND Vertex Cover" problem, we must ... |
This is a basic question, but suppose I have two disjoint universes $\mathcal A $ and $\mathcal B$, and some fixed types $A:\mathcal A, B:\mathcal B$. Would it contradict anything if I postulate that $A$ is a subtype of $B$? This would mean that $a:A \implies a:B$, so there is an overlap between $A$ and $B$, but there ... |
I'm learning about the (min-mean) cycle-cancelling alg for min-cost flow in Ahuja, Magnanti, and Orlan's Network Flows book (Chapters 9 and 10). When talking about the alg, they prove this fact related to the $\epsilon$-optimality of a flow:
Lemma 10.14: For a nonoptimal flow $x$, if we cancel a minimum mean cycle in ... |
According to the book " Operating Systems Concepts ", ninth edition , page 210, we have the following statement :
Many modern computer systems therefore provide special hardware
instructions that allow us either to test and modify the content of a
word or to swap the contents of two words atomically—that is, as one
un... |
Given the grammar with productions:
\begin{align}
S \rightarrow aSb \mid SS \mid \lambda\\
\end{align}
I would like to show that it is ambiguous. As I understand it, if you can show that some string can be produced with these rules through more than one leftmost or rightmost derivation, then the grammar is ambiguous.
A... |
Let us say that I wanted to solve a Hamiltonian path problem by treating it as a Hamiltonian cycle(on a weighted graph). I use a TSP solver, and implement a dummy node of edge weight zero, whose distance to every other node on the graph is equal to zero. Can I run Dijkstra's algorithm (either alone, or with other DP fu... |
This is for the leetcode problem 169. Majority Element. Given an array of numbers, where there is a guarantee that there is a number that exists in the array greater than floor(n/2), one can find such a number by selecting a random index and checking if it's value is the majority element or not, and repeat until it's f... |
The typical definition of an RMW instruction with e.g. sequential consistency is an instruction where no memory operation can happen between the load and the store in the global memory order.
Is there a reason to use this definition? Why is it not sufficient to just require that no operation to the same memory address ... |
I am trying to wrap my head around the following proof
Choose some language A $\in$ $TIME(n^3)$ \ $TIME(n)$ (the existence of such a language is guaranteer by the hierarchy theorem)
Let B = {1}
Note that $A \leqslant_{p} B, B \in TIME(n)$ but $A \not\in TIME(n^{3})$
The way I understand is that A is in $TIME(n^{3})$ ... |
My apologies if the title is confusing. First I begin with the statement that may be wrong but what I always thought what happened.
"Dennis Ritchie created C compiler which was used to create other Unix or Linux compilers, which helped us create current Linux eco system."
The idea behind this was that if you take a mod... |
By the closure property of context-free languages, if $L$ is context-free, then $L^R$ (the reverse of $L$) is also context-free, but $L\cap L^R$ might be non-context-free. I tried to come up with an example of $L$, but it seems the set of $L \cap L^R$ could only have palindromes (including languages like $aaa \ldots$) ... |
I am currently facing a question "Can a graph with a unique MST product a different spanning graph using Dijkstra vs using Prim's algorithm?" The answer is false and I am struggling to understand why (and also to come up with a counter example)...
|
Suppose the following fill-in-the-blanks exercise:
___ ___ and ___ ___ went to the ___.
Suppose the correct solution here is "John Smith and Mike Jones went to the pub". In other words: [John, Smith, Mike, Jones, pub].
But the following alternate solution should count as well - the persons are swapped but they are the ... |
I'm a mathematics undergraduate interested in theoretical computer science, machine learning, and neuroscience. I wish to pursue graduate studies in computer science but I fear I might not be able to since I haven't and won't be allowed to take any computer science courses for the rest of my undergraduate years. My cu... |
I am having trouble with a problem where I am given an adjacency list and a list of the nodes that must be visited exactly once to connect two nodes. What is the most efficient way of doing this? This problem is the Hamiltonian Path problem except it is only certain nodes that have to obey this principle. Let me know i... |
I have a problem that is 0/1 knapsack, but you are also able to swap the weight of 2 items up to k times. I came up with a O(nkc) solution, but I am looking for a faster o(n*c) solution. I think the intuition is we should use all k swaps unless we can use less than k swaps and use all of the max values with the minimum... |
(This is mainly about reads, and commercial products not hypothetical machines.) When loading a CPU register with data contained in L2 or L3 of a multi-level cache. Can the data that is in L2 or L3 but not in L1 be read directly, or must the cache line be transferred into L1 before moving to a register?
Another way to ... |
I'm following a book about graphs and they introduce a concept called 'activity network'. In an activity network, each vertex represents an activity in a project (like building a house for example) that needs to be done. An arc between two activities $uv$ means $u$ needs to be done before $v$ and the weight of the arc ... |
I am currently trying to build a simple computer in Minecraft (8-bit data, 6-bit addresses, no paging or segmentation), with redstone, where I can make run simple programs written similarly to code in the Little Man Computer. However, I have come across the problem that I have no idea which addresses in RAM are free to... |
Using a 1 way 2 stack, and a 2 way 2 stack PDA, I want to check if the length of an input string is strictly a perfect square number. How can I do this in both approaches?
|
Following bar graph shows maximum percentage cpu utilization of F16sv2 (16vcpu &32GB) azure virtual machine in last 30 days. Only sometimes CPU usage goes more than 60 percentage.
How to find the right number of CPU cores for the workload so cpu never goes under utilized?
What factors should we consider while doing sc... |
I read the question and answer at Number of nodes of a parse tree when the Grammar is in CNF?, and I'm curious about a related matter: obviously with a unrestrained LR grammar (as opposed to CNF) the relationship between input length and the number of parse tree nodes depends on both the grammar and the input string, b... |
Having encountered the concept of "pseudopolynomials", my understanding is that we have to be careful when the input to a problem is a number, that the complexity of the solution should be polynomial in the length of its representation and not its value; that is, if we want a solution polynomial in the size of the inpu... |
Let $n$ be a positive integer and $[n] := \{1,2,3,...,n\}$. You are given $k$ non-empty subsets of $[n]$. Decide whether it is possible to select exactly one element from each subset such that the elements selected form a permutation of $[n]$. I try to reduce the Hamiltonian cycle problem. However, Hamiltonian cycles o... |
Is there an algorithm that, given an undirected graph and one independent set IS1, finds an other independent set IS2 by adding and deleting vertices from the first IS1?
|
Specifically, properties that identify preconditions over which a function can be used without resulting in undefined behavior or data races.
For example, I am familiar with 3 important properties:
pure
idempotent
re-entrant
My question is whether:
is this set of properties non-overlapping and complete?
If not, is t... |
In Arora-Barak, the authors mention a way how TMs can compute everything that can be computed by computers. The idea is that every high-level language program has an equivalent machine language program which is basically a sequence of instructions. These instructions are easy enough to be implemented in TMs. I am attac... |
Consider we use a RAM model with word length w (or if you really want a more exact model, you can use Knuth's MMIX instructions with w-bit numbers).
Given a number n, we want to compute the most significant digit.
For least significant digit, this is pretty easy:
$n - 10 \lfloor {n\over{10}} \rfloor$
which is O(1).
If ... |
I am looking for algorithms (or at least something similar to the problem definition):
Given a fully-connected weighted graph $G$ with $n$ nodes, find a subset $S$ of edges that form a square lattice graph (where each node, except for the ones at the edges, is connected to 4 other nodes) such that the sum of edge weigh... |
I am having trouble with the statement that $DSPACE(\log^2n)\subseteq DTIME(n^{\log n})$ holds which is given without argument in the paper The structure and complexity of minimal NFA's over a unary alphabet in the proof of Theorem 3.2.
I only get to something like $DSPACE(\log^2n)\subseteq DTIME(\log n)$. (Using the u... |
I am attempting to draw the DFA of this problem but I'm kind of stuck. In another post I saw that the DFA should have 10 states. I'm finding it hard to even understand the question, is the input to the DFA the full string so for example 1001 or is it multiple inputs of length 3 in this example 100 and then 001. I've ma... |
In role playing games, switching equipment for better is a common procedure. My question is to find an algorithm that can optimize linear combination of stats the equipped gear gives - this is exactly how it works on The-West.net:
Each piece of equipment can be equipped in only one slot (there is approximately 5-10 of... |
Suppose I have this c++ code:
for(int i=0; i<n*n*n; i++) {
for(int j=0; j<n*n; j++) {
if(i>n && j<n) {
for(int k=0; k<n*n*n*n; k++) s++;
}
}
}
I need to find its time complexity.
What I tried doing is: I tried determining the times the if clause would be fulf... |
I found the proof of this theorem from https://www.csie.ntu.edu.tw/~lyuu/complexity/2011/20120103s.pdf.
Here is the screenshot of the construction of probabilistic Turing machine RP. (https://i.stack.imgur.com/76pyK.png)
The idea of proof is to show that if 3SAT $\in$ BPP, then 3SAT $\in$ RP. I understand the construct... |
In the code below, I describe a problem and provide a backtracking implementation in Python that solves it:
# Find the combination of k out of n measures that maximizes score
# while ensuring that their total cost does not surpass C.
# Each measure has a profit of m₁, …, mₙ and a cost of d₁, …, dₙ.
# The score of the... |
Me again.
This time I have a more general question.
Suppose I have the following code snippet:
int f(int k) {
int s=0;
for(int i=0; i<k*k; i++) {
s++;
}
return 2*k*k;
}
And the expression is:
f(n) * f(f(f(n)));
I am told that the complexity is O(n^2) + O(n^2) + O(n^4) + O(n^8)
I have several questions:
Why is... |
So this is the language that I need to prove is irregular via pumping lemma, however I am completely stuck with this and seeking some advice. The other ones I have done during my tutorial are much more simple but struggling a bit more when it comes to having two conditions as such. Any help would be appreciated
|
LogLog/HyperLogLog provides a great way for estimating the cardinality of the set of $n$ objects. At its simplest, you hash all $n$ objects into binary strings, find the largest number of leading 0's $z$ in $O(n)$ time (and basically $O(1)$ space), and $2^z$ is your estimate for the cardinality. In practice, instead of... |
How to prove that the heaviest edge in mst is not heavier than heaviest edge of any possible spanning tree? by heaviest edge of any Spanning tree i mean considering any possible Spanning tree, we have to prove that the heaviest edge in mst is not heavier than heaviest edge of that spanning tree.
|
I've been reading papers on streaming algorithms and ran across the following question which I haven't been able to answer: Consider the Dyck language $Dyck(2)$ over the alphabet $A = \{(,),[,]\}$ and let $f_n:A^n\times A^n \to \{0,1\}: f_n(x,y) = 1 \text{ if } xy\in Dyck(2)$ and 0 otherwise. Suppose two parties Alice ... |
I am reading Papadimitriou's Computational Complexity and got stuck on part d) of the following exercise (pg. 505)
20.2.14 A panorama of complexity classes. ... A language $L \subseteq \{0, 1\}^*$ will be called a leaf language. Let A and R be two disjoint leaf languages (the accepting and rejecting leaf language, re... |
I would guess that this question is going to make some people wonder how I haven't already found a solution looking through papers -- but I do not see a clear algorithm.
In implementing CDCL, I read this site, which gives the following definition:
Consider an implication graph $(V,E)$ obtained from a trail that falsif... |
Consider $n$ houses in a city which each house's water can be supplied with either a well or pipes from other houses. Constructing a well in a house $i$ costs $w_i$ and connecting a pipe from house $i$ to $j$ costs $c(i,j)$.
The question is to find an algorithm to find the minimum cost to provide water to all houses.
M... |
I would like to use or create a hashing algorithm that takes K inputs from 1 to N and maps them uniquely to different numbers on 1 to N. K can be 1 to N. Ideally I would like the hashing alg to be able to be salted, but I'm not sure that is possible if some of these numbers must be prime.
Someone in #algorithms on libe... |
I am trying to write down a code which would blindly search for a condition using breadth first search.I have been thinking of it for quite some time and I cant figure out how to continue.
On the one hand the data structure is a tree with each node having n children so in order to tranverse every node of the tree you n... |
Given a graph $G =(V,E)$, a set of colors $\mathcal{C}=\{0,1,2,3,...,c-1\}$, and an integer $r$, I want to know if I can find a coloring procedure that can assign a color to each nodes (all nodes must be colored) in such a way that each node can find all distinctive colors around it within a radius of $r$, i.e., for ev... |
As far as I know, all existing strongly polynomial algorithms for flows and assignment problem have $\Omega(V^3)$ complexity in the arithmetic model (assuming the graph is dense). I'm interested in the arithmetic model of computation, where each arithmetic operation on two numbers takes $O(1)$ time regardless of the s... |
I have asked a question on math.SE about if there is a way to do it better than by brute force, but this time I am interested in the complexity of the problem itself. I will repeat the problem, with a slight change to it:
Suppose, you have a box $B$ with $n$ items and you pull $k<n$ items out of it. Items have differe... |
I am trying to understand the probing model proposed by Yao in the paper "Should Tables Be Sorted?". Yao suggests a "Basic Model" (in the section appropriately titled "Basic Model") but there seems to be some disconnect in the way I remember hash tables and the way it is presented here.
Consider sorted table vs cyclic ... |
Are you able to construct a boolean circuit that computes the majority function of n bits where the circuit only takes up O(n) space? If so, what would that circuit look like?
I have a feeling it has to do with a Full Adder, but I am unsure.
|
I know that propositional satisfiability is NP-complete and that if I add first-order quantifiers I get the complete problems for the polynomial hierarchy and PSPACE. What happens if my formulas are relations $R(x_1,...,x_n)$ over boolean variables?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.