instruction stringlengths 35 29.1k |
|---|
I have a problem P that is said to be O(n^7) in the worst case.
I'm asked to agree or not if it is solvable in O(n^9) time. And also I'm asked to agree or not if P cannot be solved faster than Ω(n^7) in the worst case.
My answer for the first question is that if P is bounded by O(n^7) it is also solvable in O(n^9).
And... |
I am trying to solve the following problem:
Given a matrix which consists of only 0's and 1's. Considering the matrix as a metal sheet, we need to "cut-out" square blocks of sizes 2x2 consisting of only 0's from it. A 1 in the sheet (represented by the matrix) indicates that we cannot cut the region out from the sheet.... |
In class, we were given the following problem:
We are given a directed graph G = (V, E) on which each edge (u, v) ∈ E has an associated
value r(u, v) which is a real number in the range 0 ≤ r(u, v) ≤ 1 that represents the reliability
of a communication channel from vertex u to vertex v. We interpret r(u, v) as the... |
Given the following PDA describe the language it accepts.
Q = { q0, q1, q2 }
Σ = { a, b }
Γ = { A, B }
F = { q1, q2 }
z = B
δ ( q0, a, B ) = { ( q0, AB ) }
δ ( q0, λ, B ) = { ( q1, λ ) }
δ ( q0, b, A ) = { ( q2, λ ) }
δ ( q0, a, A ) = { ( q0, AA ) }
δ ( q2, b, A ) = { ( q2, λ ) }
δ ( q2, λ, A ) = { ( q2, λ ) }
δ ( q2, ... |
Sometimes, when reading about algorithms or other theoretical topics, I see time complexities that include other time complexities within the expression.
For instance, "the best fixed-parameter tractable algorithm for the vertex cover problem has a time complexity of $O(1.2738^{k} \cdot n^{O(1)})$."
What does this $O(1... |
I have a problem with understanding the $P_2 \mid \mid C_\max$ problem which is also known as Tasks Scheduling on Multiple Processors.
In fact, in my case I need only one processor (but the problem is usually described for 2 or more so let it be). I understand what is all about: given a set of tasks with constant dela... |
What is the successor of 6 in this tree: 7 or 9?
|
I was reading CLRS and it said in the chapter for the accounting method (for amortized analysis):
the total credit associated with the data the structure must
be nonnegative at all times.
where total credit is defined as:
The total credit stored in the data structure is the difference between the total amortized c... |
In this problem, a robot is moving around on a rectangular grid and try to traverse and cover the whole grid, but it can only go one direction until it hits the boundaries/obstacles or its own trace. The problem is to determine the starting position and the directions of robot so it can cover the whole grid (also in so... |
I remember reading this somewhere (will post the source as soon as I find it), but was wondering, if anyone knows why this is true or has maybe an example to portray why this is the case.
|
I was trying to understand why using only path compression (no rank) would yield $m log(n) $ total run time for a sequence of $m$ operations for Find-Set.
I was told that the potential function:
$$ \Phi(x_1, ... , x_n ) = \sum_i log(w[x_i])$$
would work (where $w[x_i]$ is the weight of the subtree rooted at $x_i$, i.e.... |
How to find which of $2^{n}$ to $n^{a}$ is an (upper bound, tight bound asymptotically larger, etc..)? I tried to use the formula:
$$ \lim_{n\to\infty} \frac{f(n)}{g(n)} $$
where $f(n) = n^{a}$ and $f(n) = 2^{n}$
But I cannot figure out how to use L'Hospital's rule to solve it. We are guaranteed that $a \in \mathbb{N}... |
Let L be the language consisting of all strings in (a+b)* that have an even number of letters and do not have aaba as a substring.
Into how many L-equivalence classes is (a+b)* divided?
|
You are given a directed acyclic graph G = (V, E) in which each node has one
“left” out-arc and one “right” out-arc, with a distinguished source node s and sink node t. You are also given a list of “ties” (u, v) which say that if you take the left [right] edge out of u, then you must also take the left [right] edge out... |
I'm trying to understand comparisons between the two. Is there ever a case where is it better to use Huffman Coding over LZW? Could the compression ratio for Huffman ever surpass that of LZW?
Thanks!
|
We have two languages: $L_1,L_2$. We know that $L_1L_2$ is regular language, so my question is if $L_2L_1$ is regular too?
I try to find a way to prove it...
I can't assume of course that $L_1,L_2$ are regular...
So I look for a way to prove it.
I'd like to get any hint!
|
MAX-2SAT is NP-Complete.
If the solution is stipulated to be unique, is MAX-2SAT still NP-complete?
|
I have:
<A> -> <B> <C> <D>
<D> -> <D> <C>
<D> -> lambda
Since <D> goes to lambda, can I just change my language to:
<A> -> <B> <C> <D>
<D> -> <C> <D>
<D> -> lambda
thereby removing the left recursion? If I do the alpha beta removal method it creates an extra state that seems like junk.
|
Consider rational numbers given as their decimal expansions, then for every number we can build a finite automaton able to accept it. To simplify the argument, assume that finite rational expansions are followed by an infinite number of zeros. In such case it is easy to see that the automaton that accepts such number... |
I have been working on Bangla keyboard optimization. I've taken this paper as a reference. In this paper they have introduce two terms monograph and digraph. But it is not clear how they have calculate these two things. In this paper it is written -
A monograph is an isolated key which is struck in the process of typ... |
The trial division algorithm for checking if a number $N$ is prime works by trying to divide $N$ by all integers in the range 2, 3, ..., $\lfloor \sqrt{n} \rfloor$. If any of them cleanly divide $N$, then we say that $N$ is composite; otherwise we say that $N$ is prime.
In the worst case, this requires $O(\sqrt{N})$ di... |
Can anyone direct me to some literature on learning nonlinear dictionaries? I don't mean sparse dictionaries specifically, but for example learning kernel parameters, or learning $W$ where $y = \phi(Wx)$ and $\phi$ is a fixed nonlinear function. There seems to be fairly well established methods when $\phi$ is linear, b... |
I'm not 100% sure this appropriate for CS. Sorry.
I'm looking for prior art on an idea I had, but either my Google fu is lacking, or it genuinely hasn't happened.
In distributed systems, there are a number of consensus protocols and implementations (Raft, Paxos, Zookeeper, etc.). There's also the Bitcoin blockchain. Bo... |
Does there exist an algorithm that will compute in sublinear time whether a bipartite graph contains a cycle of fixed length? For example given a $K_{3,3}$ graph finding if it contains a cycle $C_4$.
I considered the answer to be no. As a DFS could be used and then compare to see if after a certain traversal we were ba... |
Suppose I have two regular languages $L_{1}$ and $L_{2}$ such that $L_{1} \subseteq L_{2}$ and $L_{2} - L_{1}$ is infinite. I want to find another regular language $L_{3}$ such that $L_{1} \subseteq L_{3} \subseteq L_{2}$ and both $L_{2} - L_{3}$ and $L_{3} - L_{1}$ are infinite.
My solution to this problem is choosing... |
I read somewhere that the most efficient algorithm found can compute the factors in $O(\exp((64/9 \cdot b)^{1/3} \cdot (\log b)^{2/3})$ time, but the code I wrote is $O(n)$ or possibly $O(n \log n)$ depending on how fast division and modulus are. I'm pretty sure I've misunderstood something somewhere, but I'm not sure ... |
We learn about the Pumping Lemma at the class and I tried to make few examples to understand it...
There I make this example:
Let's say: $L=\{w\in L|w=(0+1)^*1\}$ - i.e. - L is the language of all the words that finish with $1$. (The language is regular of course).
Now, I can take the word: $w=0^{n-1} 1$. $w\in L$ an... |
I improved the complexity of an alogrithm from $O(n)$ to $O(\ln(n))$. Is it legitimate to call this an "exponential speedup" in a scientific publication? Usually I think going from NP to P when I hear the phrase "exponential speedup". I'd like to avoid overselling my work.
|
We know that $L=\{0^i 1^{j^2}|i> 0,j\ge 0\} $ is irregular (by the Pumping Lemma), we have to use it to prove two things:
$L_1=1^*\cup \{0^i 1^{j^2}|i\ge 0,j\ge 0\} $ is irregular.
$L_1$ is making all the three conditions (I don't know the exactly word at English for this...) of the Pumping Lemma.
For the first one... |
I started computer science in university. And we started learning about Discrete and it's mathematics which is completely based on logic, which I understand. however, how is predicates, sets, proofs are related to computers ? I want to know the reason for learning these stuff?
|
λ-terms can be split in two categories: EAL and non-EAL typeable terms. It is known not only that EAL-typeable terms can be reduced to normal form in polynomial time, but that the reduction can be executed through Lamping's abstract algorithm optimally.
What are the distinct features that make a term EAL-typeable? I'v... |
Let's say I have some static, unchanging data (no adds, modifies or deletes) which is looked up by a string value, and that I'm looking to minimize size in memory while also trying to minimize lookup time.
It seems to me that keeping the strings sorted in a list and then doing a binary search is always going to be bett... |
It is widely accepted that turing-complete systems are equivalent in terms of computability - i.e., whatever a turing-machine can do, can be emulated by automatas, the lambda calculus and other computing systems.
Not much is said about the efficiency of such systems. Intuitively speaking, it makes sense to think that s... |
I am aware that this seems a very stupid (or too obvious to state) question. However, I am confused at some point.
We can show that P $=$ NP if and only if we can design an algorithm that solves any given instance of problem in NP in polynomial time.
However, I do not understand how on earth can we prove that P$\neq$NP... |
Shor's algorithm is often used as the argument. It can solve the factorization problem faster than any known algorithm for classical computers. Yet, we have no proof classical computers can't also factor integers efficiently.
Is there any actual proof quantum computers can solve some problems faster than classical com... |
Different set of primitive operations lead to different complexity of certain problems. For example, sorting by comparison is only O(N*log(N)) if one assumes both integer comparison and random array indexing are O(1). While this might hold for bounded N, I believe complexity analysis is, theoretically, supposed to spec... |
There are particular problems in Kozen that I'm unable to solve, and they seem to be similar to each other. It is showing that sets:
$$ \{x \mid \exists y: |y| = 2^{|x|} \text{ and } xy \in A \}$$
$$ \{x \mid \exists y: |y| = |x|^2 \text{ and } xy \in A \} $$
are regular for a regular set $A$.
The only method I'm fami... |
My book uses this definition for the Polynomial complexity class ($L$ is a language over $\{0,1\}$):
$$\mathrm{P} = \left\{L\subseteq\{0,1\}^*\;\middle|\; \begin{array}{l} \text{there exists an algorithm $A$ that decides $L$} \\ \text{in polynomial time}\end{array}\right\}\,.$$
But by this definition, don't all languag... |
I have a language and I am trying to see if it's context-free or not, by trying to use a pumping-lemma but I can't figure it out, been reading a lot of other posts but still struggling to apply it to my example
this is the language (sorry for using an image, i know how to write number exponents but i don't know how to ... |
If you have a question saying "draw the NFA for the following language" what difference does it makes if the language is $(0^* \cup1^*)$ vs $(0 \cup1)^*$ in otherwords what difference does it make for the diagram if the star is on the inside or outside of the brackets?
|
My professor was giving a lecture on B+ Trees deletion, and I got very confused. According to him for deleting any key from a B+ Tree:
1- First navigate to the leaf *L* where it belongs.
2- If the *L* is at least half full if you can simply delete it.
3- If it contains d-1 elements then you need to redistribute and mer... |
I want to create multi-tape Turing machine that recognize language {ww, $w \in {a,b}$}. With condition that max. steps is less or equal than $\frac{3}{2}\left | x \right | + 2$. Where x is word from language. I have an idea to create x-tapes to solve this problem, but can be the number of tapes not known before readin... |
im trying to figure out why this is true
The clauses {a,b}, {b,~c}, {c,~a} constitute a 2SAT problem with an implication graph without bad loops.
Can someone show me how to illustrate this and indicate how i can find wether any 2SAT problem has a bad loop or not, Thank you so much :)
|
Given $n$ points in 2D, e.g., $p_1,p_2,....,p_n$, there are $n^2$ possible pairs of points. I want to output the list of $n^2$ pairs, but sorted according to their distance (e.g., the pair of two points that are closest is the first pair in the output, and so on).
Is there an algorithm to do this with running time bet... |
I been watching tutorials about how to check if a language is not context-free and in 1 video there was a language: L = {a^n b^n c^n | n ≥ 0} and they used a pumping lemma to prove that it's not context-free, I am only a beginner at CFG however I thought a language is Context-free if you are able to create a CFG for it... |
When I google for complete matching, first link points to perfect matching on wolfram.
It defines perfect matching as follows:
A perfect matching of a graph is a matching (i.e., an independent edge set) in which every vertex of the graph is incident to exactly one edge of the matching. A perfect matching is therefore... |
Let $A_1=(Q,\Sigma,q_0,F_1,\delta _1)$ and $A_2=(P,\Sigma ,p_0,F_2,\delta _2)$ a finite non determinustic automaons.
Describe algorithm that deside if there are two words $x$ and $y$ in the same length such that $x\in L(A_1)$ and $y\in L(A_2)$
Hint: Intersection automaton
My try
To bulid the intersection automaton $... |
When proving that that the quotient of a regular language $R$ and an arbitrary language $B$, I understand you take a DFA $M$ accepting $R$, and then construct a DFA that is the same, but its final states are those from which we can reach a final state of $M$ with a string from $B$. How can we just say it's possible to ... |
Given the definition of a regular language is one that can be expressed with finite memory, how is $\{1^n \mid n \geq 1\}$ regular? The $n$ is unbounded. I know a DFA can be drawn, which means the language is regular. But I thought another condition is that $n$ must be bounded, so it's as if the 2 tests contradict eac... |
I have a single output variable $y$ and a number of inputs $x_1$, $x_2$, etc. These are time series. Each $x_i$ explains the changes in $y$ in specific circumstances, and the goal is to have a linear model that looks like $y=b_1x_1+b_2x_2+...$ The point is that each $x_i$ must be sampled on different clock $c_i$. Imagi... |
This question is related to OS. After having solved many problems in CPU scheduling I was wondering how does the CPU know the burst time of all the processes in the main memory before executing them?
Selecting a process among a pool of processes using some scheduling algorithm is done based on CPU burst of each proces... |
I have the nfa problem below which I dont quite understand. I have been reading many slides on this but I'm having a really hard time understanding them enough to be able to complete the question. I can see that on the $q_0 $ state when we have an $a$ it should stay in the $q_0$ state and for the $q$ state when we have... |
Deamortization refers to the process of converting an algorithm with an amortized bound into one with a worst-case bound.
For example, assuming you need to find the median of an array once every $n$ operations of type $X$ (which does not change the array).
You could take a specific algorithm, such as the median of med... |
Give a counterexample to show that the following constructions are not correct proofs for the star operation:
Given a CFG $G = (V,Σ,R,S)$, add the new rule i) $ S → SS$ or ii) $S → SS|ε$.
For i), I basically said that this rule is an infinite loop and doesn't contain an epsilon, so can't be the star operation.
For i... |
Let $X\leq Y$.
If $X$ is $NP$-hard, is $Y$ $NP$-hard? I think yes, as if an $NP$ problem is reducible to $X$ in polynomial time, then surely it is also reducible to $Y$ given that $X\leq Y$.
If $Y$ is $NP$-hard, is $X$ $NP$-hard? Not sure how to tackle this. Are some $P$ problems reducible to an $NP$-hard problem? If ... |
For a given regular language, there are multiple finite automata. How do we determine which one is best?
|
I have to write a rule as part of a small step operational semantics (https://en.wikipedia.org/wiki/Operational_semantics).
Whenever this rule is applied, the next bit belonging to an infinite
bit string must be taken.
Therefore, in the premise of the rule, I have to express that the next bit of a (previously) fixed b... |
What are some good resources for practice problems on formal languages? Every textbook I've seen contains few practice problems with even fewer answers. I would like a resource that has questions with varying degrees of difficulty, not just one really hard problem. For example if you learn about the pumping lemma, how ... |
I have the CFG G with the following production rules:
$$
S \to aSaS \mid b
$$
Is it possible to find $L(G)$? I have no idea how describe it by any pattern. I use grammophone to check example words, but it's not very helpful tho.
|
Vertex set $A$ is of the form: $A = \{(v_1,r_1),(v_2,r_2),...\}$ where $v_1 \in V$ and $r_1$ refers to the number of times $v_1$ is reached in some walk and $v_j \neq v_i$ whenever $i \neq j$.
Suppose that one wants to count the number of distinct vertex sets that each have $\sum_i r_i = k$ and are allowed by some wal... |
So I generally understand how to follow a flow-diagram of a Turing Machine, but I'm going over how to write the "steps" in English and am having a bit of trouble. The problem is as follows: "Give the English description of a Turing machine that decides this language: {$1^{n}$$2^{n}$, $n > 0$}"
I understand that the str... |
Consider the augmented grammar G is:
S` -> S
S -> a
S -> (T)
T -> T,S
T -> S
I have tried to construct parse table. But, when I read '(' nonterminal Symbol (item 3), there is no action table elements either 'shift' or 'reduce'.
I3:
S -> (.T)
T -> .T,S
T -> .S
so I can't construe '(a,(a,a))' in this Parse table.
then ... |
The actual runtime of applying quick-sort to an integer array heavily relies on the choice of pivots.
It is well known that picking a random pivot does not work as good as taking the median of three, or the ninther of the array.
Obviously, for comparison we need to fix a model of computation / cost per operation.
Assum... |
Linear systems of equations over the reals have either 0, 1 or infinitely many solutions. However, when applied to finite fields (specifically GF(2)), infinitely many is not an option.
Is there a fast general method to calculate the number of distinct solutions to a linear system of equations over GF(2)?
You can assume... |
I am reading Skiena but do not have a formal background in Computer Science. On page 457 he discusses generating set partitions via restricted growth functions. Here's specifically what he says:
Set partitions can be generated using techniques akin to integer partitions. Each set partition is encoded as a restricted ... |
I am reading the book Computer Organization and Design. It compares instructions on memory and instructions on registers but doesn't say anything about the speed of instructions when the source operand(s) is/are constants. In that case which will be faster register operands or immediate(constant) operands ?
|
Given an AVL tree, I want to compute its height as efficiently as possible. $\newcommand{\bf}{\text{bf}}\newcommand{\height}{\text{height}}$
Each node of an AVL tree stores its balance factor ($\bf$), defined as
$$\bf(v)=\height(v.\text{left}) - \height(v.\text{right}).$$
We can recursively compute the height of an AVL... |
G:
S -> bRS | RcSa | @(epsilon)
R -> acR | b
....
2-LOOKAHEAD(S->@) = {$,a,aa}
2-LOOKAHEAD(R->b) = {b,ba,bb,bc}
I don't understand a result of these rules..
----+
when I tried to solve 2-LOOKAHEAD(S->bRS), it solve easily.( {ba,bb} ).
but I don't understand why 2-LOOKAHEAD(S->@) results are {$,a,aa} and
2-LOOKAHEAD(... |
Given an $n$-bit integer, I am interested in performing an increment operation using as few bit reads as possible. The standard binary code (standard binary representation of numbers), requires $n$ bit reads and writes in the worst case, though only $2 - 2^{1-n}$ bit reads on average (i.e $2$ bit reads on average asymp... |
Is there anyway for example, to take a trivial program from C such as:
int main() {
int i = 1 + 1;
return 0;
}
And compile this down to some form of Quantum Abstract High-level language, i.e. Quantum C?
From what I understand, quantum arithmetic is quite tricky business that uses QFTs. My first thought was to do t... |
I am currently doing my homework for my Computer Architecture class. One of the questions asks:
A computer has a 64-bit data bus and 64-bit-wide memory blocks. The memory devices have an access time of 35 ns. A clock running at 200 MHz controls the computer and all operations take an integral (i.e. whole number) of c... |
Suppose we have public key: $$n= 1015, e= 3$$ and private key: $$d= 635, p= 35, q= 29, \phi(n)= 952$$
For $m = 100$, we have $$c = m^e ~mod~n = 100^3 mod~1015 = 225.$$
To decipher this, let us take $$c^d~mod~n$$ which is $$225^{635}~mod~1015$$ which equals $$680$$ But $680 \neq 100$ so this means that RSA incorrect... |
I'm learning how to convert NFAs to DFAs and I want to make sure I'm doing it right. Obviously, going back in the other direction isn't a thing. Does anyone know of an algorithm to check that a DFA is equivalent to a NFA?
|
I'm very interested in computing and programming. I have done a lot of programming with different languages although I have a question nobody was able to answer until now.
I question myself how is software related to hardware. to be more specific what are the basic mechanisme which make it possible for hardware to und... |
The edit distance between two strings $d(w_1, w_2)$ sums up the cost of edit operations that transform one string into the other. If done right, the edit distance is a metric.
In particular, the cost of an edit operation may depend on the character inserted or deleted, meaning we have costs $w_\text{insert}(a)$ and $w... |
I have found that naive Bayesian classifier performs much better than classification using mixture of multivariate Gaussians.
Here is the problem: I have a set of objects with attached features (10 of them), part of the set is the training set with pre-assigned labels, another part needs to be classified into 3 classes... |
I am looking for the most efficient algorithm for finding shortest path between two Vertices.
The graph is:
undirected
edge-weighted
Non-negative
less then 300 nodes
I understand that most of the algorithms based on Dijkstra's shortest path algorithm. But which one is the most efficient for the case a specified abov... |
Let $X = \{x_1, x_2, ..., x_n\} \subset \mathbb{R}^m$ be a finite set of points. Smallest enclosing ball is a well-known problem that asks for the $m$-ball that covers all $x_i \in X$, while having the smallest radius possible.
I am interested in solving a related, more constrained problem. Namely, in my version, the e... |
I'm trying to prove some code is correct, using Hoare logic. How do I check whether my loop invariants are correct?
I'm asked to prove (using Hoare Logic) that the following program is valid:
x=1;
i=N;
while (i!=0){
i--;
x*=A;
}
with the pre-condition that N>=0 and post-condition that x=A^N.
This is my atte... |
String is an immutable class in Java. An immutable class is simply a class whose instances cannot be modified. Why does the Java programming language choose to make objects of class String immutable?
|
Of course a matching polytope is the convex hull of edges in a matching and similarly for a perfect matching polytope.
|
Consider a bipartite graph $G=(U, V, E)$. Each $v \in V$ represents a soccer team, and each $u \in U$ represents a mini-tournament which needs to be scheduled. Tournament $u$ is adjacent to team $v$ if $v$ plays in that tournament $u$. Each tournament uses a full day.
If $u_i$ and $u_j$ share no common neighbor, these ... |
I was wondering how one can find a non-quadratic residue modulo $p$ and what the runtime of this algorithm would be.
I thought that one can use the Legendre Symbol
$$ \left( \frac{a}{p} \right) = a^{ \frac{(p-1)}{2} } \pmod p $$
if the Legendre Symbol returns -1 then its a non quadratic residue and if its a quadratic... |
This question is fairly specific in the manner of steps taken to solve the problem.
Given
$T(n)=2T(2n/3)+O(n)$ prove that $T(n)=O(n^2)$.
So the steps were as follows. We want to prove that $T(n) \le cn^2$.
$$\begin{align*}
T(n)&=2T(2n/3)+O(n) \\
&\leq 2c(2n/3)^2+an\\
&\leq (8/9)(cn^2)+an
\end{align*}$$
and then my pr... |
Say for instance you layout a quantum simulator like follows:
amps = [0] * 8 # 3 qubits
Therefore you are left with the following in binary:
000, 001, 010, 011, 100, 101, 110, 111
Does the third digit in binary represent the third qubit or the first?
One would assume it would be the third but I'm not certain and I do... |
Are there any good examples of promise problems that are NP complete?
|
I am having trouble understanding how to write a regular expression for the set of words that contain at least two b's and at least two a's, where the alphabet is {a,b}.
I understand that set of words that contain at least two b's is: [1] (a+b)*b(a+b)*b(a+b)* and the set of words that contain at least two a's is: [2] (... |
A k-dumbbell is a graph that consists of 2 cliques each of size k with one and only one edge between them. How do I show that finding if a graph is a k-dumbbell is NP-complete?
Proof it is in NP: Given the cliques of size k, I can verify if it they are the cliques of size k.
Proof of NP-hardness: If there is only one e... |
I am attempting to find the most efficient route to get from a source to a destination in a bus network. Each stop is a vertex in a graph, and each edge between vertices represents a route between stops.
The weights of the edges represents how long it takes to complete a particular journey between stops. For example, i... |
I'm a little confused about the concept of the Bellman-Ford(BF) algorithm to compute the shortest path in a general graph with negative weights knowing that there are no negative cycles present. I understand why Dikjstra doesn't work for a graph with negative weights. So in the Bellman-Ford algorithm we decide to updat... |
Hypothetically, let's say you are using the pumping lemma for either regular or context free languages. Now using either, you come across a case that remains true despite pumping it. In this situation, do you have to "throw out" the lemma so to speak? I am under the impression that the answer is yes, but I'm just not s... |
I'm working on a AI project which generates poems in Turkish language like this project: https://github.com/schollz/poetry-generator
It's a successful project but it's a template based poem generator. You can't select a topic for poem generation. It generates poems randomly with hardcoded templates and words.
In my pro... |
I am trying to proof the following statement:
If $ {\rm SAT} \in {\rm PCP}[r(n),O(1)]$, where $ r(n)=o(\log n)$, then ${\sf P}={\sf NP}$.
Here are my ideas for the proof:
It can be easily worked from here that there exists an nondeterministic Turing machine $N$ solving any SAT instance in time $o(n^{q})$ for any $q \in... |
We know that under hierarchy collapse results GI is not NP complete.
Would there be any consequences if GI is equivalent to a promise version of an NP complete problem?
|
I was reading CLRS and it asked to show that if $p$ is a prime of the form $4k+3$ and $a$ was a quadratic residue, then $a^{k+1}$ is a square root (one can also easily show that $a^{-k}$ is a square root).
I was wondering if using the previous fact and also that we knew we had a number of the form $N = 4k+3$ (not neces... |
How can the class of tail recursive functions (TR) be compared to the classes of primitive recursive functions (PR) and recursive functions (R)?
The computation of a PR function always halts. This does not apply to TR functions.
Given a tail recursive function $f$:
$$f(x) = f(x)$$
The function $f$ obviously will res... |
Given a string S of length N, a string A of length M, a string B of length O such that N >= M + O. Check if the string S can be split into two subsequences X and Y such that A = X and B = Y.
Example: S = "abCDEfgH", A = "abfg", B = "CDEH" => answer is Yes
S = "abcDEG", A = "acdG", B = "ED"
I found that this can be solv... |
Given the depth of the tree, I need to calculate the longest possible path in the full binary tree (also known as the diameter).
When attempting this problem, I experimented with what the depth has to do with the path length. However, the solutions I came up with depended on going through the root, while the longest pa... |
I'm inserting numbers 1 thru 15 into a binary search tree one by one. I need to come up with an order to insert these elements for it to result in a full and balanced binary tree. I've tried to create the binary search tree myself, starting with a root of 8, however I could never get it to be full; the depth would incr... |
Let's say I am working on handwritten digit recognition (0 to 9). I know for instance that if I use clustering then I need to look for 10 clusters. But once I have the 10 clusters,how do I identify automatically which cluster corresponds to which digit?
In general, say I have some other classification task where I don'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.