instruction stringlengths 35 29.1k |
|---|
So I'm solving bigger instances of some binary-linear-program using cplex.
The formulations of the problem I am using is integer friendly, meaning nearly all of my instances can be solved at the root node.
Additionally I have a pretty good heuristic for calculating solutions. The heuristic is quite fast and nearly alwa... |
I originally asked this question on StackOverflow but a comment was made to the effect that my problem pertains to Job Shop Scheduling and that it was more of a comp sci problem than a programming problem.
It's the first time I've come across this topic and I've tried researching with a view to solving my problem below... |
Given are two 2-d sets, each with its own bivariate normal distribution. I need to build an SVM classifier. The a priori probabilities of each class corresponds to the size of its set (20/50 for the first and 30/50 for the second one). I am quite confused about the way to implement the knowledge about set structure and... |
Hi how do I find the asymptotic bound for the recurrence T(n) = T(n/2) + T(n/4) + T(n/8) + n?
Can I use master theorem or Substitution method only?
If so, I need some help for substitution method. My attempt is as below:
Sub T(n/2) into T(n/2) + j(n) = T(n/(2^2) + j(n/2)
T(n) = T(n/(2^2) + j(n/2) + j(n)
Sub T(n/2^2) in... |
In a directed graph where the edges may have positive or negative weights, the Bellman-Ford algorithm detects cycles in which the sum of weights is strictly negative ($<0$). I need to detect cycles in which the sum of weights is weakly negative ($\leq 0$). Here is my current idea:
For each edge $e$, replace the weigh... |
Given a graph $G$ with $n$ vertices, let $(X, T)$ be a tree decomposition of $G$ with the smallest width. Is the number of nodes in $T$ upper bounded by $n$? I have googled it but all materials I found discuss only treewidth.
|
I'm studying programming language design, and I've been taught the grammar below which lets you write basic math expressions.
Exp ::= Num | Exp Op Exp
Op ::= + | - | * | Div
Num ::= Digit | Digit Num
Digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
According to the lecturer things like 1 - (2 -3) are not valid as it ... |
By Babai & Luks (1983), it was proved that graph isomorphism problem is tractable on bounded degree graphs. However, I could not find any result when the graph is edge directed.
Is isomorphism problem tractable (or GI-complete) on edge-directed graphs with bounded degree?
|
The depth-first search visit of a graph produces, in some implementations, a labeling of the edges as "Cross", "Back" and "Forward". I know "B" edges can be used to detect cycles.
What are other useful algorithms that use these labels?
|
I have a binary search tree where nodes are non-overlapping intervals. I'm given a point, and I need to determine which interval the point belongs to (if any). This is easy to do because I can compare against the low and high of each interval and descend either left, right, or exit.
Is it possible to only compare again... |
I read on a book that in general k-NN (no optimizations), given
$d$ dimensions
$n$ examples
every computation of distance is $O(d)$. Since every example has to be compared with all the other ones, the complexity is $O(dn^2)$
I am doing 1-Nearest-Neighbors with Dynamic Time Warping as distance "metric".
The complexity... |
Does there exist a flow graph that always requires flow to be pushed back no matter what ordering of augmenting paths is chosen in Ford Fulkerson?
Let's assume we use the standard procedure of repeating this step:
Find an augmenting path $p$ in residual graph $G_R$ of $G$.
Let $c$ be the minimum capacity edge in $p$.
... |
I'm always using debugging and writing test cases to solve coding challenges. It's been very helpful so far but now that problems became very complex, its not good enough.
Is there a way to use tools like:
state machine diagrams
logic tables
regular expressions
something else
in order to create from there the... |
Suppose we have a simple Bayesian network with two rows of nodes: $x_1, x_2, \ldots, x_n$ and $y_1, y_2, \ldots, y_n$. Each node $x_k$ takes a state of either 0 or 1 with equal probability. Each node $y_k$ takes state 1 with probability $p_{k,0}$ if $x_k$ is state 0 and probability $p_{k,1}$ if $x_k$ is state 1.
We ... |
Given an arbitrary language $L$ with an algorithm $A$ that places $L$ in $co-RP$ what other properties does the Algorithm $A$ need to have to so that $L$ is in $P$?
For example:
Considering $L$ is in $co-RP$ we have a guarantee that:
if $x \in L$ then $A$ accepts $x$ guaranteed $(P(A(x)=1) = 1)$
if $x \not\in L$ then $... |
As I understand, C++ in general features 'one-way' type checking. That is checking the sub-expressions and get their types, and see if the types so far satisfy the constraints imposed by the current expression node. It's an algorithm progressing from bottom to top.
However, C++ also features overloading and template. W... |
I stumbled on this paper about compressing images using a kind of odd, but interesting idea. It seems pretty easy to implement and I was wondering if there is something wrong with it that I haven't picked up.
The main idea is that every possible number combination can be represented by an index in an imaginary list of ... |
This is a fascinating bioinformatics dynamic programming that I am solving. I am not looking for an answer to the problem, but rather any algorithms, research papers, or other pointers that could be helpful.
SETUP
You are working in a lab as a microbiologist and would like to formulate an algorithm to interleave two D... |
I'm trying to understand the algorithm that can be used to calculate the area of the union of a set of axis aligned rectangles.
The solution that I'm following is here : http://tryalgo.org/en/geometry/2016/06/25/union-of-rectangles/
The part I don't understand is :
The segment tree is the right choice for this data s... |
You are given a certain set of items with weight wi and the volume of the bag.
Case:
Input:
3 (count of items) 10 (volume of the bag)
1 2 4 (weight for each item)
Output
8 (since you can put any item in or not 2 * 2 *2)
I have a naive solution using DFS as
public class Main {
public static void main(String..... |
I am reading the solution of this problem in CLRS:
Show that there are at most $\lceil {n/2^{h+1}} \rceil$ nodes of height $h$ in any $n$-element heap.
Solution: All the nodes of height $h$ partition the set of leaves into sets of size between $2^{h-1}$ and $2^h$, where all but one is size $2^h$. Just by putting all t... |
I'm trying to figure out how to do this problem in my intro algorithm class, but I'm a little confused.
The Traveling Salesman problem (TSP) is famous. Given a list of
cities and the distances in between them, the task is to find the
shortest possible tour that starts at a city, visits each city
exactly once ... |
A Gap Buffer is a variation on a dynamically-sized array, but with a gap inside it. The gap makes editing operations around the gap more efficient. Deletion before the gap can be implemented by simply making the gap larger for example.
UTF-8 is a variable width encoding for text. The first bits of the first byte of a c... |
I was reading this paper where the authors explain Theorem 1, which states "Reachable Object" (as defined in the paper) is NP-complete. However, they prove the reduction only in one direction, i.e. from 2P1N SAT to Reachable Object. This only proves that the problem is NP-hard; do we not need to prove the reverse direc... |
Give an example of a directed graph in which a depth-first search backs
up from a vertex $v$ before all the vertices that can be reached from
$v$ via one or more edges are discovered.
My professor recently asked this question as a warm up to lecture, but never answered it. I still have not figure how that is possi... |
How to choose from a set of positive numbers all the subsets that sum to some number x?
For example if the set $S=[1,1,2,3,4,5,6,7]$ and I'm searching for all the subsets that sum to $7$ I would have $[1,6],[1,6],[2,5],[1,1,5],[3,4],[1,2,4],[1,2,4],[7]$.
What I'm trying to do now is to generate all the possible tuples ... |
I'm basically trying to solve 4.2
(Taken from Semantics with Applications)
As I see it, the functional F will be defined like so:
(F g)s = s if s x == 0
(F g)s = gs[x -> x -1] if s x!=0
So, the first function is
g1 s = undefined for all s
I don't think this is a fixed point, because when s x = 0 , the function ... |
Is there any known algorithm to generate a random reducible flow graph (single root, single sink) with a given maximum cardinality $N$?
Ideally, the distribution should be uniform over the set of reducible flow graphs of cardinality $\leq N$.
Alternatively, it could be uniform over the possible topologies of reducible ... |
SGD (Stochastic Gradient Descent) is used in most libraries of different programming languages. Is it also used in machine learning libraries?
|
I want to make a simple application that input is an image and output must be 0 if image is dog and 1 if image is cat. Is it possible to detect cats from dogs in image with single layer perceptron?
|
I'm working on a Rubik's Cube solver that implements Korf's algorithm, as published in his 1997 paper, Finding Optimal Solutions to Rubik's Cube Using Pattern Databases. His method involves creating three pattern databases: one for the 8 corner cubies; one for 6 of the 12 edge cubies; one for the remaining 6 edges.
My... |
Let $n$ be a positive integer. Is it true that for all $1\leq i \leq n$ there exists a length $n$ binary string $w$ such that $K(w) = i$. Where $K(w)$ is the Kolmogorov complexity of $w$.
For each $i$ there are clearly $2^i$ programs of that length. But can we be sure at least one of them (when executed) generate a ... |
$\{ w∈(a,b)^\ast | w $ does not contain '$ab$' as a subword $\}$.
About questions like this, I always want to construct the regular expression for it, then convert the regular expression to a finite automata. Is there an easier way? Actually, I dont know the regular expression of it either.
|
Given a programming language A unknown to be Turing Complete, if one can create a compiler for a TC programming language B using A does this imply that A is itself Turing Complete? If so, what is the formal thinking behind the idea?
|
My best guess is that the series
$$ \sum_{i=1}^n i(n-(i-1)) $$
becomes
$$ 2 \Bigg[ n + 2(n-1) + ... + \frac{n}{2} \bigg(n-\bigg(\frac{n}{2}-1\bigg)\Bigg)\Bigg] $$
So the highest term is $n^2$ and there are $n$ terms. Does that mean its $O(n^3)$? That seems high. Intuitively, it seems like it should be closer to $O(n^2)... |
When introducing formal semantics for data structures, immutable stacks are a nice simple example :
$\mathit{is\_empty}(\mathit{create()})=\mathrm{True}$
$\mathit{is\_empty}(\mathit{push}(e, s))=\mathrm{False}$
$\mathit{top}(\mathit{push}(e, s)) = e$
$\mathit{pop}(\mathit{push}(e, s)) = s$
I am trying to do the same ... |
I've a flat structure where a node references its parent instead of children
class Node(int Id, Node Parent, string Data);
Given a list of all nodes, and a search condition, I want to return the matches plus all ancestors and descendants
This what I'm trying to implement https://hshn.github.io/angular-ui-tree-search/
... |
Let's say we have a 2D matrix, and we begin at $(0, 0)$.
We must travel $m$ steps to the right and $n$ steps up, in any order. Each step moves the position right or up by $1$.
For example if $n = 5$ and $m = 4$, the following would all be valid:
UP UP UP UP RIGHT RIGHT RIGHT RIGHT UP
RIGHT UP RIGHT UP RIGHT UP RIGHT ... |
i was wondering:
is this language in class P?
$NONDISJOINT_{DFA}\:=\:\left\{<A,B> |\:A\:and\:B\:are\:DFAS\:and\:L\left(A\right)\:\cap L\left(b\right)\:\ne \varnothing \right\}$
explanation: a word $<A,B>$ belongs to the language if A and B are descriptions of finite deterministic automatas that the languages they ident... |
I've read the following 2 articles explaining the difference between virtual memory and physical memory. One thing that I found confusing is that the term virtual memory seems to mean different things in these 2 articles.
What Is the Difference Between Virtual Memory & Physical Memory? says Virtual memory is used when ... |
For the maximum matching problem, we can find the fractional matching which I understand involves some sort of weighting for the edges. However, I cannot seem to find an exact and simple explanation of what a fractional matching is. How does it compare to an integral matching?
If this question seems too basic, could I... |
I need to construct a PDA using 2 stacks for accepting the language $L = \{a^nb^nc^nd^n | $ $n \geq 0\}$.
Pushing $a$'s to first stack and $b$'s to second and poping them for corresponding $c$'s and $d$'s respectively won't work because that would mean number of $a$'s $= $number of $c$'s and number of $b$'s$ =$ number... |
(This is taken from the book Semantics with Applications)
I'm trying to determine the fixed points for the following block:
while (x!=1) { y = y *x; x = x -1; }
As I understand, a fixed point g has to satisfy the following:
F g s = g s
where s is a state, F is a functional.
The functional F, in this context, wou... |
I know in theory how various scheduling algorithms work, such as round robin, where each process is given small time slices to run a few instructions, before the operating system passes execution onto the next process, and so on.
What I don't understand is how this is possible. The operating system is just some code, a... |
When people use the word "bidirectional" while describing buses, what are the two "directions" that are being talked about?
Also, why is the address bus unidirectional, as opposed to the data bus?
Edit: If all these buses are just connecting wires, what is the meaning of a 16 bit address bus? Does it mean that the wire... |
What would be the name of the problem of a vertex cover that covers all the vertices without the requirement of covering all the edges?
Vertex cover has to answer whether or not there is a set of $k$ vertices that covers all the edges of the graph, covering therefore, all the vertices. What is the name of the problem t... |
Given a positive-weighted complete graph $G=(V,E)$ and an even integer $k$, I want to find a minimum weight matching of size exactly $k$, i.e., I want to choose $k/2$ vertex disjoint edges such that the summation of their weight is minimum.
|
A vertex cover is a set of vertices such that each edge of the graph is incident to at least one vertex of the set.
A minimum vertex cover is a vertex cover with minimal cardinality.
From codeforces,
The minimum vertex cover should contain exactly one vertex for every edge in the maximum matching $M$. So let's assign... |
i am having a real time understand why the following two languages are in two different complexity classes(the first is NP-Hard and the second is in P). tried to look online at various resources and lecture notes/books, but couldn't find a reason for it. the languages are:
1.$NONEMPTY-INTER_{DFA}\:=\:\left\{<A_1,...,A... |
Given the code below and the comment analysis:
n = len(L) # O(1)
for i in range(n): # O(n) - I read online that range(n) will take constant time
but the 'for i in range(n)' part would make this O(n)?
if L[i] > 0 : # O(1)
for j in range(n): # O(n)
answer = answer + L[i] ... |
I am currently using an ILP to model events which occur on some input sequence from $1...n$. These events modify the input sequence in order to obtain a desired sequence. Each event can happen on some consecutive range $(i,j)$ and no two events can overlap. Therefore, I can represent events by some matrix $a=\{0, 1\}^{... |
What is the exhaustive list of reasoning tasks? As far as I can understand, then any logical reasoning reduces to 2 tasks only: 1) satisfiability problem (finding the assignment of the variables) and 2) theorem proving (deducing general statement from the other statements).
https://en.wikipedia.org/wiki/Logical_reason... |
Constrained Puzzle Generation:
Let us say a sudoku puzzle is generated with the following procedure:
Gather a sequence input of 9 unique numbers in the range $[1 .. 9]$. Call it $S$.
Map $S$ to a $3 \times 3$ grid $G$ as follows:
$$G_{i,j} = \begin{cases}
S_{j} & i = 0\\
S_{j + 3} & i = 1\\
S_{j + 6} & i = 2
\end{case... |
Given a binary equivalence relation, R on a set A, Let P be the resulting partition. I want to generate the partition means each subset in the partition. What would be the fastest algorithm for this purpose? please help.
|
I was learning about breadth first search and a question came in my mind that why BFS is called so. In the book Introduction to Algorithms by CLRS, I read the following reason for this:
Breadth-first search is so named because it expands the frontier
between discovered and undiscovered vertices uniformly across the
... |
I'm studying top-down parsing, especially LL(1) parsing. However, I cannot understand what is the meaning of rules.
Example grammer is like this
S → ( S ) S | $\epsilon$
How can I derive like below table?
I read all explanations of textbook, but I cannot totally understand the process of table construction. Are the... |
I have been trying to wrap my head around this problem, and I just can't get it.
We have an $a \times b$ matrix where every cell corresponds to either an empty space, denoted with a dot, or a wall, denoted with $X$.
There are two pawns in different locations within the maze, their movements are synchronized and they m... |
Can one create such function in Agda ?
ℕ→ℕ-undecidable : ¬ ( (f g : ℕ → ℕ ) → Dec (f ≡ g))
ℕ→ℕ-undecidable = ?
I am particularly interested in proof using cubical Agda.
|
We are given an array of integers of size n, which is not necessarily sorted, and we want to create a sub array. We are allowed to do one of 3 tasks below in each level:
1. skip the number in original array and go to the next
2. insert the number in the start of the sub array
3. insert the number in the end of the sub... |
I encountered below statement by Alan M. Turing here:
"The view that machines cannot give rise to surprises is due, I
believe, to a fallacy to which philosophers and mathematicians are
particularly subject. This is the assumption that as soon as a fact is
presented to a mind all consequences of that fact spring ... |
I've learnt that the memory interfacing problem is used when we need to connect a memory that has lesser number of locations to a processor that has more address lines.
For eg. Connecting memory chips with net memory of 8KB to a CPU that can handle 64KB.
Can someone please elucidate or explain what this is? Why can't I... |
Say I have an array of numbers, e.g. [0, 1, 2, 3, 4, 5] and I want to end up with an array, e.g. [2, 1, 4, 0, 5, 3]. At my disposal, I have a single method that I can use:
move(fromIndex, toIndex)
Thus, to achieve my desired array, I could call the method a number of times:
move(2, 0); // [2, 0, 1, 3, 4, 5]
move(1, 2)... |
If I have an address bus of 64K, i.e. it can access 64*1024 or 65536 locations, should I also have a memory chip with 65536 locations in it?
What I'm trying to ask is that do all the 65536 locations that the address bus can address have a corresponding memory location? Or can some address bus values go unused? (Like wh... |
I don't know this is a proper question on this forum but I was reading about computability theory and I saw the reduction concept and its notation like this: $A \le_pB$. I just wanted to know is this notation can be reversed? that is, can I write this down like $A\ge_p B$ And still have a meaning? I searched a lot but ... |
Suppose we have $n$ tasks to order over $n$ days.
Each tasks takes 1 day to be completed.
Each task has a start date when the task becomes available and a deadline when the task must be delivered.
Here is an example:
Is there an algorithm that can solve this problem with a worst case efficiency of $O(n)$ where $n$ is... |
I need to solve a linear equation Ax=b for 7000 times (A is sparse and complex square matrix), and at each time only 4 elements (A(i,k), A(i,m), A(j,k) and A(j,m)) are changed while all other elements are the same (at each time the indices i,j,k,m are different). I used block to obtain the updated inverse of matrix A. ... |
As an exercise, I'm trying to prove by myself that constructing a binary heap from an array in-place can be $O(N)$. I've come up with an idea, but I'm not sure about its correctness.
Firstly, I define the following procedure (pseudocode):
process_node():
if the node has children:
select the child node with... |
I have three related questions which have been bothering me for a while now...
Suppose I have a problem $A$, which is in NP. Suppose there is another
problem $B$ in NP, can I reduce $A$ to $B$?
If it is possible, can this reduction be done in polynomial time?
Is it even meaningful (having any importance, in terms of c... |
The recent Arxiv paper "Learning the undecidable from networked systems" attempts to construct a network of $N$ Turing machines$^1$ that can solve the Halting problem for any program of size $O(\log N)$. From this, they claim in the conclusion that
This result shows that there is at least one fixed algorithm that can... |
In the paper A Block-sorting Lossless Data Compression Algorithm by M. Burrows and D.J. Wheeler Link.
On page number 5. please describe this line
If the original string $S$ is of the form $Z^p$ for some substring $Z$ and some $p > 1$, then the sequence $T^i[I]$ for $i = 0,...., N - 1$ will also be of the form $Z'^p$ f... |
The problem I'm facing is how do I know whether the mapping is "1-way set associative", "2-way set associative", "4- way set associative", etc.
Please help!
|
We refer to the set of all integers as $\mathbb{Z}$. Now suppose we have a set of integers that can be held within a computer variable of $n$ bits width. Clearly they can only be of $2^{n}$ range, signed or not. How would we symbolise that? Is there something that is done to the zed, or does it remain simply $\mathbb... |
The formula, in the old way of using it, can contain symbols in order and a mixture that does not meet the criteria of correctness (i.e. arbitrary symbols do not form a well-formed formula (WFF) and do not conform to the grammar).
Also, a sentence written in a natural language could be in such a form that it cannot be ... |
How is the emptiness of Linear Bound Automata (LBA) i.e $L = \{B \mid L(B) = \emptyset \}$ is undecidable?
|
I know that the CPU has a program counter which takes instructions that are required to execute a program, from the memory, one by one. I also know that once the first instruction is executed, the program counter automatically increments by 1 and accesses the data in the cell with the corresponding address.
Now my ques... |
I have been searching online for some time but I have not found an answer.
Is there a polynomial time algorithm to find a path in directed graph between two vertices so that within the path no cyclic vertices can be found:
A path $v_1,\ldots , v_n$ (so $v_i\rightarrow v_{i+1}\in E$ for all $i$) has cyclic vertices when... |
I'm trying to learn computer science by doing some challenges. One is the following.
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
Let's generalize the problem... |
Is $\frac {n!} {2!\cdot 4!\cdot 8!\dots (n/2)!}=O(4^n)$?
I am really stuck and I tend to believe it's true, but I don't know how to prove it.
Any help would be appreciated!
|
I am pretty new to this, consider the following algorithm:
Calc_a(n):
if n ==1: return 1
else:
sum = 0
for i=1 to n-1:
sum = sum + calc_a(i)
return sum
So after running this algorithm a few times I see it basically finds the n'th element in a sequence defined by this recurrence relation:
$a... |
Having a set of adjacent rectangles, what would be the algorithm that gets the rectilinear polygon wrapping around them?
|
Suppose I have modeled a deterministic finite automaton of my system. How can I check if the traces generated by this system, actually represent the model I had in mind?
For example, say I have DFA A which models a vending machine. To ensure I did not model any wrong transitions, is coming up with (safety/liveness) s... |
My understanding is that I have to use the algorithm for Hamiltonian Circuit to help solve the Hamiltonian Path problem.
My understanding is that we have to perform a reduction from Hamiltonian Path---> Hamiltonian Circuit (since we have an alg for Hamiltonian Circuit the reduction should be from Ham path---> Ham circ... |
The Von Neumann architecture was first created in the mid 40s for use in a computing system known as ENIAC for research into the feasibility of thermonuclear weapons.
To this day the Von Neumann architeture is still primary foundation in the majority of modern computers. I have listened to a few historians and scienti... |
Do you know if this simple property of a DFA is stated as a property (or theorem) in some Automata theory book (possibly with a particular name)?
Property: Given a DFA $A = \{ Q, \Sigma, \delta, q_0, F \}$, if $w = uv$ and the state of $A$ on input $w$, after scanning $u$ is $q_i$ (when the head is at the beginning of ... |
We think that non-deterministic machines are more powerful than deterministic machines, by giving an oracle access to $P\subseteq L\subseteq NP$, it seems reasonable to expect there's some $L$ that is so weak compared to $SAT$ and thus gives "relatively more" power to $P$ than to $NP$.
Suppose we're given a monotonical... |
I've been trying (fruitlessly) to prove something which I now know is not provable. Take the following definitions:
$$LEM \equiv \prod_{A : Type} \neg A \vee A$$
$$DNE \equiv \prod_{A : Type} \neg \neg A \to A$$
$$C(x) \equiv DNE \to x$$
I wanted to prove $\prod_{A : Type} C(A) \to \neg \neg A$. In trying to prove it t... |
In Elements of Programming Interviews in Python by Aziz, Lee and Prakash, they state on page 41:
Insertion into a full array can be handled by resizing, i.e.,
allocating a new array with additional memory and copying over the
entries from the original array. This increases the worst-case time of
insertion, but i... |
I'm studying for my final and don't understand this question. Here is the full question (from Stallings 8th edition):
Consider a hypothetical microprocessor generating a 16-bit address
(e.g., assume the program counter and the address registers are 16
bits wide) and having a 16-bit data bus.
a. What is the maximu... |
At present, I'm designing a soft processor with single-precision floating point unit (FPU). I am going to put my soft core into an FPGA and do some performance evaluation. The benchmarks are supposed to contain many single-precision floating point calculations, such as fadd, fmul, fdiv and fsqrt. Therefore, I can know ... |
I am trying to solve a regular expression of binary string where every even position is a '1'
I've solved this for an odd position: (1(0+1))*(1+ε)
How would it look like for an even position then? Thanks in advance.
|
Say I want to quantitively evaluate the effectiveness of several color-to-grayscale conversion algorithms, which can be considered as lossy compression. Would entropy be a good indicator?
To calculate the entropy of a file, I first convert it to a byte stream with hexdump(1) or some other methods (see below). Next, thi... |
In this link it is mentioned:
A DFA is not powerful enough to recognize many context-free languages because a DFA can't count.
But counting is not enough -- consider a language of palindromes, containing strings of the form $ww^R$. Such a language requires more than an ability to count; it requires a stack.
I would... |
I would like to calculate the complexity of an algorithm using the "inequality strategy".
This algorithm takes two integers as an entry $n, m$. Moreover this algorithm is recursive and if we denote $C_{n,m}$ the number of operations this algorithm does for entry $n, m$ we have the following inequality :
$$C_{n,m} \le... |
Is it possible to have a data structure that supports both insertion and delete-min (or max) in $O(1)$?
You can assume the numbers that will be inserted are integers in the range [0,n] and that you will be inserting a maximum of n elements.
|
Consider verifiers in the usual sense:
Non adaptive : reads all positions of the proof predefined
Adaptive: Reads the proof iteratively.
Many lecture notes on PCP say the following:
Adaptive verifier with q queries is equivalent to non-adaptive with some q' queries where q' is a constant and both using same randomness... |
I am reading CLRS relating to perfect hashing. When computing the
$$
\mathbb{E}[\sum_{j=0}^{m-1}{n_j\choose{2}}]
$$
where $m$ is the number of slots in the hash table, and $n_j$ is the number of keys in position $j$. I don't understand why we can directly conclude that
$$
\mathbb{E}[\sum_{j=0}^{m-1}{n_j\choose{2}}]\leq... |
I am curious about utilization calculation in the bitmap protocol. especially if there's a difference between if only station 0 wants to broadcast(and the others doesn't) or only some other station want to broadcast(but the others doesn't)
an example of a problem regarding this: in a bit map protocol with 10 station(nu... |
Maybe this is quite simple, but I am having some trouble how to do this reduction. I want to reduce Subset Sum to Almost Subset Sum.
Subset Sum: given a set of positive integers $A=\{a_1,a_2, \dots,a_n\}$ and an integer $M$, decide if there is a subset of $A$ with a sum equal to $M$.
Almost Subset Sum:
Input: a set of ... |
If this link can be any help
https://codeforces.com/blog/entry/63164
A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set.
A minimum vertex cover is a vertex cover with minimal cardinality.
Consider a set of all minimum vertex covers of a given bi... |
Define a language $L$ as follows:
$$L = \{\langle M \rangle \in \{0, 1\}^* | M\text{ is a TM that halts on all strings of even length} \}$$
I can prove that $L$ is not decidable/recursive, but is it recognisable/recursively enumerable? My intuition is that $L$ is unrecognisable because suppose there exists a TM $N$ tha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.