instruction stringlengths 35 29.1k |
|---|
Can a CFG parse tree have a root other than starting non-terminal S? Except for the cases when tree has a height equal to zero and contains only one symbol from the main alphabet.
|
I want to find areas in a binary image that correspond to long and thin curves. In the example below, structures thinner than 3 pixels but longer than 20 pixels are highlighted. Observe that the bottom-most line is split because it locally comes in contact with the Data Matrix code. The structures need not be straight,... |
given this lanauge:
$L=\left\{\langle M\rangle\right.$ : there does not exist $\mathrm{w} \in \Sigma^*$ such that M rejects $\left.\mathrm{w}\right\}$.
how can I determine whether it is in $R, R E \backslash R, \operatorname{coRE} \backslash R$, or $\overline{R E \cup c o R E}$?
I tried to prove the it is in $coRE\back... |
I'm confused by the use of the expressions "computable problem" and "computable function" in the context of computability theory. Are they refer to the same thing or are there differences?
|
I am studying for my final exams in complexity theory and I came across a graph problem which I cannot fully prove that it is NP-complete. Its gist is the following:
Assume that you have a weighted directed graph, where the weight of each edge is the travel time between the two corresponding nodes. There are goods on ... |
Since functional completeness is a kind of universality, there might be deep connections to other universal phenomena like Turing completeness.
|
I have 4,500 ($N$) unique items, and I want to auction each one off to the highest bidder (break ties arbitrarily).
Each item has $T$ binary traits. Since it is too complex for the $B$ bidders to specify a bid for each individual item, instead the bidders express preferences in the form of "I am willing to pay $x$ for ... |
In pure aloha the if one frame is been transmitted and another is send during the transmission then the whole frames get destroyed.
Vulnerable time is the time period where there is the chance for collision.
But why is it set to 2*Tp where
Tp: Transmission time
I watch some you-tube it said It is 2*Tp because we have t... |
To prove that a problem is NP-complete, one has to show that it is both (a) in NP and that it is (b) NP-hard by reducing a known NP-complete problem to it in polynomial time.
Regarding the reduction, I understand that the instance of the known NP-complete problem must be arbitrary to avoid loss of generalisation.
Does ... |
I am trying to understand an algorithm for solving Closest String using bounded search trees, as found in Parameterized Algorithms (Cygan et al., 2015).
Assume we have a set of $k$ strings $x_1, ..., x_k$ all of length $L$ and an integer $d$. The problem is to determine if there exists a string $y$ such that $d_H(y, x_... |
I'm a young programmer that was interested by machine learning. I watched videos and read articles about the theory behind simple neural networks. However, I can't manage to set it up correctly. I've already managed a simple linear regression AI but I can't manage to make it deeper. I wanted to make An AI that could ac... |
I have a table like this (more specifically a nested dictionary)
img
a
b
c
d
e
img1
0
0
1
0
1
img2
3
1
0
0
2
img3
4
0
0
0
1
img4
2
2
0
0
0
img5
0
0
0
0
2
img6
2
2
0
0
0
img7
1
0
0
1
0
img8
0
1
1
0
1
img9
0
0
0
0
0
img10
0
1
0
0
0
.....
…
I need to add all the column names upto a thre... |
I do not know if this question makes sense
BUT
AX has two halves al and ah but the higher halves of EAX and RAX are not addressable.
When IMUL instruction is executed e.g. IMUL r/m16 the os uses ax and dx registers:
DX:AX = AXr/m16*
This made me question why is using two registers necessary for this instruction and
Why... |
this is a question I got from a test that we had before
Let there be X, a subgroup of languages above $\Sigma $ such that X isn't empty nor all of the langauges in $\Sigma $ we need to say if the language L = {< M >| L(M) $\in$ X} is decidable.
In the answer they said that there is an X, which is X = $P(\Sigma^*)/L^c_{... |
I am trying to learn about formal languages and I was wondering how I would go about defining the language that contains all strings which have matched parentheses and this is the definition I came up with —
$L = \{(x*)|x\in L\}\cup\{\epsilon\}$
Here, $($ and $)$ denote the literal characters '(' and ')' respectively. ... |
I'm looking for a directed graph data structure where each node is unique and contains a set of elements (at least one).
Each node must contain all elements from nodes pointing to it so it possible to walk from each root node and visit all supersets.
I actually only need insert and walk operation, but I struggle to co... |
I've been stuck with this problem for quite a while now, and after reading so many papers I'm unsure whether this is even possible.
The problem is quite simple:
Given $G = (V, E)$ an undirected graph, find the minimum number of vertices such that their removal from $G$ leaves us with a graph of maximum diameter $2$ (th... |
I've been working on Quantum Circuits for a 1.5 months. And firstly i've created Full Adder in Quantum Circuit. And first times i was creating Full Adder with too Qubits. But last week i created another circuit like that:
And code here:
def LessQubitAdder(X, Y):
xBin, yBin = DecimalToBinary(X), DecimalToBinary(Y)
... |
My goal is to find the local minimums of a smooth multivariate function $f_t(\vec y)$ for multiple values of $t$. I have created an algorithm $foo(t,\vec x)$ which returns the results of Newton's Method (by "results", I mean that $foo(t,\vec x)$ returns $\vec a$, where $\vec a$ is a local minimum for $f_t(\vec y)$) on ... |
Given this shell sort algorithm implementation:
void shell(float ∗a ,int l ,int r) {
int i, j, h;
for ( h = 1 ; 3∗h +1 <= r−l; h = 3∗h + 1 );
for (; h > 0; h / = 3) {
for (i = l+h; i <= r; ++ i) {
for (j = i; j >= l +h && a[j] < a[j−h]; j −= h) {
swap (a+j−h , a+ j );
}
}
}
}
I want... |
I am trying to find a textbook reference for an algorithm that gives you a relative estimate of a quantity $a$ (i.e. $|a-\overline{a}|\leq \epsilon_{rel} a$) from an algorithm that gives you an estimate with relative error $|a-\overline{a}| \leq \epsilon_{abs}$ for $a \in (0,1]$.
The algorithm that I can think of (whic... |
I have a medical dataset, which is something like this
| Disease | Symptoms |
| -------- | -------- |
| Disease 1 | ['Symptom1', 'Symptom2', 'Symptom3', ...] |
| Disease 2 | ['Symptom2', 'Symptom11', 'Symptom7', ...] |
| Disease 3 | ['Symptom55', 'Symptom91', 'Symptom65', ...] |
I want a generate a model t... |
I want to implement an AI capable of playing the game RoboRally (https://en.wikipedia.org/wiki/RoboRally) using Monte Carlo Tree Search (MCTS). In RoboRally, there are 2-8 characters controlled by (human) players, each of which must reach checkpoints. However, each turn, a character can only move by playing cards chose... |
Given a ternary string S of length N, do the following:
Find the first strictly decreasing pair of digits.
Randomly change one of the digits in the pair to another value.
The string is circular (i.e the digit after the last digit is the first digit)
The program terminates when there is no strictly decreasing pair.
Ex... |
We need to partition a graph into subgraphs of 3 vertices each, such that every subgraph has at least 2 edges.
The problem is similar to the partition into triangles problem (which is NP-complete) but not the same because each subgraphs may contain 2 or 3 edges (unlike the triangles problem, which requires 3 edges in e... |
How to go about analysing the I/O complexity when there are multiple levels of memory involved? Looking up I/O complexity analyses returns papers such as this one, which generally assume for simplicity that the memory is just two-level (disk and cache).
|
Given this Shell sorting algorithm implementation:
void shell(float ∗a ,int l ,int r) {
int i, j, h;
for ( h = 1 ; 3∗h <= r−l −1; h = 3∗h + 1 );
for (; h > 0; h / = 3) { // outer loop
for (i = l+h; i <= r; ++ i) {
for (j = i; j >= l +h && a[j] < a[j−h]; j −= h) {
swap (a+j−h , a+ j );
}
... |
I've been reading a paper "A Linear Time Algorithm for Maximum Matchings in Convex, Bipartite Graphs" by Steiner and Yeomans. In this paper at some point they solve an off-line minimum problem that is stated as follows:
You are given an empty set $S$ and a sequence of $n$ $\textrm{INSERT}(i)$ and $m$ $\textrm{EXTRACT-M... |
The paper Linear Temporal Logic and Linear Dynamic Logic on Finite Traces has the following examples on page 4:
Q1. (Update to Q1: solved. See the comment by DCTLib.) The first example says that the REf (reg-expr over fin words) $\varphi^* \equiv$ ☐$\phi$
I disagree: the LTLf formula ☐$\phi$ says that in every moment ... |
Let G be a grammar with non-terminal A, terminal a and these productions:
A -> A a
It is obvious that this grammar cannot be parsed. There is no way to "exit" the parsing process. However, I am not sure at what point I would determine the LL(1) property.
Let's first look at the FIRST set for A. By looking at our rule,... |
I read in Algorithms in C by Sedgewick that we can easily prove by induction that breadth-first search algorithm computes the shortest path from one vertex to another (unweighted graphs or weighted graphs with edges = 1). I have written the proof below. Is it correct?
Statement S: Given two vertices $u$ and $y$, BFS c... |
Given 2 recursive - decidable languages $L_1$ and $L_2$ is the problem $L_1 \subset L_2$ solvable - decidable?
Since both $L_1$ and $L_2$ are recursive - decidable there exist Turing Machines say $M_1$ and $M_2$ that decide them.
Say that the problem stated is decidable then there exists a Turing Machine $M_3$ that giv... |
I have found utility in state machines that do not have the complexity of recursion: no self or ancestral transitions.
Is there a name for this sub-category of FSMs? Are they commonly used or considered broadly useful?
|
First question on this forum.
When I'm using a proxy in a browser (not on the whole system) what happens to DNS requests? What I mean is, are DNS requests going through the proxy as well, or are they being handled separately, thus exposing your my IP? Does it depend on how a proxy server is configured, or does all prox... |
I have a graph whose edges can be very efficiently represented as a set of complete biparti graphs (that may share nodes). Is there a name for such a representation?
And secondly. I want to enumerate the maximal cliques in this graph. Intuitively the more compact representation of the graph should improve performance. ... |
When i tried to find the time complexity of this recurrence relation with the master theorem, I got log^2n, but I'm told that it's logn.
I used the masters theorem, for this case.. a=b^k (1=4^0) ... This means that this is a case 2 in the masters theorem. Then p in this case is 1 since log^1n. So the answer for case 2 ... |
I have difficulties in proving that for the given language:
$E V E N_{T M}=\{\langle M\rangle: M$ is a TM s.t. $|w|$ is even for all $w \in L(M)\}$.
prove that:
$E V E N_{T M} \in coRE$
I've tried to look at $(E V E N_{T M})^\complement$ and prove that :
$(E V E N_{T M})^\complement \in RE$
by building TM M', that wi... |
I've been spending time strengthening my ability to conduct inductive proofs and made one for the mergesort algorithm - specifically the merge part, as the entirety of the algorithm is comparatively trivial with an assumption that merge functions properly. I would like another pair of eyes on my proof to know if my arg... |
I have recently finished reading the section on Distributed Systems in OSTEP. For NFS, they briefly mention the cache consistency problem and say how it is solved for reads by maintaining an attribute cache (though there will be inconsistency if any reads occur between attribute updates) and that for writes it is "solv... |
I'd like to start by clarifying I'm by no means an expert in any of this, so take everything I say with a grain of salt.
Convex and Non-convex Optimization are subfields of mathematical optimization that focus on minimising convex and non-convex functions respectively. That is, finding the global minimum of functions w... |
I was thinking about this question and thought about it for quite a while but couldn't come up with an answer.
Firstly, we fix two sets $R$ and $S$. We consider "cycles", which are tuples in the form of $(a_1, a_2, \cdots, a_k)$, where $k$ is not necessarily $N$, such that
All elements belong to $R$. That is, $a_i \in... |
given the following languages:
$INFINITE_{T M}=\{\langle M\rangle: M$ is a TM with $|L(M)|=\infty\}$.
$R E G_{T M}=\{\langle M\rangle: M$ is a TM with $L(M) \in \mathrm{REG}\}$.
prove the following reduction:
$I N F I N I T E_{T M} \leq_m R E G_{T M}$
I'm having difficulties, building the $M_f$ machine
would love for... |
Given a language $L$ that is recursive prove that $Prefix(L) = \{ x \ | \ xv \in L\}$ is recursively enumerable.
My first attempt at this was to try and formulate an algorithm in pseudocode.
Prefix-Recogniser(x)
for v in Σ*:
w = xv
if L-Decider(w) -> YES:
return YES
Since $L$ is recursive a decider... |
Quicksort is O(n log n) average case, and O(n^2) worst case. The worst case occurs if one side of the pivot contains all of the elements and the other side contains none. However, I think the worst case would also occur if there is only one element on one side of the pivot each time and the rest on the other side. Is t... |
Suppose that we are given a graph $G = (V,E)$ and a number $n$. The problem is to find an independent set $I$ with $|I| = n$, such that number of vertices covered by $I$ is maximized (that is, the number of vertices adjacent to at least on vertex from $I$). My question: suppose that this problem's name is $\tt{BIVC}$; ... |
The Question
A regular expression, such as AL+[EYI]+, represents a set of strings.
alleys = {
“ALY”,
“ALLEY”,
“ALLY”,
“ALLEE”,
et cetra...
}
Let $\mathbb{AS}$ be the set of all strings $\sigma$ such that there exist natural numbers $x_{1}, x_{2}, x_{3}$ such that $x_{1} < x_{2}$ and...
$$
\for... |
Though purely functional programming languages, such as Haskell, is commonly thought to have no side-effects, there is a caveat: Recursive calls may hang.
I considered this to be undesirable, and thought about what if I force every recursive call to halt.
Formally, for every recursive call, the fixpoint combinator fix ... |
Red-black trees are defined to have the following invariants:
The nodes are in sorted order (it is a binary search tree).
The root is black, and leaves are black.
Every red node has black children.
Every path to the root passes through the same number of black nodes.
There is also an obvious "empty" operation (just a... |
I'm working my way through Leino's "Program Proofs" and I was following as far as the semantics of variable assignment, but I'm not quite sure why this is a valid Hoare triple:
{forall x::Q} var x; {exists x :: P}
where P is the weakest precondition and Q is the strongest postcondition. I'm not following why allocatin... |
The following excerpt is from page 39 of the 4th edition of 'Introduction to Algorithms' (emphasis added):
2.3.2 Analyzing divide-and-conquer algorithms
[...]
A recurrence for the running time of a divide-and-conquer algorithm falls out from the three steps of the basic method. As we did for insertion sort, let $T(n)$... |
I was reading the book "Types and Programming Languages" by Benjamin C. Pierce, paying attention to proofs so I could learn proof techniques.
In the parts discussing the simply typed $\lambda$-calculus, I came across a theorem called "Uniqueness of Types", and its proof details are not given, so I tried to write down d... |
I am motivated by the idea of generating “words” or “pairs” in a programming language or set of commands.
For example, consider any arbitrary REST API.
Beyond requesting the original URL endpoint, assume the structure of the API commands are keys and values (a dictionary of parameters).
Some of the parameters may be re... |
I know P is closed under all Boolean operations, but what about NP?
is NP closed under set difference and symmetric difference?
is this table accurate?
Edit:
updated table:
|
Typcial links are unidirectional, which has the drawback that the link
will point to invalid if its target is moved or deleted.
Bidirectional links would provide the possibility to update.
Moreover: If the target of a link is a location (folder etc.)
a bidirectional link would allow to show the "back-link" at the targe... |
The CS50 course by Edx that I am pursuing has this statement in their Week 4 practice set:
A 24-bit BMP file, then, is essentially just a sequence of bits, (almost) every 24 of which happen to represent some pixel’s color.
If I understand correctly,
101010101110101010101011 will represent a color.
How the length and br... |
I wrote the following table for all the closures in those classes.
is anything there incorrect?
also, would appreciate help with coNP and coRE closures. couldn't find much information about it online.
|
Minimum equivalent depth-d expression ($MEE_d$) is defined as:
Given a depth-d Boolean formula $F$ and an integer $k$, is there an equivalent depth-d formula of size at most $k$? For every $d\geq3$, the problem $MEE_d$ is $Σ^P_2$-complete under polynomial-time Turing reductions.
Now, the depth of the formula is by defi... |
This is a bit of a different question than those usually posted here; I hope it is on-topic enough, as it is specifically concerning computer science. It's been bothering me for a while, and my efforts to find discourse on this elsewhere have failed:
What are some good introductory experiments or research projects that... |
Given a set of k array :
K = [k1 ,k2 ,k3 ,... ,kn]
we want to build a tree such that its root node is k_m ,where m is the highest value in the list and its connected to every other node and again every node is connected to every other node : Ex-
This is a example of such tree made out of array of 4 arrays:
Another exa... |
The game being played here has the following rules, played be a singular player: there is a 5x5 board, where some tiles are highlighted and some are not. From here, the player can highlight the blank tiles, but they can't reverted a highlighted tile to blank. when a tile is highlighted, the player gets a score for that... |
Let $Q$ be a query in the fragment of SQL built up from basic $SELECT$ clauses using
subqueries with $EXISTS$ and $NOT EXISTS$. Then for each such fixed query $Q$ I'm trying to show that there is a polynomial-time algorithm that takes as input a finite database $D$ and determines the set of outputs of $Q$ on $D$.
I'm n... |
I am working on a solution that can say if an initial composition is going to live forever or eventually die without calculating each generation until it reaches a stable or an ever-repeating cycle in a finite-grid. (I know Game of Life is supposed to work in an infinite grid but we all gotta start somewhere)
I am seei... |
I have briefly looked through the links at the bottom of this page:
Interaction Nets
Interaction Combinators
Implementation of a low-level language for interaction nets, Shinya Sato
Inpla, Interaction Nets as Programming Language
Towards a Programming Language for Interaction Nets, Ian Mackie
An Implementation Model f... |
In the context of surveillance, I am working on a project where the goal is to find an algorithm that determines a path along a polygonal area, connecting a root node to a target node, while maximizing the surveillance area covered within the polygon. The given inputs for my algorithm include a root node, a target node... |
I have been recently thinking about activation functions and the explainability.
For sigmoid and tanh activation functions, I am thinking of them to be similar to logistic regression as the output of the activation function is very close to binary. So, to me the neural network is making simultaneous decisions and that ... |
I want to transmit values over an error prone channel. When transmitting analog values, the precision degrades smoothly when the transmission becomes worse. But when transmitting binary integers, an error in the first bit has catastrophic consequences.
Now say I want to transmit an 8 bit integer, I could transmit 256 b... |
I want to know how can I reduce Subset Sum or Partition problem to N3DM problem in which each set has exactly 3 elements and same sum.
N3DM Problem: https://en.wikipedia.org/wiki/Numerical_3-dimensional_matching
|
Is it possible to show, by reduction(Reduction in the length of the path and the running time), that for a Turing machine M and an input X, there exists a run in which M accepts X if and only if there is a path from the initial configuration in M's run on X to some accepting configuration
|
Consider the following schedule -
T1 T2
R(A)
W(A)
R(A)
W(A)
Commit
Commit
I understand that this schedule is non-recoverable, because if a failure occurs between the two commits, then we can't rollback the operations performed by T2, as they would already have been committed.
But, if we chang... |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2.
Is it possible to show that the First-Fit-Decreasing algorithm computes an asymp... |
Lets assume P = NP, so all problems in NP are decidable in polynomial time,
Therefore I can solve all problems in NP in polynomial claiming P = NP = NPC.
But then, how come Σ* belongs to P = NPC because I can't reduce the even length string language (as an example of a language that is not trivial) to Σ*?
one of the st... |
I wrote this c++ code for a operator precedence parser.
it works perfectly for expressions without parentheis.
Eg: i*i+i is accepted
#include <iostream>
#include <string>
#include <unordered_map>
#include <stack>
#include <vector>
#include <fstream>
std::unordered_map<std::string, std::vector<std::string>> grammar = {... |
What would Helman-JaJa listrank pseudocode be like? I tried looking around but all I found were "prosecode" descriptions (eg pp. 18-19 here) which I find kinda hard to follow.
|
When proving the non-computability of the Busy Beaver function by contradiction, people create machines that are able to calculate the Busy Beaver function, BB(n), and also write more than 1s than BB(k), where k is the number of states of such machines.
Proof link
I would like to know why this is proof that BB(n) is no... |
Let $G$ be any CFG Grammar. There exists number $K$ dependent to $G$ so that for each $w\in L(G)$ with length bigger or equal than $K$, we can be write $w=uvxyz$ such that $uv^nxy^nz \in L(G)\; \forall\,n\geq 0$ and $|vy|\geq 1$.
My question is that this statement does not include the case of $|vxy|\leq K$. Should it b... |
I have briefly read through much of the Interaction Combinators paper, and am looking at this blog post for some help, but they both just say basically "each node in the graph must have one active port, and zero or more secondary ports", without explaining what ports are or what ports do, from a software and programmin... |
I remember seeing a list of False Proofs when I was taking Discrete Maths and I found it to be very interesting and also helpful.
So, if anyone knows some common proof mistakes students make or some cool sneaky way to trick people in a proof send them my way! Bonus points if they're cs/algorithms related.
Thank you so ... |
I have an exercise on paging and page tables that I can't get my head around.
So the data is: my virtual addresses are 32 bits long, 1 page is 1 KiB, 1 PTE is 32 bits big and 1 page table is 1 page.
And then the prof asks how many page table levels are needed for this addressing.
so my solution would be:
I can calcula... |
I have been doing web/app development for a few years, primarily involving high-level programming and stuff. However, I am interested in jumping into some low-level stuff and genuinely understanding how computers work.
There are a lot of resources online that I found myself being overwhelmed by all the choices. General... |
Consider the $k$-center problem where we are given an undirected, complete graph $G=(V, E)$, with a distance $d(u, v) \geq 0$ for each pair $u, v \in V$. Furthermore, we assume that the triangle inequality holds: for each triple $u, v, w \in V$ it is the case that $d(u, w) \leq d(u, v)+d(v+w)$. The goal is to find $k$ ... |
Given a collection of sets $C=\{S_1, S_2, \ldots, S_n\}$ with each $S\in C$ holding some integers, I would like to find a pair $\{x,y\}, x\ne y$ such that $\{x,y\}\subset S$ for the highest number of $S\in C$ among all such pairs.
Is there an efficient algorithm to find such a pair?
|
We have a binary raster image in which we consider the white blobs (connected components). We define a distance between two blobs to be the length of the shortest path between any two respective pixels (topological distance), or alternatively the shortest Euclidean distance between two pixels. In general the two defini... |
Reading the manual for GNU grep, the special characters (with -E option) are .?*+{|()[\^$.
This is a somewhat pedantic question, but why are ] and } omitted? In particular it says in section 3.1 "An unmatched ) just matches itself", which is true for ] and } as well.
I think it is just a slightly sleeker description of... |
How to provide a reduction from 3SAT to domatic number problem.
Domatic number problem: Given a graph $G = (V, E)$ and an integer $k$, can we partition $V $ into at least k disjoint sets of vertices, such that each set is a dominating set of $G$?
I have made many attempts, but still have no clue.
|
From my understanding, something like Linux is very geared towards C programs, with things like libc. What I'm wondering is, even in Java, you have arguments to your "main" program. The same thing occurs in C. From my understanding, this is just some data the kernel puts on an anonymous page for the stack of the proces... |
The fourth edition of 'Introduction to Algorithms' defines algorithmic recurrences on page 77 as follows:
**Algorithmic recurrences
[...] A recurrence is algorithmic, if for every sufficiently large threshold constant $n_0 > 0$, the following two properties hold:
For all $n < n_0$, we have $T(n) = \Theta(1)$
For all ... |
I am trying to solve problem in leetcode:
https://leetcode.com/problems/redundant-connection/description/
*finding redundant connection in undirected graph
And now I am writing a solution, inpired by Kruskal's algorithm:
https://en.wikipedia.org/wiki/Disjoint-set_data_structure#/media/File:UnionFindKruskalDemo.gif
In s... |
Disclaimer: I'm studying for an exam, but I don't have to hand in anything.
I have the state transition diagram of the FSM and its states encoding:
I want to find the sum-of-products (SOP) Boolean expression of $S_0^1$, $S_1^1$ and output $y$. I've drawn tables for each next state, based on all current states ($S_0... |
or wich phenomena have behavior that can be measured and described as a function between natural numbers but seem to be hard to simulate with digital hardware when the starting conditions are given.
|
I have read the definition of treewidth/tree-decomposition both in Wikipedia and in here:
https://medium.com/@karlrombauts/treewidth-how-all-graphs-are-trees-in-disguise-ec699b69e2fb
I'm finding something hard to understand why the treewidth of a tree is $1$. By the definition of tree-decomposition, I may select to hav... |
I came across the following question:
Given two context-free languages $L_1$ and $L_2$ is it decidable whether $L_1 - L_2 = \emptyset$ ?
The problem $ALL_{\text{CFG}}$ that states:
Given a CFG $G$ then $L(G) = Σ^*$ is known to be undecidable.
So I thought to fix $L_2$ to be $Σ^*$ and allow $L_1$ to be any context-fre... |
Let the vertices of the graph G be the numbers 1, 2, ..., 100, and two (different) vertices be adjacent if and only if at least one of 2, 3, or 5 is a common divisor of the respective numbers. Determine χ(G), the chromatic number of the graph G.
I tried to solve and got that all even numbers i.e 2,4,6,...,100 form a cl... |
In Algorithm Design and Applications by Michael T. Goodrich and Roberto Tamassia Chapter 12.3 there is a presentation of a problem called the Telescope Scheduling problem.
Given n requests each with benefit, start time and end time, find the best combination of non conflicting requests that maximises the total benefit.... |
As far as I know for Non-Deterministic Turing Machine (NTM) there are 4 kind of branches:
An input is accepted if there is at least one node in the tree that is an accept.
An input is rejected if all branches are rejected, which means that it is a finite tree.
An input is not-accepted if there are loop nodes with reje... |
Pages 90-91 of 'Introduction to Algorithms' (4th ed.) show how the substitution method can be used for determining the upper bound on the recurrence:
$$T(n) = 2T(\lfloor n/2 \rfloor) + \Theta(n) \tag{4.11}$$
We guess that $T(n) = O(n \lg n)$ and try to prove $T(n) \leq cn \lg n$ by induction.
I can follow the proof for... |
$L^\complement$ = the complement of L
is it true that if
$L\in NPComplete $
and
$L\leq_p L^\complement \rightarrow P=NP$
basically asking if the following statements are correct
$if (L\in NPComplete ) and (L^\complement \in NP)\rightarrow L\in P\rightarrow P=NP $
|
I'm working on an exercise (not relevant for evaluation) that involves constructing an equivalent nondeterministic stack machine from a given machine with epsilon-transitions. However, I'm having trouble understanding Definition 2, specifically the line
Could someone please explain this line and guide me via hints thr... |
I have $n$ items $a_1, a_2, a_3 \cdots a_n$ and I want to find the least number of groups, but there is a list of constraints that $a_i$ can't be in the same group as $a_j$. Is this problem NP-Hard or is there a solution which does not Require Brute-Forcing the problem.
For Example I have $n=5$ items: $a_1, a_2, a_3, a... |
#Positive-2SAT is the problem of counting the number of satisfying assignments to a given Positive 2-CNF formula i.e 2-CNF formulas in which each literal is a positive occurrence of a variable.
The following variant of #Positive 2-SAT is defined as follows :
For example ,We are given a set of variables :
(a,b,c,d,e)
Th... |
I know that there is no way to prove that P = NP, but how would one go about proving constant time /= P (i.e. O(1) /= POLY(n))?
(Or perhaps that any two other complexity classes do not equal each other).
If anyone has any papers on this, that would be really helpful :).
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.