instruction stringlengths 35 29.1k |
|---|
For example I have 2 simple FSM. I will use regular expression for clarity.
FSM1 = 1+ = [1,11,111,...]
FSM2 = 2+ = [2,22,222,...]
FST = 1/2 = [1->2,11->22,...]
What is the general way to prove that there exists finite-state transducer that maps each string from the set defined by FSM1 to a string defined by FSM2? What... |
Is a Turing machine with added the following contant-time operation equivalent (in the sense that polynomial time remains polynomial time and exponential time remains exponential time) to a (usual) Turing machine:
By predicates I will mean predicates in first-order predicate calculus. (Note that predicates may have fre... |
Is a computer with infinite memory and infinite word size a Turing machine equivalent (in the sense that polynomial time remains polynomial time and exponential time remains exponential time) if we allow constant-time linked list element insertion (at the beginning of the list)?
I doubt this because element insertion r... |
I've just learned While-Programms. In case you're not familiar with it, a W-P is inductively defined as...
$x_i \leftarrow x_j+c$ (Addition for every $i,j \in \mathbb{N}$)
$x_i \leftarrow x_j-c$ (modified subtraction for every $i,j \in \mathbb{N}$)
If $P_1, P_2$ are While-Programms, so is their composition
If $P$ is... |
A graph G has n vertices and m edges
The Minimum Cycler of G is a set S of edges of minimum total weight such that every cycle in G contains at least one edge in S.
Devise an algorithm that finds the Minimum Cycler in O(m log n) time
My Approach-
Consider a cycler S. We can reduce our focus only to the cycler with mini... |
I started learning CFG and I'm trying to find CFG for this language, but I have no idea where to start and I can't seem to find this one online anywhere. It would be great help, if someone could show me how to do it. Thank you!
|
Suppose I assume that the complexity of a non-deterministic Turing machine $N$ is $T(n)$, $n$ is the length of the input string. What would be the time complexity of a deterministic Turing machine $D$ equivalent to $N$?
|
Python and Matlab seem to disagree on the division by 0.
Python:
>>> 1 / 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
Matlab:
>>> 1 / 0
Inf
with the usual properties of $\infty$ for Inf.
Which one is correct when it comes to the IEEE double-precision for... |
I am using method 3.3 described in Outlier Detection using Isolation Forest and Local Outlier
Factor .
It states:
Specify a dataset: $={_1, _2, ..., _}$.
Here, is the sample number of . $_$ is an attribute in $$, and $_={_1,
_2, ..., _}.$ $_$
is a certain data value of the attribute $_$
.
The outlier coefficient of th... |
I have an HW question where I found an answer that matches mine, but their breakdown confuses me.
Ques: What is 4365 - 3412 when these values represent unsigned 12-bit octal numbers? The result should be written in octal.
I used binary and then looked up the Octal to obtain 753
Found solution: 4365-3412 = 0753
This is ... |
The proof that $IP \subseteq PSPACE$ is done by considering by game tree of the interactions between the prover and the verifier; this tree is polynomial in depth and each message is polynomial in length, so the tree can be explored in a DFS like fashion to simulate an optimal prover in PSPACE.
Why can't the same be do... |
Visitor Pattern enables mimicking sum types with product types. Where does the "sum"-iness come from?
For example, in OCaml one could define type my_bool = True | False
Or encode with visitor pattern:
type 'a bool_visitor = {
case_true: unit -> 'a;
case_false: unit -> 'a;
}
let t visitor = visitor.case_true ()
le... |
I am trying to apply MADDPG, a policy gradient algorithm that uses centralized training and decentralized execution, to a project. In the work of Lowe et al., the actor returns a pmf for a discrete actions pace. If I set it to Discrete(5) for each agent, it would return something like [0.1 0.15 0.05 0.34 0.46]. I am co... |
Is it true that adding to a Turing-machine-equivalent an "oracle" calculating any polynomially calculable (in this machine) function using some other nonzero polynomial time than this machine itself could do, leaves the new Turing machine equivalent (in the sense that polynomial algorithms remain polynomial and exponen... |
Most mathematical objects can be said to be defined in simple terms, are usually really concise and still manage to capture the essence of what they are trying to talk about. For example, topology does a great job at capturing a broad and variety of interesting objects, but still its definition is simple enough to be u... |
M is a turing machine description, L(M) is recognized by M, |L(M)| is the size of this language.
Why is {M : |L(M)| <= 330} not CE?
I can't seem to understand the logic why it is not CE, wouldn't it be CE since if it goes over 330, then we just halt?
Here they mention that its complement is CE, then by Rice Theorem, |L... |
My understanding of non-deterministic algorithms is that they're "as lucky as you want".
...you can think of the algorithm as being able to make a guess at any point it wants, and a space alien magically guarantees it will always make the right/lucky guess.
For example, if you choose two vertices v and w, if there's ... |
I need to rewrite a short utility library, to get it working with the Brave browser (My actual question isn't about brave per se.)
canvas-color-tracker - example of it being used and src/index.js is short
The HTML canvas is used for mouse over and clicks to determine what object is under the cursor.
To use it with cir... |
Moving from top left down the column then over to the right column, taking ideas from here: https://www.geeksforgeeks.org/longest-palindromic-subsequence-dp-12/
I want to restate the question at the top of the Excel table.
Why do I need to max from T(i,j-1) and T(i+1,j)? Can't you just take what's in T(i,j-1)?
I chan... |
Given a binary matrix, define the magnitude of a row by reading off the numbers in it left to right and similarly for columns, reading the numbers going down. For instance, the row magnitude of the 1-st row of this matrix is 1001101, and for the 2-nd column it is 11.
1 0 0 1 1 0 1
0 0 0 1 1 0 1
0 1 1 0 0 1 0
0 1 1 0... |
I am facing the following question:
Let $\Pi$ and $\Pi$’ be two NP-complete problems, prove or refute $\Pi’\propto_{poly}\Pi$.
I do not understand the meaning of this question and how to answer it.
The definition of $\Pi’\propto_{poly}\Pi$" as follows:
Let $\Pi$ and $\Pi'$ be two decision problems. We say that $\Pi$... |
Hey guys so I picked up Introduction to the Theory of Computation and started studying finite automata and Turing machines. I was given the following language as an exercise in class, in which I need to build a Turing machine with only one tape and no extra tape space that accepts the following language:
$$\{0^{3^k} 1^... |
I'm trying to create a procedure in MySQL/MariaDB with optional filters for each participating table. Assuming the tables are $A, B, C, \ldots$, each table may or may not be filtered, and the result is that of each table having their respective optional filters applied. $A$ and $B$ have the relation A (1) -> (*) B, and... |
Why does attempting to estimate the entropy of a string, by randomly choosing pairs of (not necessarily adjacent) characters in it, and counting how often the selected characters in the pairs are equal, give wildly wrong results? Here is a MatLab program that exemplifies that, also available on my blog:
% Ovo je MatLab... |
I have been trying to create an FA for the language.
$\{w \in \{0, 1\}^∗ , |w|= 4 \vee w \text{ contains the substring }01\}$
I created one that accepts words that contain the substring $01$, but I have a hard time finding a solution for the length part.
This is my attempt so far:
Any help is greatly appreciated.
|
At the moment I am studying several questions about the arithmetical degree of some index-sets in relation to the standard-ordering on $\mathbb{Q}$. The situation is as follows: I fix some enumeration $r_0, r_1, \ldots$ of $\mathbb{Q}$ such that $<$ is decidable. Then I take
$R_e=\{r_n \mid n \in W_e\}$, where $W_e=dom... |
Quoting from Wikipedia:
A ridge function is any function $f:\mathbb{R}^d\rightarrow\mathbb{R}$ that can be written as the composition of a univariate function with an affine transformation, that is: $f(\mathbf{x})=g(\mathbf{x}\cdot\mathbf{a})$ for some $g:\mathbb{R}\rightarrow\mathbb{R}$ and $\mathbf{a}\in \mathbb{R}^... |
I am studying Computation complexity using Papadimitrious's book: "Computational Complexity".
While doing Problem 7.4.4, I came across the definition of what it means for a class of functions $C$ to be closed under left polynomial composition.
Here is Problem 7.4.4:
"Let $C$ be a class of functions from nonnegative in... |
I don't understand why the $1^{st}$ is false but I think I see why the $2^{nd}$ is true.
If $f(n) = O(n^2)$ and $g(n) = O(n^2)$, then $f(n) = O(g(n))$.
If $f(n) = O(g(n))$ and $g(n) = O(n^2)$, then $f(n) = O(n^2)$.
I understand why the second is true but not the $1^{st}$. For case 1, if
$f(n) < c_1n^2$ for some ... |
Found this in solutions of a test as being true
If you can square an n-bit integer in time $O(n \,log \,n)$, then you can multiply two n-bit integers in time $O(n \, log \,n)$.
How does the above scenario apply for multiplying different numbers? Isn't it possible that squaring is a special operation since it is just ... |
I'm looking at the following grammar rules for the Java language described on the Oracle docs:
Statement:
...
if ParExpression Statement [else Statement]
StatementExpression ;
...
StatementExpression:
Expression
ParExpression:
( Expression )
I don't understand why the StatementExpression rule... |
I have already made a Turing machine with just one tape that solves a subtraction between two numbers, but I trying to do the same but with TWO tapes.
As an example, how can I solve 4-2?
Taking account that 4 can be represented as 0000, 2 as 00 and the - as 1.
So, in this case the input will be 0000100.
|
First let's have some definition (you can find these in any complexity's textbook)
Theorem. [Gap Theorem] There is a computable time bound $t(n)$ such that DTIME[ $t(n)$ ]= DTIME[ $r(t(n))$ ] for any computable function $r$.
This theorem says that even if you have more time resources, then you cannot do more. We have... |
Can you please help me prove this? I am trying to set $o(f(n))= g(n)$ and then try to solve the equation $f(n) + g(n) = \Theta(f(n))$ but I don't know if it is the correct way, and if it is I don't know how to continue my solution. Thank you
|
I'm to write a syntax that will allow for a recursive function, i.e.
f(x) = if x == 0 then x else f(x+1)
Here's one attempt at creating the grammar:
But I don't think this is right since there's no such thing as parameterized syntax.
|
When can we fold copies in SSA?
We are clearly allowed to fold a copy such as
a0 = call foo()
b0 = a0
But what about a program such as
a0 = call foo()
C0 = call bar() // ignore sinking briefly, assume this is used later
if(a0) {
a1 = C0
}
a2 = phi(a0, a1)
call print(a2)
We can't fold the a1 = C0 copy because phi(... |
Do the following two CFGs describe the same language
S → aS | bS | ε
S → aS | Sb | ε
Would the answer to this be no, because the order can't be switched? bS and Sb are different. I'm a bit confused about how I would find out if they described the same language.
|
I was reading a solution to the problem in the title on leetcode and the article says that the time complexity of the following solution is O(n)
setup a data structure to hold stream value and insert new element in the right place using linear search or binary search
return median
my solution is as follows:
class Med... |
We have a strongly connected directed graph where each edge has positive integer weights. We are also given a $B \in \mathbb{N}$. Does there exist a strongly connected subgraph where sum of edge weights $\leq B$?
I'm not sure what NP-Complete problem to use. I tried subset sum, but it takes exponential time to build th... |
import java.io.*;
import java.util.*;
public class reverseAnArray2
{
public static void main(String args[])throws IOException
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter size");
int n = sc.nextInt();
int a [] = new int [n] ;
int b [] = new int [n] ;... |
I am reading Algorithms by Dasgupta et al and they mention maximal matchings as approximations for vertex cover.
They mention that the 2-approximation ratio is a lower bound. How is a maximal matching a lower bound? Does it mean that it is the lowest approximation value we can get compared to $\log n$ of the greedy alg... |
I read up the definition of a public key cryptosystem. It mentions there is a public key and a private key. That's confusing. Why is it called a "public key" system if it involves a private key as well?
|
I'm given a binary min-heap (implemented with an array) and need to come up with a (simple) efficient (no more than $k$ comparisons) to find the $k$-th minimal element.
My attempt was as follows:
check who is the smallest among the root children
scan the corresponding sub-heap maintaining a counter counting how many n... |
Prove that DFS produces the correct topologically ordered sequence.
I am having a hard time understanding the question itself. Should I prove the correctness of DFS? Should I use the pseudocode?
|
I'm trying to implement a KNearestNeighbor model and came across the fact that many professional models use a K-D tree to index the K Nearest Neigbors. I also read that high-dimensional data makes a K-D tree less useful because you don't eliminate as many vectors for every branch in the tree when traversing it. All of ... |
I am trying to explain the value iteration method that is used in reinforcement learning. The method is used to estimate a solution to a recursive equation like:
$ Return(state_t,action_t) = Reward(state_t,state_{t+1}) + \gamma * \max \begin{bmatrix} Return(state_{t+1}, action_{t+1}=='n')\\ Return(state_{t+1}, action_{... |
I have a connected graph with $nk$ vertices, and would like to select $n$ disjoint induced subgraphs with $k$ vertices such that each subgraph is connected, selecting one out of all possible solutions at random. It doesn't necessarily need to be uniformly at random, I just want the possibility of getting any possible s... |
I am looking for references that talk about the following subject:
Software programs are in general complex systems. That is, if we decompose them into components and we make sure that each component is working correctly then we stil can have a lot of failures that arise from the interactions between the different com... |
I am trying to understand reductions and NP-completeness from Algorithms by Dasgupta et al.
Chapter 8 has the table below and I am wondering:
if $P = NP$ does each of the problems on the left reduce to the easy problem (in $P$)in its immediate right?
The book mentions that
the problems on the left are all diffic... |
My lecturer says that a variable takes up one memory position in RAM. This is the slide in question:
But CLRS (Introduction to Algorithms by Cormen, end of page 23) says an integer is represented by $c\ lg\ n$.
Are both statements true? How can that be?
|
I want to convert a set of yaml files in a folder into an xlsx file. I thought I'd start with trying to convert one yaml file into an xlsx file. The yaml files in the folder are all in the format given below:
info:
city: Bangalore
competition: IPL
dates:
- 2008-04-18
gender: male
match_type: ... |
I know that dynamic programming is used to solve in "pseudo-polynomial time" some NP problems, like the knapsack. If P = NP, would it mean that every problem that we solve with dynamic programming would have a more efficient (polynomial) way to solve? Or are there problems that even if P = NP, we would still use dynami... |
I was going through the concept of reaching definitions from the red dragon book.
The authors define reaching definitions as follows:
Definition: We say a definition $d$ reaches a point $p$ if there is a path from the point immediately following $d$ to $p$, such that $d$ is not "killed" along that path.
Then the auth... |
I'm VERY stuck with this problem:
Given a set (with possible repeated elements), the cost of adding two elements $x, y$ is $x + y$.
For example, the possible costs of the next set $\{1,2,5 \}$ are:
The cost of adding $1 + 2$ (with cost $3$), plus the cost of $3 + 5$ (with cost $8$). The overall cost is $11$.
The cost ... |
What is the time complexity of computing $AA^T$? The context is building a co-citation weighted adjacency matrix.
|
I am studying Computation complexity using Papadimitrious's book: "Computational Complexity".
I am trying to do Problem 7.4.4:
"Let $C$ be a class of functions from nonnegative integers to nonnegative integers. We say that $C$ is closed under left polynomial composition if $f(n) \in C$ implies $p(f(n))=O(g(n))$ for so... |
I'm a first year MS:CS student, and my data structures class has inspired me to research file systems and their implementations. I recall using ext2, then ReiserFS, then ext3, then ext4, and now btrfs seems like the new thing. I understand (more or less) what changed from each of these, and their relative improvement... |
i.e. $A\leq_pB\:\wedge\:B\in\text{co-NP}\rightarrow A\in\text{co-NP}$ ?
I feel like it's the case but I can't think of a straightforward proof.
Clarification: I am talking about polynomial-time Turing reductions.
|
I'm trying to understand the very simple concept of co-NP but I can't figure it out. On wikipedia, it gives the example of SAT and its complement:
The complement of any problem in NP is a problem in co-NP. An example of an NP-complete problem is the circuit satisfiability problem: given a Boolean circuit, is there a p... |
If $n<100$ then $O(n^2)$ is more efficient, but if $n\ge 100$ then $O(n\log n)$ is more efficient.
I am sure that this statement is valid, but I don't know how to prove it or justify it. Can someone please help me?
|
When solving a multi source/sink max flow problem, the classic reduction to the single source/sink problem is to add a new source and sink node with infinite capacities that connect to/from the existing source/sink nodes.
I was curious about an alternate reduction. It is kind of silly buy I just wanted to sanity check ... |
First post here so hope I'm not missing too many guidelines.
I've had this idea for a few weeks now and I can't myself see where I'm going wrong with it, hope it makes some sense to you and thanks in advance for the help.
Here we go:
Assuming we could solve a NP-complete problem in logn SPACE, e.g. TSP. Then by reachab... |
There is an exercise which says : Al and Bob are arguing about their algorithms. Al claims his $O(n \log n)$-time method is always faster than Bob’s $O(n^2)$-time method. To settle the issue, they perform a set of experiments. To Al’s dismay, they find that if $n<100$, the $O(n^2)$-time algorithm runs faster, and only... |
In the Wikipedia's Binary search tree, one can read
Traversal requires $O(n)$ time, since it must visit every node.
Since it is question of a lower bound, shouldn't we write
Traversal requires $\Omega$(n) time, since it must visit every node.
Is the $O(n)$ statement here even correct?
|
Before you downvote, please note that this question is distinct from this similar looking question
I came across the following the problem in "The Introduction to Algorithms" by Cormen et. al.
Show that for any two functions $f(n)$ and $g(n)$ that are asymptotically non negative, either $f(n) = O(g(n))$ or $f(n) = \ove... |
Here is the definition of Blum's Speed-Up theorem.
Blum's Speed-Up Theorem. There is a decidable language A such that for every TM $M$ that decides A with running time $u(n)$, there is another TM $M'$ that decides A much faster with running time satisfies $r(u(n))$ such that $r(u(n)) \leq u(n)$ for any computable func... |
Given $n$ dots on a plane, such as: n couples ($x_i$,$y_i$)
I would like to find a line parallel to y-axis ( $x=b$ ), such that the sum of all of the point's distances from that line will be minimal
In order to do that, I need to write an alogrithem with a linear run-time ( $O(n)$ )
MY METHOD I relate only for the $x$... |
Problem
We are given 2 arrays a and b both of length n. We build a third array c by rearranging the values in b. The goal is to find the optimal c that maximizes
result = (a[0] ^ c[0]) & (a[1] ^ c[1]) & ... & (a[n - 1] ^ c[n - 1])
where ^ is XOR and & is AND.
Is it possible to do this efficiently? It's straightforward... |
We know that Hamiltonian path, clique and independent sets are NP-complete but what about half or the square root of each problem or a fraction of $n$ ? That is, for a graph, $G$ of $n$ nodes,
is there a Hamiltonian path of size $\frac{n}{2}$ or of $\sqrt{n}$ or any number of nodes less than $n$?
is there an independe... |
I am trying to determine if a given solution is a basic feasible solution. I am working with an $n-$dimension polyhedron $P$ defined by a set of $M$ inequalities $Ax \leq B$. I am running into an issue where I am not sure how to determine if a solution is basic feasible or degenerate. Working off of the following defin... |
I have some questions that I don't understand about time complexity.
Given that the worst case complexity of the algorithm $A$ is $O(f(n))$ and the best case
complexity of $A$ is $Ω(g(n))$. It follows that $f(n) ∈ Ω(g(n))$.
Given that the best case complexity of the algorithm $A$ is $O(f(n))$ and the worst case
comple... |
Problem: Given a graph G with positive integral weights on nodes as well as edges, find an induced subgraph H with maximum total weight per node, i.e., the goal is to maximize
$$
\frac{ \sum_{e \in H}w(e) + \sum_{v \in H} w(v) }{|V(H)|}.$$
If you allow negative weights, then it is NP-hard (easy reduction from Clique). ... |
An observation when defining List in agda with --without-K enabled:
The following parameterized inductive definition is accepted:
data List (A : Set) : Set where
[] : List A
_::_ : A → List A → List A
but not the equivalent inductive family definition:
data List' : Set → Set where
[]' : {A : Set} → List'... |
Consider the following new operation for disjoint sets
PRINT(x): print every element in S_x the set containing x
One Approach that I found but couldn't figure out completely :
In addition to tree we store a linked list. And each node in the tree in addition to the element
the tree nodes also stores the pointer to elem... |
Find all values of $ x ∈ R $ such that x + 1 = 1 in floating point arithmetic with 3 bits mantissa.
How do we represent number 1 in floating point arithmetic with 3 bits mantissa I wonder? After that, I think we can subtract 1 on both side? I am a little confused about representations of numbers in floating point arith... |
$a)$ Determine for all pairs $i$ and $j$, $i,j ∈ \{1, \ldots, 6\}$ whether for the ones given below functions $f_i ∈ O(f_j)$ or $f_i ∈ o(f_j)$ or neither of the two applies as $n → \infty$:
$f_1 = \log(n),$
$f_2 = \log(\sqrt n),$
$f_3 = \log(n + \log(n)),$
$f_4 = \sqrt{\log(n)},$
$f_5 = \log\log(n^{\log(n)}),$
$f_6 = \... |
I am looking at this algorithm in CLRS page 26:
I am a novice when it comes to these things so please make your explanations as simple as possible.
For the cost column, does c1, c2, c4, etc denote a value the same way n does, or are they just labels? My understanding is an operation takes one time unit (such as j=2 is... |
A binary search tree is constructed by inserting the following value sequentially:
$$3, 9, 1, 6, 8, 7, 10, 4, 2, 5$$
Let $p_v$ be the probability to search for the value $v$ in the binary search tree (for $1\leq v\leq10)$.
$p_v = \frac{1}{25}$ if $v$ is an even number and $p_v = \frac{1}{10}$ if $v$ is an odd number. ... |
I would like to know how different defintions of class DP (also written $D^p$) are equivalent (brief explanations would do). The following are the two definitions I see:
Difference between two NP problems; i.e., DP $:=\{A\setminus B\ :\ A,B\in NP\}$.
$\{L_1\cap L_2\ :\ L_1\in \text{NP},\ L_2\in \text{co-NP} \}$.
Com... |
Consider the language
$$
\{ w \in \{0,1\}^* : \#_0(w) \ge \#_1(w) \}
$$
consisting of all words over $\{0,1\}$ in which the number of zeroes is at least twice the number of ones.
Is this regular, context-free, Turing decidable?
My Idea
It's not regular, because we need to track the number of zeros and so it cannot be d... |
Let the alphabet be $\{0\}$. I have to prove that not all languages over this alphabet are regular, using some countability argument.
My Ideas:
The set of all languages over $\{0\}$ is uncountable. This can be proved with the diagonalization argument. So to prove the statement, I have to show that set of all regular la... |
We recently learned Bellman-Ford algorithm for shortest path in class, but I didn't understand it.
Can you give me intuition for why the algorithm works? And can you please explain why it is correct? Why are we sure to find negative circles?
Also, we learned the following two lemmas:
Lemma (upper bound property): At a... |
I have found this exercise and I cannot solve it:
In $X=\mathbb R^2$, let's observe two models $H_1$ (rectangle with sides parallel to the coordinate axes) and $H_2$ (lines). We define a model $H_3$ such that every hypothesis is a combination of one hypothesis from $H_1$ and one from $H_2$.
Prove or disprove that the ... |
I am pretty new with data science and Machine Learning. I am learning form one textbook and I found this task. I have no Idea from where to start and what relation could be. Any help would be great.
Suppose we want to learn the Boolean functions in instance space
$X=\{0,1\}^3$. We are given two models to examine: $H_1... |
I have trained two binary decision tree classifiers with splits in $\mathbb{R}^4$. Same data, but from two different patches. Now, I want to find the exact intervals where the two trees disagree.
The splits are along the lines of:
\begin{align*}
& (x_1 > 0.35592521727085114) \wedge (x_3 \leq-0.13628841191530228) \imp... |
Prove that the following grammar is unambiguous:
$$X \to aX | Y$$
$$Y \to Yab | b$$
I know that I must prove that the strings produced by this grammar have only one parse tree, but how can I do this?
|
I was looking at this course but I cannot seem to understand what is meant by the term "single-threaded kernel".
Does it mean that:
only a single kernel thread is made available by the OS?
only a single kernel thread can be executed at one time?
or is there some other interpretation?
|
For the following language, write grammar independent of the text.
$$\{a^i b^j: j < 2i \text{ and } j \ne i \} $$
I want a hint to start solving this problem. Where should I start?
|
What is the grammar for $$\{ (n_a(w) - n_b(w)) mod\ 3 = 2 \} $$
please guide me with this. I tried to draw DFA to find grammar but I can't.
any help is much appreciated.
|
Let MOD-INVERSE consist of all pairs $\langle N,c \rangle$ such that $c$ has an inverse modulo $N$.
Let VERTEX-COVER consist of all pairs $\langle G,k \rangle$ such that $G$ is an undirected graph with a vertex cover of size $k$.
Prove that if VERTEX-COVER reduces to MOD-INVERSE then P=NP**.
My Thoughts :
$\langle N,... |
The original question I am answering:
Can you use SAT solvers to solve problems complete in $\Sigma_2^P,\Pi_2^P,\Delta_2^P$?
My first thought:
Venn Diagrams show that the PH encloses NP, but does not equal NP. Therefore, there should be some problems that cannot be solvable using SAT?
My second thought:
To be able... |
I am confused from these 2 true-false questions on the max flow and am seeking clarity on the basics.
If in a network we increase the capacity of an edge in the minimum cut, the maximum
flow gets increased.
If in a network we decrease the capacity of an edge in a minimum cut, the maximum
flow gets decreased.
My thoug... |
What is the algorithm to check if two DFA are disjoint? I want to know if there exist any string accepted by both automata.
|
Here is the video in question:https://www.youtube.com/watch?v=BpiMRyWoDu0&t=131s
F(n) and g(n) are both equal to each other since they both have a time complexity of n^2
What's the point of applying the constant c to g(n) to make it 2n^2? What is this trying to show us?
Additionally, why does the inequality include 'e... |
Let the alphabet be {0,1}. Is it true that for every language over this alphabet at least
one of L and L_complement is Turing-recognizable
|
In the paper linked below by Knuth and Bendix, theorem 1:
The set of all pure words is well-ordered by the relation '$>$'
has a proof that I can't seem to follow despite staring at it all day. I can't even decipher what the notation is trying to represent.
So, we have four fixed sequences:
An infinite sequence of va... |
This is what I counted but I know I'm wrong since my conclusion is not in the choices:
t = time unit
s = space unit
y=1 : 1t & 1s
for 0 <= i <= N : Nt & 1s
y=y*i : 2 reads, 1 write, 1 multiplication therefore 4 time units,
the for loop is thus 4N time units
total time = 4N+1
total space = 2 (because there are only tw... |
There is this problem about pipelining that does not have an answer, and I'm wondering what the answer could be:
In the five stage pipeline with forwarding support to EX, the first operand of ALU comes from 3-to-1 input multiplexer. As the memory latency increases, MEM stage now takes 2 cycles (from 1
cycle) To adjus... |
After thinking for a bit, I am not able to prove a double inclusion proof for the following problem. It seems very interesting to me.
Consider the regular expression $r= ((1(00)^∗1 + 0)1)^∗$ and the right-linear grammar $G= (\{S,A\},\{0,1\},S,P)$, where $P$ consists of the following rules:
$S\rightarrow 1A|01S|\lambda... |
I've been searching around google and this site and I haven't been able to find the answer to this. How are algebraic structures (like a set and its elements, groups, rings, etc.) defined in code (in any language)? Like, if I wanted to "do things" with an arbitrary ring, how would I go about constructing that ring?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.