instruction stringlengths 35 11.4k |
|---|
In a population of $n$ people, each person knows $k$ other people and each person is known by the same $k$ people. However, no two people, p1 and p2, know the same two people p3 and p4. What is the minimum $n$ such that this is possible for a given $k$? Or, in other words, what's the minimum number of nodes that mus... |
Given $G=(V,E)$ undirected, connected graph and weights given by $w:E \to \mathbb R$. We also know that $|E|=|V|+87$.
Find Minimum spanning tree of $G$.
Obviously we can use Prim in $O(|V| \cdot \log |V|)$.
But can we do better by using the fact that the graph is connected, and use the sets sizes? Like removing the li... |
I have $P$ different processes given along with their respective Burst time and arrival time. The time quantum is $1$ sec i.e. each process can only run for $1$ sec. There's a total time $F$ given for which computer will be available to perform these processes. Also for each process $P_i$ there exists a respective cost... |
This was the initial CFG (starting symbol is I):
I → aAB
A → BAb | ε | B
B → a | b | CD
C → ba
D → DD
And this its CNF:
X → a
X'→ b
I → XY
Y → AB | a | b | X'X
Y'→ BA | a | b | X'X
A → Y'X' | a | b | X'X
B → a | b | X'X
Is it correct?
|
How 2D Cellular Automata rules sequences works?
For example, in elementary cellular automata, when we look at the binary sequence of the rule number, we understand that first bit says if all neighbors are white, and the cell itself is white, the cell in next step is black or white ( depend on the value of the bit ).
Bu... |
I was told that the fastest possible algorithm for integer multiplication is $O\left(n{\log}(n)\right)$. Why would this so?
Can you please show why the fastest multiplication algorithm would have such a time complexity?
|
Forgive me if I'm asking something that should be obvious, my experience is with software development, not computer science. I've glanced at some articles on hyperthreading and parallel processing, but it seems like those implementations are primarily for consumer devices to persist multiple apps at the same time (lis... |
I was studying Set Cover via the Primal–Dual Schema on my own that I faced a problem in the following paragraph:
Consider an LP-relaxation for an NP-hard problem. In general, the relaxation
will not have an optimal solution that is integral(why?? when we relax an LP we can choose the variables from the interval of [0,1... |
In CLRS, one question defines $\Omega^\infty(g(n))$ such that:
$$f(n) = \Omega^\infty (g(n)) \iff \exists c \in \mathbb{R}^+ : \text{for infinitely many integers } n, 0 \leq cg(n) \leq f(n) \ .$$
My question:
What does it mean by "infinitely many integers"? Does it mean $\{n : n \in \mathbb{Z}\}$ or does it just mean s... |
Given a sorted array of integers $x$ and a target value $t$, determine if there exists a pair $x_i, x_j \in x \wedge i \neq j$ such that $x_i + x_j = t$.
What is the lower bound for this problem?
I know for the generalized $k$-sum (unsorted) there is a lower bound of $\Omega(n^{\lceil \frac{k}{2}\rceil} )$. This wou... |
Given two minimal deterministic finite automatons called A and B where A accepts the finite language L(A) and B accepts the finite language L(B) and the alphabet of both languages and automatons are Σ={0,1}.
This implies that |Σ|=2.
Because that both A and B are minimal, there is no possibility to remove any state and ... |
Say I push the values 1,2,3,4 onto a stack. Then popping them, they will come back in the order 4,3,2,1. If I push the values 1,2,3,4 onto a queue then removing from a queue results in 1,2,3,4. However if I push them onto the queue in reverse order, 4,3,2,1, and then pop them from the queue they come out in the same or... |
I have an objective function profit = income - expense . I want to solve it using genetic/evolutionary algorithm (strength pareto SPEA2). Since the algorithm is multi-objective so can I consider the income maximization as one objective and expense minimization as second objective?. I am using SPEA2 matlab code from YAR... |
I have to read Logic in Computer Science: Modelling and Reasoning about Systems by M. Huth and M. Ryan for a class next semester. However Amazon reviews say it's hard to read unless you're an advanced student and I'm very new to computer science. Is there any other book I may read before I approach this one that would ... |
I am aware of the complexity classes $P$, $NP$ and $L$. But I am not clear what $NL$ or Non-deterministic Log Space intuitively means. The part what I am unclear about is what is the meaning of Non-deterministic Space?
A Turing machine in a $L$ case would read an input, read/write on the work tape that is logarithmic i... |
i want to prove that the following Language isn't CF
$L=\{a^kba^kba^k|k\in \mathbb{N}\}$
Let $z=a^nba^nba^n$ be a String from $L$
$n$ is the pumping length and
$|z|=3n+2 > n$
and $z=uvwxy$ with $|vx|\geqslant 1$, $|vwx|\leqslant n$
but i'm not sure how to determine the correct substrings, how should i consider them ? ... |
Given an array of length n filled with objects which contain 2 ints (size and reward).
Now 2 players are taking turns, each player has an int value we call strength. Let's call them player A and player B, player A goes first.
Player A can pick whichever object from the array he wants and decrease the size of the obje... |
I have been reading about caching and buffering it seems about the same to me can't get hold of the differences clearly and paging, for now the only difference I understand between paging and caching is that, pages store locations of data that are frequently accessed and so CPU can use the address to locate the data, w... |
Theory
Basically, I have a use-case where I would like to use primitives to store weak references to non-primitive values. If the value is no longer referenced anywhere else, then the entry should be GC'd from the WeakMap and checking the primitive key for an existing value would return false.
Is this possible to imple... |
Let $S \subseteq \mathbb{R}^2$ be a finite set of points. Do there exists three collinear points $p, q, r \in S$?
I wan't to know the complexity of this decision problem and present my approach as following.
SOLUTIONS. Let $n = |S|$. A naive brute-force takes time $\mathcal{O}(n^3)$. We can simply go through all triple... |
We have a $N_1 \times N_2$ grid.
We have a collection of rectangles on this grid, each rectangle can be represented as a $N_1$-by-$N_2$ binary matrix $R$. We want to cover the grid with those rectangles.
Is the decision version of this set cover problem NP-complete ?
Input : Collection $\mathcal{C}=\{R_1,R_2,\dots,R_L... |
I am currently writing a paper about lock-holder preemption with multiprocessors in virtualized enviornment. But I have two questions: one about overcommitment of CPU resources and about scheduling the vCPUs:
I know that an overcommitment of CPU happens, if the total amount of all virtual machines vCPUs $n$ is greater... |
I want to implement algorithm for computing vertex-edge visibility graph among polygonal obstacles, but I can't find any description or scientific paper describing such algorithm. Currently I understand how to extend Lee's algorithm for vertex-vertex visibility graph to compute vertex-edge graph, but I want to achieve ... |
I have around 1,000,000 of strings of variable length (from 200 to 50000) that can contain 5 characters (A, B, C, D, E).
What I actually want is to cluster them together if they are similar enough. By similar enough I mean they have an edit distance < $t$. This $t$ should be dependent on the length of the strings being... |
I an trying to learn about $DisNP$ Complexity class. I couldn't find this class in any book. But, regarding it, I found this definition in a paper:
Definition: A disjoint NP-pair (NP-pair for short) is a pair of nonempty sets $A$ and $B$ such that $A, B \in NP$ and $A \cap B = Empty$. $DisNP$ denote the class of all di... |
Suppose we have a propositional boolean formula F and let M be the set of all models of that formula.
I am wondering if there is an efficient way to find all atomic propositions that are implied by the formula. Informally, this means that they can only have one specific value in all models M.
Does this problem have a s... |
I am looking for a datastructure to represent the complex relationships between a bunch of abstract sets. The "abstract" means that these sets are not defined by their elements, but by their relationship to each other. This means that for me a set is nothing more than a named thing with a relations to other named thing... |
So, I was reading this pdf on complexity theory. On page 18 pf pdf (Page 12 of book) The Immerman-Szelepcsenyi Theorem is mentioned with proof. The following lines are from the book :
The idea is to cycle through all possible configurations $\sigma$ of $M$, for each one checking whether it is a final configuration tha... |
I would like to know if there exists an NP-hard language which is also a member of co-RE\R?
I think it depends if P=NP or not, but i'm not sure.
Can I simply assume NP-hard is in R?
Can you direct me how to think about it?
|
Given the recurrence $T(n) = T(\sqrt{n}) + \theta(lglgn)$, provide an asymptotically tight bound on it's run time.
My solution was to let $m = 2\sqrt{n}$, which leads to the recurrence $S(m) = S(m/2) + \theta(lg(2lg(m) + lg4)) = S(m/2) + \theta(lglgm)$.
By case 3 of the master rule, this means that $S(m) \in \theta(lg... |
I am trying to solve an optimization problem with strength pareto algorithm (SPEA2). My decision variable have lower and upper bounds as well as an equality constraint (sum(dp) = 1). I am unable to handle equality constraints. Please advise.
|
Given regular grammars (each is either left or right linear), does exist word/string so it can be derived from all regular grammars, i.e. a word/string that can be derived from each regular grammar.
Suppose that S1, ... , Sn are regular grammars. Then is the following statement is true:
∃w: S1→w ∧ ... ∧ Sn→w ?
In other... |
I was trying to understand the dsw algorithm for balancing a binary search tree in-place using this virgina tech page.
The wikipedia page and vt page are more or less similar. I am having a hard time trying to understand the underlying logic and also the functioning of the vine-to-tree method.
Correct me if am wrong.I ... |
Can I build a polynomial time verifier for problem, given a non-deterministic polynomial time decider for that problem?
I assume I should modify the decider such that it will verify the certificate.
Can I use the given decider as is (without any modification)?
|
my teacher asked the class to do a digial circuit that encrypted a message using cesar's cipher, and a circuit to decrypt, but my only idea is to solve it using a circuit that does P + K mod N, where P is The position of the letter in the alphabet, K the value of the key, and N is the number of letters in the alphabet.... |
I've started to read about process calculi (such as CSP and π-calculus). It seems to me that they are extremely general and can represent pretty much any concurrent system, many of which will be unable to "make progress".
I wondered if there were much more restrictive formalisms for describing concurrent processes? Per... |
Is the Kolmogorov complexity of any piece of information with respect to a certain predefined encoding for all pieces of information, or can the encoding vary for each piece of information?
There are different encoding mechanisms for representing data, and different ways of compressing the encoded data. If Kol... |
Let $S_1,\dots,S_n$ be variables representing unknown sets. A set expression has the form $S_i$, $\overline{E}$ (the complement of $E$), or $E \cap E'$, where $E,E'$ are set expressions. A constraint has the form $E = \emptyset$ or $E \ne \emptyset$, where $E$ is a set expression. Given a conjunction of constraints,... |
CLRS book has the following algorithm for parallel for matrix vector multiplication
My problem is, can't we use a simple approach like this,
MAT-VEC-MULTIPLY-MAIN(A,x,y,n)
for i = 2 to n
spawn MULTIPLY-ROW(A,x,y,n,i)
MULTIPLY-ROW(A,x,y,n,1)
sync
MULTIPLY-ROW(A,x,y,,n,row)
for j = 1 t... |
I know this question is posted many times, but i am still posting this because i have my own doubt which pulls me out to move forward to kruskal and prim's algorithm.So Please do help me out $-:$
Question
Let $G=\left(V,E\right)$ be a be a connected, undirected graph with a real valued weight function $w$ defined on $... |
$f: \Sigma^* \to \Sigma^*$ is a polynomial time computable function if some poly-time Turing Machine M, on every input w, halts with just $f(w)$ on its tape.
Language $A$ is polynomial time reducible to language $B$, written $A \le_p B $, if there is some polytime computable function $f: \Sigma^* \to \Sigma^*$ such tha... |
Let there be an infinite series of pieces of data we want to predict. Take the set of all algorithms ("hypotheses") ML has discovered; different hyper-parameters count as another algorithm. Give each algorithm a score ("relative prior probability") of 2^(-number of bits to specify algorithm, still including hyper-param... |
Given algebraic expression of two variables x and y, I want to simplify this algebraic expression until it cannot be simplified anymore. What algorithm can I use for this?
For instance:
x+x+y+y = 2•x+2•y = 2•(x+y)
x•x+y•y=x2+y2
(x+y)•(x+y)=(x+y)2
x•x+x•y+x•y+y•y=x2+2•x•y+y2=(x+y)2
The most simplified algebraic express... |
I want to construct a 2-tape Turing Machine, which decides in linear time if the input string over $\Sigma^* := \{(, [, ], )\}$ is a valid bracket.
I have not constructed too many TM's yet, this is why I need your help.
|
I've been reading up recently on radial basis functions, and I've recently moved from Gaussian basis functions of the form $\phi(x)=\exp(-\alpha||x-x_i||)$ to multiquadratic basis functions. My source is this paper, which is referenced in an algorithm that I'm looking at.
The basis function for the multiquadratic RBF i... |
Let $\Sigma := \{0,1,$#$\}$ be the input-alphabet and $L := \{bin(n)$#$w \in \Sigma^* | n \in \mathbb N \land w \in \{0,1\}^* \land |w| \le n\}$ the alphabet. $|w|$ means the length of the word $w$ and $bin(n)$ the binary representation of $n$.
I need to construct a 2-tape TM which has $O(n)$ complexity and accepts the... |
The conjecture itself:
k-SAT formula is satisfiable if no pair of unit assignment $l$ and $\overline l$ imply the formula to contain unsatisfiable (k-1)-SAT.
Example (XOR-SAT has no edges and cycles in implication graph, so it's simple example):
$$(\overline x\oplus y\oplus z)\land(x\oplus y\oplus v)\land(x\oplus y\opl... |
I'm looking for a data structure that will push its oldest/last element out if a new element is inserted. For example, let D represent the structure. D contains 3 elements of the type Number D's default values will be initialized to 1, 2 and 3.
$$D = [1, 2, 3]$$
If a Number that contains the value 5 is inserted into D,... |
This is a follow up to a previous Question (Clarification of definition of class $DisNP$)
The class $DisNP$ has a fundamental problem called the (P-separable) Separator Problem. Essentially the question is as follows:
Given any DisNP-pair $(A, B)$. The separator is a Set $S$ such that $A \subseteq S$ and $B \subseteq C... |
I am currently trying to design a graph-based approach for content tagging. In principle I am trying to two two things:
Use an algorithm such as Latent Dirichlet Allocation (LDA) or some variant of it to discover terms in documents that relate to a certain topic, thereby allowing me to tag a document as relating to th... |
For each admissible numbering, pick at least one pair of programs (but not necessarily all, which is impossible anyway) where the first translates from a given admissible numbering to that one, and the second work in the opposite way.
Now define a language consisting of all the pairs of programs chosen by one such way,... |
I want to develop an algorithm to serve the queue of children queueing to a basket full of balls of different colour, where each ball can be painted within a known time any colour (of several colours offered) requested by the child, and any child would eventually return a ball back to the basket after he/she finished p... |
Is it possible to prove using induction? If possible what would be the steps to proof A=B?
Main thing i want to proof is outcome of two segments of code are same.
Below is the code:
Segment A:
int A (int x, int y) {
if (y==0) return x;
return A(y, x % y);
}
Segment B:
int B (int x, int y) {
while (y!=0) {
... |
Let a graph $G=(V,E)$ have an independent set $I\subseteq V$ with $\{u,v\}\notin E$ for all $u,v \in I$ and $k \in \mathbb{Z}_{>0}$ where $|I|=k$.
How can I define the language $L_{P_{Independent Set}}$ to this decision problem?
I know that $I$ could be written as $I = \{u,v\} \in V | \{(u,v)\}\notin E \}$ but don't re... |
I am trying to find a way to refute the pigeonhole formula using resolution.
Lets assume that $x_{ij}$ is true if $i^{th}$ pigeon is in $j^{th}$ hole.
Thus, with $n$ holes and $n+1$ pigeons, the first condition "every pigeon must be in a hole" can be represented as
$$
\alpha_n = \bigwedge_{1\leq i \leq n+1} (x_{i1} \... |
Can quantum computer compute the minimal intersection DFA of numerous minimal DFAs in polynomial time using polynomial number of qubits, where the language of each given minimal DFA is finite and it's alphabet is Σ={0,1} and all words/strings in all languages are in the same length equal to the given number of minimal ... |
I'm studying a routing problem on a cyclic butterfly network. The paper I am reading states that two properties of the cyclic butterfly network make it efficient for the routing algorithm it describes. I'm new to this subject, and I'm struggling to understand the first property, which is:
"(1) It embeds a Benes network... |
I have a polynomial $P(x)$, and given some constant $d$, I need to find the polynomial $P(x+d)$. For example, if $P(x)=x^2$ and $d=1$, then the result would be $P(x+1)=(x+1)^2=x^2+2x+1$ (with the coefficients stored in an array/vector).
I know the algorithm with $O(n^2)$ time complexity, which is based on Horner's meth... |
AIXI is a theoretical formulation for artificial general intelligence. While AIXI is computationally intractable, there are approximations of AIXI like https://arxiv.org/abs/0909.0801 that are computable.
Some time ago, I stumbled upon theoretical artificial general intelligence, and I would like to know what are the p... |
Can someone explain me the way harddisks work? :/
The size of a block is specified in the filesystem, am I right? As you can see in the picture from wikipedia, the disk is divided into circle sectors. But the blocks on the outer tracks are obviously larger (physically)...
So the "bit-density" on the outer blocks is wa... |
We're given two arrays $A$ and $B$ with size $N$ and $M$ respectively. We want to find a set $P = \{(a_1, b_1), \dots, (a_s,b_s)\}$ such that
for each $i\in\{1, \dots, s\}$, $a_i\in A$, $b_i\in B$ and $a_i>b_i$ and $a_i,b_i$ musn't be chosen before;
$\sum_{i=1}^s (a_i-b_i)$ is maximized.
A natural approach is to sort... |
I have a DAG. I want to construct a boolean formula $\varphi$ that represents all paths from a source node to a sink node.
In particular, I have a variable for each vertex. A path $v_1 \to v_2 \to \dots \to v_k$ is represented as the subformula $v_2 \lor \dots \lor v_{k-1}$. I want a formula $\varphi$ that is a conj... |
I'm working on a compression algorithm for a specific kind of data. I have found a way to discard (important) parts of the data during compression as I have also found a way to recover the missing parts during decompression.
The decompression algorithm most of the times will infer the data equal to the discarded one. ... |
I have come up with:
S→0SX | 1SY | 2SZ | SS | ϵ
X→1
Y→0 | 2
Z→1
I think I am wrong. Any directions?
|
I have a discrete function of two real variables defined as a set of point in a rectangular domain. The function is smooth. I need to approximate it with a polynomial function of the 2nd degree with the error as little as possible. What algorithm can I use to find out the constants for the polynomial?
|
I am thinking about the worst-case space complexity of an algorithm.
Obviously, if $f \in O(nm)$ then $f \in O(n+nm)$. But is the converse true?
$O(m)+O(nm) = O(m+nm) = O(m(1+n)) = O(m)O(1+n) = O(m)O(n) = O(nm)$
If that were true then $O(n+nm) = O(m+nm)$
|
Given a sequence of positive reals $a_1, a_2, \dots, a_n$ and an integer $m$, for each $j$ assign $a_j$ to a machine $i$, $1< i < m$, so as to minimize the maximum, over $i$, of the sum of all reals assigned to machine $i$.
Theorem: There is no randomized $m$-machine scheduling algorithm with a competitive ratio le... |
Here is my earlier question. But there was no full answer.
I've decided to include specific DIMACS files:
http://jarvis2.hmcloud.pl/sat/cnf.formula.10 (15.8MB)
http://jarvis2.hmcloud.pl/sat/cnf.formula.15 (53.5MB)
http://jarvis2.hmcloud.pl/sat/cnf.formula.20 (134.6MB)
Are these CNF formulas fulfilling a condition of Sc... |
If I have a task graph T and want a schedule to optimize the make-span, what is currently the best approximation algorithm for this problem? Are there any constant approximation algorithms?
|
This month the IEEE Software magazine has published the article Voice of Evidence: A Look Back. This is a kind of impact analysis of the Voice of Evidence (VoE) series of articles.
As you know, these articles are meta-analysis about software engineering practices and they give invaluable information about which things ... |
Input alphabet = {a,b,c}
I tried with the following grammar :-
S -> aSa / bSb / T
T -> cTc / cSc / cBc
B -> c / cXc
X -> a / b / aXa / bXb / epsilon
This grammar is not able to generate 'cacac' .Is there any way to write this grammar with less number of productions or are any productions redundant here ?
Thanks.
|
Define languages $L_0$ and $L_1$ as follows :
$L_0 = \{\langle M, w, 0 \rangle \mid M \text{ halts on }w\} $
$L_1 = \{\langle M, w, 1 \rangle \mid M \text{ does not halts on }w\}$
Here $\langle M, w, i \rangle$ is a triplet, whose first component $M$ is an encoding of a Turing
Machine, second component $ w$ is a string... |
The ordered order-k Voronoi diagram (sometimes written OOKVD) partitions the plane into regions such that the k closest sites are the same and in the same order for all the points in a region.
I am interested in particular in the case k=n, the number of sites.
I would also like to know the upper and lower bounds in the... |
Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2 below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements is TRUE for any arbitrary employee table?
Q1 :
Select... |
I'm looking at some proof that shows $NP^{NP\cap coNP} = NP$.
Let's consider the non-trivial direction. Consider $L\in NP^{NP\cap coNP}$. Then, there's an $A\in NP\cap coNP$ such that $L\in NP^A$.
Since $A\in NP\cap coNP$, there're two machines $M_A$ and $M_{\overline A}$ to decide $A$ and $\overline A$, respectively. ... |
So I'm trying to get my head round Curry-Howard. (I've tried at it several times, it's just not gelling/seems too abstract). To tackle something concrete, I'm working through the couple of Haskell tutorials linked from wikipedia, esp Tim Newsham's. There's also a useful discussion when Newsham posted the tutorial.
(But... |
I am working on a problem in which I have to solve 0-1 linear programs, that is linear programs where some of the variables are binary, i.e. either 1 or 0.
Lets say I have a fixed number of $n$ variables in my program of which $k \leq n$ are binary. The other $n-k$ variables are continuous. My question is:
What can be ... |
So, i would like to know the time complexity of the following codes:
x = (float) rand() / rand(); // T(4)
while (x >= 0.01) // T(?)
{
x *= 0.8; // T(?) x T(2)
}
Assuming that all the basic operations are perfomed once, is the best case T(1) - constant time? Since, that might only happen when the random x gen... |
The only graph problem that I worked with is TSP. It is exponentially hard, but there are tons of heuristics which allows to find near to optimum solution.
So I was wondering, is there any graph problems (or optimization problems which could be mapped onto graph) that are exponentially hard and can not be solved (even ... |
Consider the following complexity class $IP^\star$, a variant of $IP$.
A language $L$ is in $IP^\star$ if there's a proof system $(P,V)$ s.t.
$V$ is a verifier runs for a polynomial time and:
$$x\in L \implies Pr[(P,V)(x) = 1] \ge 3/4 \\ x\not\in L \implies
> Pr[(P,V)(x) = 1] = 0 \\ $$
Prove that $NP = IP^\star$. ... |
I need to find an upper bound for $T(n)=T(\sqrt{n})+10\log\log n$.
I thought first to make a substitution: $m=\log n$. Then:
$$
T(2^m)=T(2^{m \over 2})+10\log m
$$
Let $S(m)=T(2^m)$:
$$
S(m)=S\big({m \over 2}\big)+10\log m
$$
Now we can use Master theorem.
Suppose it's the case when $f(m)=O(m^{\log_2 1-\epsilon})=O(m^... |
Note that this is not duplicate of my previous question: how to simplify algebraic expressions, though it is similar, but still this is different, this is not the same.
I need an algorithm that either proves or refutes that:
∀X,Y,Z,n,i,j,k,l: X∈{A,B} ∧ Y∈{A,B} ∧ Z∈{A,B} ∧ i,j,k,l≥0 ∧ n≥1 ∧ i+j+k+l≤n-3
$\Sigma$ (A+B)iX... |
Suppose I am running an experiment with some subjects, and I obtain some numerical data from them. The subjects are divided into 2 experimental groups. Rather than display the means of each group in a bar graph, I would like to show their individual data. So I plot the data like so:
This is all fine and good, but let'... |
In a recent algorithms course we had to form a condensation graph and compute its reflexive-transitive closure to get a partial order. But it was never really explained why we would want to do that in a graph. I understand the gist of a condensation graph in that it highlights the strongly connected components, but wha... |
Alphabets = $\{0, 1, \epsilon, \emptyset, [, ], \cup, \circ, \star\}$
where $\circ$ stands for concatenation, $\star$ is kleene star, $\epsilon$ is empty string, $[$ and $]$ are brackets to be used for language to be generated.
Only those Regular Expressions to be considered which don't have nested brackets $[[]]$.
How... |
Which is better, Flood Fill or Scanline Fill algorithm in computer graphics? My thoughts says that both of them has the same efficiency in term of time and space complexity. Maybe you guys have another thinking? Thanks
|
I'm stuck on problem 9.4 from The Nature of Computation which reads:
Dynamic Salesman. A naive search algorithm for TSP takes $O(n!)$ time to check all tours. Use dynamic programming to reduce this to a simple exponential, i.e., to solve TSP in $O(2^npoly(n))$ time. Can you do this without using an exponential amount ... |
Equality problem is checking if 2 DCFL's or CFL's are producing same language.
I read that it is decidable for DCFL and undecidable for CFL.
If we consider a DCFL like a^n b^2n / n>=1, here we can draw a PDA for this in two ways.
So how can we check if 2 DCFL's produce the same language by just looking at the PDA as t... |
This is a simplification of a real world problem and only a small piece at that.
Example sets are
---------------------- ------------------------------------
| Set1 | Set2 | Set3 | OR | Set1 | Set2 | Set3 | Set4 | Set5 |
|--------------------| |--------------------|--------------
| 1 | 10 | 40 |... |
How do I test if a circle (x,y,radius) is inside a polygon ([x,y],[x,y],[x,y],[x,y]...) without touching the edges?
Update
I decided to do a point in polygon followed by a circle line collision on each edge, this let me know first if the circle was within the polygon and then told me if it was colliding with any of the... |
I was reading this article. In its third paragraph of the third section, named The Classical computational theory of mind, it said that Most Turing Machines are not programmable. I got the literal meaning out of the statement.
I have only done Automata Theory 101 and the way I know Turing Machine, not much is making se... |
I know that intersection of CFL and regular language is CFL and hence CFL is closed if one of the languages is regular. One of the most common examples to show this is regular language being $p^*q^*$ and CFL being $p^n q^n$.
Now if I promote regular language to CFL according to Chomsky hierarchy as all regular language... |
How can I model logical OR as an integer linear program?
$$(y_3 + y_4 + y_5 + y_6 = 2) \lor (y_2 = 1)$$
where $y_i \in \{0, 1\}$, $1$ = True and $0$ = False.
|
If the time complexity $T(n)$ of two functions $x(n)$ and $y(n)$ are mutually recursive, as in Time complexity of mutually recursive functions, this gives $T(n)=O(2^n)$. But how do you measure an algorithm with two or more (4 in the example below) recursive functions that are not necessarily mutually recursive?
Exampl... |
The reduction from SAT to Clique shows a way to construct a graph with cliques from a Boolean formula. A closer look at that reduction even yields a simple algorithm which finds a large clique in the graph from a given satisfying assignment to the variables. That mapping is bijective: each satisfying assignment is mapp... |
I'm trying to understand what a random binary tree is. According to Wikipedia:
Two different distributions are commonly used: binary trees formed by
inserting nodes one at a time according to a random permutation, and
binary trees chosen from a uniform discrete distribution...
If I start with a root and then appe... |
Statements of the PCP theorem always speak of a proof of length $poly(n)$. But what polynomial is that exactly? Could you actually construct the PCP for some mathematical fact in real life?
|
The following is an excerpt from the Estimating LAT Confidence section of this paper:
... Since some LAT detection rules are more reliable than others, we
would like to have a confidence value in each LAT that can be used to
weight each LAT appropriately during answer scoring. To accomplish
this, we trained a lo... |
I read this answer below and got into another question.
Why is the consensus number for test-and-set, 2?
I also read that read/write registers have consensus number 1.
But I see that in test&set (also in compare&swap) by using read write registers alone, we still arrive at consensus.
I think I am missing something very... |
I have used a purely functional binary tree structure in which there is a single node that is "marked". It allows for $O(1)$ access and modification of the marked node's value, as well as $O(1)$ traversal upwards and downwards.
It is represented as a pair $(M, P)$, where $M$ is the marked sub-tree and $P$ is a list of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.