instruction stringlengths 35 29.1k |
|---|
We want to represent a list of $n$ unique integers between $0$ and $n-1$ in a memory-efficient way. The only operation we need to support is looking up the $n\text{-th}$ element.
What are some of the most compact data structures that can do the lookup in $O(1)$ or $O(\log n)$?
Naive example: an array of $\log n$-bit i... |
Consider the following pseudo-code:
counter = 0
for (k = 16; k > 0; k /= 2)
for (j = 0; j < k; j++)
counter++
I get that the time complexity is $O(n)$ when I examine the code, but I do have a question regarding the formal complexity analysis:
$$\begin{align}
T(n) &= \sum_{i=1}^{\lceil \log_2 n \rceil} \sum... |
Okay so I have implemented quicksort with insertion, where K is a value until which the recursion occurs and then rest of the array is sorted using insertion sort. Now I am comaparing 3 different algorithims for sorting (quick , merge and quicKInsert). My question is is there a scenario where quickInsert out performs q... |
I've a task to specify a finite automata (of any kind) that accepts the language described by this regular expression: $a(bab)^+b^*|(ab)^*(aa)^+$
My first solution looks like this:
I would like to know if I'm reading this expression correctly:
First we have $a$ and since sequence $(bab)^+$ has to occur at least once ... |
I have some questions about how a string can be divided into pieces according to the pumping lemma. I am learning from Michael Sipser’s book Introduction to the Theory of Computation, 3rd Edition. He states the pumping lemma as follows.
Pumping lemma If $A$ is a regular language, then there is a number $p$ (the pumpin... |
I think that the following problem is NP-Complete but I don't have any idea of how doing the reduction.
Input: A propositional formula $\varphi$ and a number $k$.
Output: Yes if exists an valuation $\sigma$ that satisfies the formula $\varphi$ and the hamming weight of $\sigma$ is $k$ ( Exactly k propositional variable... |
I have seen two variants of the BST remove algorithm in the case where the node to be removed has both children.
Variant 1:
Replace the node with the right-most child in the left subtree
Variant 2:
Replace the node with the left-most child in the right subtree
Is there a way to establish theoretically that the two oper... |
I have a DCG that I want to lay out with the parents on the left and children to the right. I want to maximise the number of all children present to the right of all parents whilst minimising the number of children present to their left of one of their "ancestors".
The specific graph in question is the Foresight Obesi... |
My problem base on the josephus problem, I want to print the position of killed people one by one in order.
People are standing in a circle waiting to be executed. Counting begins at a specified point in the circle and proceeds around the circle in a specified direction. After a specified number of people are skipped,... |
Does the following work and is there anything possibly simpler?
Let $X = (Q, \Sigma, \delta, s, F)$ be a DFA for $A$.
Intuitively, we want to "remember" (or guess) two states $p$ and $q$ such that $s \stackrel{z}{\longrightarrow^{\ast}} p \stackrel{y}{\longrightarrow^{\ast}} q \stackrel{x}{\longrightarrow^{\ast}} f$ wh... |
Is a circular linked list just a nice programming exercise, or does it have any real world applications? I am unable to find much information on this topic, and any help would be appreciated.
|
I've recently been learning about interrupt vectors, partly from this Wikipedia page.
I've understood that different processors will have different types of interrupts, and the interrupt vector table stores the information about where code evaluation should move to when each type of interrupt occurs. As far as I'm awar... |
$Human ⊓ ¬Female ⊓ (∃married.Doctor) ⊓ (∀hasChild.(Doctor ⊔ Professor))$
Here, $∃married.Doctor$ means if there exists an individual who is married to Bob belongs to $Doctor$ concept.
But my confusion is what if I use $∀$ instead of $∃$ will this mean:
Bob is married to individuals all of them belongs to $Doctor$ co... |
The standard Turing Machine (TM) can only move left and right.
When I simulate a TM whose head may remain stationary and I execute the stationary move, then I need to make two steps with the standard TM: go left and then right. So does this mean I need twice the amount of steps and I need twice the amount of states?
|
I'm very confused as to if a+ and a⁺ mean the same thing or are completely different.
|
I saw this question on my college "Design of Algorithms" exam but I could not solve it:
Given an array $A[1..n]$ of integers. find an element which is repeated at least $\frac{n}{2}$ times using Divide and Conquer algorithm in $O(n\log{n})$ if such element exists.
Correctness of the algorithm must be proven.
I wonder ... |
An array of students age is given : $ A = \{ A_1,A_2, ..., A_n \} $. Form maximum number of teams such that the sum of age for each team is more than 18. Note that each team consists of only 2 people.
I came across this question in an algorithm book without any answer.
My attempt :
Sort A in ascending order. Calculate ... |
How would I create a polytime mapping reduction to prove A ≤p A for any language A.
I was thinking to assume A is in P to start.
For every : ∈ iff ()∈.
But I am not sure what to do from there, any advice? I don't get how to show that you can polytime reduce a function to itself, because if you assume A has a Turing mac... |
Please check my proof where I use the pumping lemma to show that the language $B=\{0^n1^n | n≥0\}$ is not regular.
I'll state the pumping lemma here for clarity:
Pumping lemma If $A$ is a regular language, then there is a number $p$ (the pumping length) where if $s$ is any string in $A$ of length at least
$p$, then $s... |
I am unsure if given $A \leqslant_p B$, does that imply that $A \leqslant_T B$.
If we can polytime reduce $A$ to $B$, that would imply there is a decider for $A$ that runs in polynomial time which can be mapped to the decider for $B$, meaning we would halt on any input that is run on the decider for $B$.
|
I am trying to learn about GoBackN and Selective Repeat ARQ. And I have the following practice question:
Consider sender A and receiver B which communicate using an ARQ
protocol. The current window at A is [12, 18] and A receives ACK 16
from B.
a. What is the new window of A when A and B implement Go Back N ARQ?
Provi... |
I'm brand new to LTL and working on becoming better with LTL formulae. I've got two examples where I am unsure whether my LTL formula is correct.
I'm given the sentences, and my assumption is that $l$ is true:
$l$ is always false after $m$
LTL Translation: $G(m \to G(\neg l))$ i.e on all paths m implies on all paths... |
Is it possible for a pair of languages where A ≤T B but not A ≤p B?
I am not sure if this could be the case since a turning reduction would imply we can use a decider for one language to decide another.
|
In " Gödel, Escher, Bach" Hofstadter introduces the programming languages Bloop and Floop. Relevant here is mostly that Floop is Turing complete, while Bloop differs from Floop in one aspect: all loops must be bounded. So only for-loops, no while-loops.
Hofstadter shows that not all computable functions are computable ... |
I an new to image processing and I have some questions I want to understand:
What is the meaning of the imaginary and real part of the 2d fourier transform?
What can it tell me about the image it transformed from?
For example, what can I tell about an image that its fourier transform omaginary part is always 0? and its... |
Given a sequence/string of values and an algorithm that can process said sequence in both directions and obtain the same result - does it follow that the problem can in fact be decomposed in a divide-and-conquer sort of manner?
The sum of a sequence of numbers can be computed sequentially both from left to right and fr... |
I am trying to construct an algorithm to reduce OR, AND and NOT gates into NAND-SAT. Can someone give me a hint as to where to start?
|
It's generally considered to be the case that there are sixteen possible logical operations between two N-bit numbers and four possible logical operations on one N-bit number. I'd like to know how many possible arithmetic operations there are between two N-bit numbers. I'm asking in the context of ALU design, so I thin... |
I have encountered this problem many times. In an undirected graph, you need to get all the nodes/one node that is k distance away from the given source node (src). Given that the edge-weight is 1 for all the edges, the graph can have cycles.
constraints:
1<=N<=1e5
0 <= M <=N
1<=k<=1e9
1<=src<=N
where,
N = total numbe... |
The answer is
$1^*01^*01^*+1^*(0+00+\in)1^*$
If I had to rephrase my question, it would be how to approach regular expression problems? Is it all about practice?
How do I understand what the regular expression is doing just like in this case here.
I think I can create DFA for this, but not sure if that would help me to... |
What are the language accepted by this DFA?
The truth table of OR-:
But I am unable to deduct what this dfa will accept?
Say-:
P=at least 1 a
Q=at least 1 b
So DFA should accept both ab. Or in another case it could accept a and in another case it could accept b? Is this the interpretation?
|
It is well-known that the theory of (first-order) real arithmetic, $\mathcal{T}_{\mathbb{R}}$, is decidable, both on its linear and non-linear (a.k.a field) fragments, since Tarski-Seindenberg proved real closed fields are decidable.
We know this is not so with the theory of non-linear rational arithmetic, $\mathcal{T}... |
In this Wikipedia article on Average-case complexity there is the text:
For example, many sorting algorithms which utilize randomness, such as Quicksort, have a worst-case running time of $O(n^2)$, but an average-case running time of $O(n \log(n))$, where n is the length of the input to be sorted.
My question is abou... |
https://fabiensanglard.net/floating_point_visually_explained/
I was reading this article where the exponent and the mantissa are explained as the window and offset respectively. As the gap between powers of 2 increases, the granularity of the incremental steps that the offset offers will decrease. Is this an intentiona... |
I ran across this proof from the following paper: Finding and Counting Given Length Cycles
But I do not understand the third line.
There are at most $ \vartriangle \cdot E $ such paths and they can be found in $O(\vartriangle \cdot E)$ time.
Why is that?
|
From the link Solving SAT by converting to disjunctive normal form, I learnt that the algorithm to transform any boolean formula to disjunctive form takes exponential time in worst case.
But I have a question that for unsatisfiable boolean formulas, does it also take exponential time to transform them into disjunctive ... |
Is it possible that a problem is both W[1]-hard and Para-NP-hard?
|
I'm looking at decidable fragments of first-order logic. It seems that FO(1), i.e. the one-variable fragment of first-order logic is equivalent to the modal logic S5. However, I cannot find a reference (everybody references a German article of 1933 which I cannot understand).
So I'm trying to understand what can be don... |
A problem is solvable in polynomial by a deterministic turing machine, and no solution exists which benefits from parallelism.
Will it be P or P-Complete or NP or NP-Complete?
|
I have a set of $N$ points randomly positionned on a rectangular space (btw with either absorbing, reflecting or wrapping boundaries), and I need to obtain the distances between every 2 points whose distance is at most $2\,r$.
This is akin to consider every point as a disk with radius $r$ and only consider distances be... |
When copying ~80Gb data from one USB 3.2 stick to another, i noticed that the GUI of the transfer speed had clear periodicity. Out of curiosity, what could be the reason for this? No other active programs were running that, to my awareness, should put a periodic load on the system.
|
Say I need to prove that
$L=${$a^n b^n c^n; n\geq 1$} is not context free language
I take n=3.
w=aaabbbccc
Here |w|=9.
we know by pumping lemma-:
|vxy| $\leq$n so vxy=abb
|vy| $\geq$1 so vy=ab
Hence I suppose-:
u=aa
v=a
x=b
y=b
z=bccc
So
$u v^i x y^i z$
=aaaabbbbccc
Hence it is not in L so L is not regular.
But this lo... |
According to the Wikipedia page on P-complete,
a decision problem is P-complete (complete for the complexity class P) if it is in P and every problem in P can be reduced to it by an appropriate reduction. [...] Generically, reductions weaker than polynomial-time reductions are used, since all languages in P are P-Comp... |
I am trying to figure out what the constructor and eliminator would look like for a type representing "sorted list"?
|
Sorry for the shoddy formatting in the title, here's something clearer:
Given the hypercube Q3 of 8 vertices, what is x + 10y where x is the minimum vertex cover set size and y is the maximum independent set size?
I know that a hypercube Qd is just a graph with 2d vertices consisting of binary strings of length d, and ... |
As far as I understand, the Gaussian Mechanism uses the sensitivity of the input function to determine the right amount of noise. In DP-SGD, said input function is taking the gradient and clipping it to some norm C. Then the Gaussian Mechanism is used with C as the noise-determining parameter. this should mean the sens... |
I'm reading the book Advanced Algorithms and Data Structures. It makes the claim that the optimal branching factor $D$ for a heap satisfies $2 \le D \le 5$, and that it is most likely $3$ or $4$ depending on the data being stored.
There is no citation in that book, so I tried to find one. On Wikipedia's D-ary Heap page... |
I want to understand how is this proof working.
What I know:
Pumping lemma for regular language-:
Let $L$ be regular language. Then there exists a constant $n$ which depends on $L$ such that for every string $w \in L$ with $|w|\geq n$ and $w=xyz$ such that-:
$y\neq \epsilon$
$|xy| \leq n$
For all $i \geq 0$, $xy^iz ... |
I am looking for a reference to a solution of the multivariate piecewise linear interpolation. I am not quite sure how to generalize a well-known dynamic programming Segmented Least Squares algorithm.
The exact version I'd like is this. Let B be a box $[1,a_1]\times[1,a_2]\times ... \times[1,a_k]\subset\mathbb{Z}^k$, a... |
I have an algorithm problem which I do not know how to solve and I think it is NP-complete. Let me try to explain with a general example.
Given $n$ objects, each with $k$ possible properties, oversample (with replacement) among the $n$ objects to achieve a desired proportion of objects with specific properties and samp... |
Suppose you are given a list of vertices (with known positions) and their respective degrees, find any set of non-intersecting edges that satisfies the vertex degrees. Or, in other words, connect the dots in a way that each one has the specified number of connections. It's not necessary to find all solutions, the first... |
Here is the description of question
A bracket is considered to be any one of the following characters: (, ), {, }, [ or ]. Now two brackets are considered to be a matched pair if the an opening bracket e.g. (, [, or { occurs to the left of a closing bracket e.g. ), ] or } of the exact same type. There are three types o... |
Besides basic instructions for a general-purpose computer (binary arithmetic, move instruction, and jump on condition), it seems you can't implement a universal turing machine (is that even the right term?) without something more. That something is the ability to do arbitrary levels of function calls, I believe, yet h... |
I've been reading a little about decompilers, and I think I get the general idea. I understand that I could start with either assembly or machine code, and then I'd have a decompiler which would target a specific high level language. In general high level code is far from being one-to-one with compiled output in assemb... |
The question is-:
THIS is the transition table for NFA-:
Final result as shown in youtube video.
https://www.youtube.com/watch?v=GjLiXk0imi0&list=PLENQMW_c1dimRCKF3bjUqHaH8dvJkapSw&index=49
My question-:
What are the final states of this nfa?
I think q0, q1 and q2 all are final states. Because $\in$ closure of q0,q1... |
Source of this question and problem:
https://www.javatpoint.com/automata-conversion-from-nfa-with-null-to-dfa
This is the question:
So in this figure there are my 1 confusion-:
Don't we need a empty set like this-:
Source: https://www.youtube.com/watch?v=dmvJp5EgOek&list=PLENQMW_c1dimRCKF3bjUqHaH8dvJkapSw&index=48... |
This question is mainly about the clarification of the terminology BB(n), not how busy beavers work. It seems common to refer to busy beaver numbers like BB(2) assuming 2 is the number of states. Do we also assume 2 input symbols? Further, is the result of BB(2) referring to the count of ones printed or the count of st... |
I worked a bit on this and got this-:
S->ABC
A->aA/a
B->bB/b
C->cC/c
The obvious problem here is I am unable to count number of a's and c's which should be equal. How do I create a cfg that can count a and c's and make them equal? Please guide.
If this was $a^i b^i c^j$ I could make a cfg.
|
Suppose we have $k$ $n\times n$ matrices $A,B,C,\ldots$. Is there a way to compute/approximate the trace of their product much faster than computing/approximating the full matrix product? IE, computing
$$\text{tr}(ABC\ldots)$$
A related problem of computing vector matrix product $v'ABC$ can be done in $O(n^2)$ time by ... |
I know that each character ("in the macro level") is comprised of at least two bits ("in the micro level").
But are these bits of this "micro, electrical-logical level" have been considered "characters" by themselves anywhere in the literature and would it make any sense to define them as such?
|
If you need some context-: https://www.andrew.cmu.edu/user/ko/pdfs/lecture-11.pdf around page 7.
Case 1-: Say vxy contains ab
So when I pump v and y, what will get pumped? And how the result would be. I can understand the case for when vxy is all a's, all b's or all c's.
Case 2-: Say vxy contains bc
When I pump v and ... |
Theorem: Prove every number in double precision 32-bit floating-point format can be represented in double precision 64-bit floating point-format.
64-bit format:
Attempt: Let $ b = b_0 ,...,b_{31} $ be a binary string of 32 bits.
Define a binary string of 64-bits $ a = a_0,...,a_{63} $ as follows:
$ a_0 = b_0 $, $ ~~~~... |
We defined the diagonal language as follows in the lecture:
\begin{align*}
L_{\text{diag}}=\left\{w \in \left\{0, 1\right\} ^{*}\mid w=w_{i} \text{ for some }i \in \mathbb{N} \text{ and }M_{i} \text{
does not accept }w_{i}\right\}
.\end{align*}
Here, $w_i$ is the $i$-th word in canonical order and $M_i$ is the $i$th ... |
I have run into a little problem that I have been pondering about, and can't figure out a good solution for.
Let's say that I have a set of numbers like this one:
[1, 2, 3, 4, 6, 9, 8, 12, 5, 10, 15, 18, 7, 14, 21, 16, 24, 27, 20, 30, 11, 22,25, 33, 36, 13, 26, 39, 28, 42, 45, 32, 48, 50]
I then get a number n, which ... |
In general, how can I verify that my many-one reduction is a LogSpace reduction? E.g. I was looking at the proof of HORN-SAT is P-complete via logspace reduction.
It would be ok even if someone makes me a simple example of LogSpace reduction clearly explaining why it is LogSpace and not polynomial.
Many thanks.
|
Given: Set $N = \{0, \ldots, n-1\}, k \in \mathbb{N}, d_{ij} \geq 0$ with $d_{ii} = 0$.
Task: Find subset $C \subseteq N, |C| \leq k$ that minimizes $\max_{i \in N} \min_{j \in C} d_{ij}$.
Idea: I define $x_i$ with $x_i = 1$ if $i \in C$ and zero otherwise, constrained by $\sum_{i \in N} x_i \leq k$.
Now I want to defi... |
Let $S$ be a set of partial preorders over a set $U$
($\le$ is a preorder/quasiorder if $\forall x,y,z\in U$, $x\le x$ and $x \le y \land y \le z \implies x \le z$).
We say that a partial preorder represents a total preorder if the former is contained in the latter [1].
We say that a set of partial preorders covers a t... |
I've been scratching my head with this one for a few hours now, but am feeling to stupid to comprehend how it is to be done. I can't understand the way even the state table should be built for this one. From where should I start?
|
Consider a $2^n \times 2^n$ Walsh-Hadamard matrix (via Sylvester's construction). Fix a set $S \subset [2^n]$ of $k\leq 2^{n-1}$ columns.
Consider the rows in the $2^n \times k$ submatrix $H'$ that's obtained by dropping all columns not in $S$. Then we have $2^n$ many $k$-long row vectors. Consider the equivalence rela... |
When I compute the the eigenvalues of the matrix $$\begin{bmatrix}x^3& 2 + x^3& 3 - 2 x^3\\ 2 + x^3& 4 - 5 x^3& 5 + 3 x^3\\ 3 - 2 x^3& 5 + 3 x^3& x^3\end{bmatrix}$$ using WolframAlpha, I get the following first eigenvalue (copied from WolframAlpha):
λ_1 = 1/3 (4 - 3 x^3) + 1/3 (-432 x^9 - 1449 x^6 + 810 x^3 + 3 sqrt(3)... |
I have a few board games where in each round one can do a set of action. Depending on the previous actions, the set of possible actions is different. Usually after a fixed amount of rounds, the game is finished and one computes the total number of points.
One such game is Nidavellir (draft blog post), where one plays e... |
Basically the title. I am supposed to find a regular grammar for the language that produces palindromes. This is all I have right now:
S -> 1 | 0 | ε
Since it should be a regular grammar, I can't write 0S0 or 1S1. But then I don't know how I should even continue with this...
|
In the definition of the class $\mathcal{BQP}$ found in textbooks we (as the circuit builders) have access to an unlimited number of deterministic zero-initialized qubits and to a finite set of quantum gets (it turns out that some sets of gates are universal). I'm struggling to make the definition of $\mathcal{BQP}$ in... |
I want to prove that for every positive polynomial $p(n)$ and any negligible function $negl(n)$ the product $negl(n)p(n)$ is also negligible.
This is what I tried so far:
$\forall n>n_0:negl(n)<1/k(n),k=$any positive polynomial.
$\Rightarrow p(n)negl(n)<p(n)1/z(n) $ With $z(n)=p(n)k(n)$
$\Rightarrow p(n)negl(n)<p(n)1/z... |
Yesterday I started reading "An Introduction To The Analysis of Algorithms" by Sedgewick/Flajolet. For me it was not clear what he meant with "theory of algorithms" and the "scientific approach". I googled a bit and found someone who had the same question:
Sedgewick analysis of algorithm, difference between theory of a... |
Is there an easy/intuitive way to understand why the algorithm for transforming an infix expression to a postfix expression using a stack works?
|
I'm a bit confused by the role of the empty string in this ambiguous grammar:
A' -> A
A -> if A B
A -> null
B -> [empty string]
B -> else S
So what does B -> empty string mean/do? Does that mean B could transition to A? And "if", "else", and "null are terminals, then what is the empty string?
|
Suppose given an array $A[1..n]$ that contains $k$ distinct element, why the lower bound for sorting of this instance is $\Omega(n\log k)$?
I think according the decision tree the lower bound is
$$log \frac{n!}{(n-k)!}.$$ But I can't achive $\Omega(n\log k)$.
|
I have an $n\times n$ matrix, and want to find a bijective function $h:[n^2] \to [n]\times [n]$ that can act as a hash function to map the numbers 1 through $n^2$ to row/column indices in my matrix. The additional property I'm looking for is that any two close input values should map to matrix indices that are far apar... |
I've done my due dilligence and tried to answer this question using every resource I could get. KhanAcademy, NesoAcademy, and Rosen's Discrete Mathematics book. I still can't wrap my head around it. Here is how I answered it:
Let x be things you did to me.
Let y be you making me happy.
Let P(x,y) be the thing you did t... |
I have read that NAND gate and NOR gate are called universal gates... but i cannot find a rigorous proof that any circuit can be designed by these two gates only.
|
Let's say we have a set of n integers. I'm trying to find a way to partition this set into m subsets (empty subsets are not allowed), so that the maximum subset-sum gets minimized. for example, let's say we have the following set and m = 2:
{11, 5, 11, 5, 10}
the optimal partitioning will be as follows:
{5, 5, 11}, {10... |
Given algebraic expression in a string, I want to split it into a list of operations for building a parallel binary tree. For example, I'm trying to convert expression such as:
(a+b+c+d)/(e*f)
or same expression in postfix notation:
ab+c+d+ef*/
into a list of
Expr1 = 'a+b'
Expr2 = 'c+d'
Expr3 = 'e*f'
Expr4 = 'E... |
I am working with a shortened version of $[n,k,d]$ Reed-Solomon code. I am encoding a message of size $k−l$ which gives a shortened code of size $n−l$ (this is equivalent to encoding the same message appended with $l$ $0s$). While decoding, I am following the Patterson algorithm, i.e. find $(n−k)$ syndromes, construct ... |
Calling all math buffs! ;)
A Turing machine has two states - one accepting and one non-accepting. Furthermore, the Turing machine cannot overwrite blank symbols. (Note: It's assumed that the blank symbol surrounds the input on the band and isn't itself part of any input string)
Show that the given Turing machine can on... |
Suppose given a weighted directed graph $G=(V,E)$.
We want, for each $v\in V$ find a path $P$ from other vertices to $v$ such that weight of $P$ is minimzed.
I can solve this by running Johnson's algorithm on $G$ and doing a linear traverse of matrix to find out for each $v$ minimum weight shortest path from other to $... |
I came across this question in my Theory of Computation class recently:
Consider a regular language $L$, and define $X = \{x:xxx\in L\}$. Is this language regular?
I believe that it is regular, and that the procedure required to construct an NFA for it is not particularly different from constructing one for $W=\{x:xx... |
I'm trying to make a huffman tree based off of some words. I have the frequencies of each character stored using a hashtable, but i need to then make a minheap structure in order to then be able to make the huffman tree. What I don't get is how I am supposed to actually use the minheap because I don't understand how I ... |
I'm trying to figure out all elements of a symmetry group for the acyclic oriented $L$-cube. I do have an algorithm, but its complexity is not suitable for larger $L$. I computed $L=5$ on my old Laptop (took 30min, non-optimized code, single thread). I can imagine $L=6, 7$ or maybe $L=8$ is possible, higher once certai... |
I am struggling with the following remark from lecture:
Suppose the Polynomial Hierarchy collapses at the $i$-th level, i.e. $\Sigma_i^P = \Sigma_{i+1}^P$. Then for all $k \ge i$ holds $\Sigma_k^P = \Sigma_{k+1}^P$.
The only similar relation I know of is $\Sigma_i^P \subseteq \Pi_{i+1}^P \subseteq \Sigma_{i+2}^P$ hol... |
In the image, the language of the TM is defined on (a, b, c, d) and there is no transition on final state, but strings consisting of d are also part of the language.
In all TM problems I have seen until now, all transitions not defined are considered to go to the rejecting state (qrej.).
So in this TM also any transiti... |
I created a 2x2 2D-array of 0's as follows:
sizes=[[0]*2]*2
sizes
[[0, 0], [0, 0]]
I want to change the second element of the first row to 1. I do this as follows:
sizes[0][1]=1
Unfortunately, the second element of the second row also changes to 1.
sizes
[[0, 1], [0, 1]]
Why does this happen?
|
I'm studying Autoamta Theory currently and am wondering if any Language (for example Lanugage L in Alphabet A={a,b}) can be expressed by regular expression.
In my current understanding the rule is "L is acceptable by Automaton <=> L is rational"
But does that automatically mean that for every regular L there is also a ... |
Let $T$ be an infinite countable labelled transition system with the shape of a tree and let $\sim$ be its similarity relation among nodes. Note that the alphabet of the labels is finite (hence the tree has finite branching). Let $T/\sim$ be its quotient w.r.t. the similarity relation, i.e. two nodes in $T$ are identif... |
I'm new to network flows and I'm reading this topic from Cormen's Algorithms book (3rd edition) from 26 chapter. I came across this problem from the 26.1 section
Suppose that, in addition to edge capacities, a flow network has
vertex capacities. That is each vertex has a limit $l$ on how much
flow can pass though . S... |
Confused with this proof. I will point my confusions here.
what is R(M)? They say it is representation of turing machine but what is it exactly? Is it tuples of turing machine? How do we decide w is input here? Because later when doing R(M)*R(M) we call R(M) as input.
how can we just assume that H'-:
when M halts wit... |
Are there any FNP-complete problems where there's only one possible solution?
For example, the travelling salesman problem can have multiple routes all shorter than $X$. There's only one shortest route, but it can't be validated that a given route is the shortest route in polynomial time.
I'm interested in either such ... |
I have a graph $G=\left(V , E\right)$ and source $s$ and target $t$.
I also have a weight function $w: V\rightarrow \mathbb{R^+}^k$, meaning a vertex given $k$ non negative weights.
There is an upper bound vector $C \in \mathbb{R^+}^k$.
The problem definition is to find a path from $s$ to $t$ such that it is not too he... |
I've been wondering about this problem for a while:
Say we have L = { <M>, n | M has to halt for at least n Inputs}
and multitapes are simulating various inputs bla bla
How do I count how many Simulations came to a halt?
My guess was to have another tape that has e.g. n zeros as Input and whenever a Simulation comes to... |
I am aware that 2SAT is polynomial while 3SAT is not, but I am looking for an intuition why its so. After all, even in 2SAT we can attempt all possible truth functions and its $2^n$. So I am hoping not for a formal proof, but for intuition or explanations that distinguishes the language from 3SAT?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.