instruction stringlengths 35 29.1k |
|---|
I have been trying to understand the use of circuit models for boolean functions, and came across this question, that I am trying to struggle to understand:
Show that if a function $f\colon \{0,1\}^n→\{0,1\}$ has a support of size $k$, then it can be decided by a circuit of size $O(nk)$.
I understand that for any binar... |
How do I prove that the predicate $P(x , y)$ is primitive recursive, where $P(x,y)$ holds if $x,y$ are relatively prime?
|
I'm studying CLRS section 21.3, which introduces a union rank + path-compressed implementation of disjoint set. The implementations of MAKE-SET, UNION, LINK, and FIND-SET on p 571 of the book all work with nodes themselves, where each node has a parent pointer and rank.
Exercise 4 in that section claims that if you wan... |
A hash function $H$ operating on strings can have the following property:
Let $x$ be a string and $c$ a character. Given $H(x \cdot c)$ and $c$,
$H(x)$ can be determined uniquely (where $\cdot$ stands for concatenation).
Note that it may not be possible to determine $x$, only $H(x)$.
An example of such hash function is... |
I ran into a very hard question.
We have array of $n$ integers. for $1 \leq i \leq j \leq n$. we want to set $c_{ij}$= Sum of all values in the range $i$ to $j$ of this array. we want to finding average of all possible $c_{ij}$ in this array. if 4 basic operation in math $(+,-,*,/)$ can be done in $O(1)$. the best algo... |
Question
There are $n$ computers arranged in a cycle ($1,2,3..,n,1$), with undirected edges between adjacent computers. There are $m$ messages that need to be delivered. Message $i$ ($1 \le i \le m$) has to be sent from computer $s_i$ to computer $t_i$. There are two ways to deliver a message $i$: clockwise from $s_i$... |
I'm reading section 16.1 of the book, Combinatorial optimization, Polyhedra and efficiency by Schrijver. Here, he starts with a matching $M$ and describes a path $P$ that is $M$-augmenting if:
The path has odd length (in terms of edges).
Its ends are not covered by $M$.
Its edges are alternately out of and in $M$.
Th... |
The post here: Solving the min edge cover using the maximum matching algorithm provides a way to obtain the min edge cover from a maximum matching by greedily adding edges on top of the maximum matching until all vertices are covered. Now, thinking about the min-weighted edge cover problem, it would seem this approach ... |
I see the following image on google:
And I want to find Amortized Cost for Updating of each vertex on Dijkstra algorithm. I have an answer $O(E/V)$. I'm get stuck it means at this answer we should used sorted array or binary heap for implementation? non of others get us this Amortized Cost?
|
A path consisting of a number of disequality edges and a single equality edge
A path consisting of equality edges
A path consisting of a number of equality edges and a single disequality edge
A path consisting of disequality edges
The answer is number three, right? Who has any reasonable doubts or general short r... |
I know that there's no such thing as a finitely sized undecidable language. However, does there exist an undecidable language where a finitely sized set of undecidable elements are 'hiding among' an infinite set of decidable elements?
In order to formalize this, let's build a deciding machine that answers $\text{YES}$,... |
the corpus
what is the shape ?
what is the colour ?
what colour is it ?
it is what ?
is it red ?
what is it ?
what shape is it ?
it is red
it is green
the colour is red
the shape is square
red is the colour
square is the shape
(1) What is the probability of the following sentences: (4 points)
... |
I am studying the topic of vertex cover on coursera and how it can be solved approximately by linear programming. Suppose the optimal solution for the vertex cover problem is $OPT$. I do not understand why the approximate solution $$\sum_u w_u x^*_u \leq OPT$$
where $w_u$ is the weight to each vertex and $x^*_u$ is the... |
The following algorithm constructs a binary tree.
MakeArray(array[x:y]) (
if(x==y):
the root is x
else:
pick a number r as root
MakeArray(array[x:r-1])
MakeArray(array[r+1:y])
)
Let $a_n$ be the expected number of nodes which have two children in the tree with $n$ nodes generated.
Prove $a_n = \frac{n-2}... |
Is it possible to somehow store a $n$ bit string using only $\mathcal{O}(\log{n})$ space? I am thinking if the string could be stored using a hash function, but I am not sure if it is even possible.
|
Which of these properties hold for all FO theories? (but not regarding fragments thereof)
a. Decidable
b. At least expressive as propositional logic
c. NP-complete
a) Decidable: no, some first order theories are not decidable.
b) Propositional logic lacks expressiveness, so possibly yes. However, are hence all FO theor... |
I'm studying The Algorithm Design Manual and the proof exercises of the first chapter are really hard(at least for a first-timer). I asked a question on here about the previous question in the exercises two days ago and I still haven't been able to go through the whole page.
Anyway, I'm trying to inductively prove Eucl... |
When I look online for examples of the Hungarian method for solving the min-weight assignment problem, for example here, it involves iterating on the cost matrix; subtracting entries from the rows and columns.
However, in section 17.2 of the book, Combinatorial optimization polyhedra and efficiency by Schrijver, a seem... |
What is the best way to find if there are two individual capacities that sum to a total capacity within a range of plus and minus the total capacity?
Optimize for runtime over memory complexity.
The same item cannot be selected twice.
Inputs
An Int representing the total capacity
An Int representing the range abo... |
I'm reading the algorithm on page 12 of An Introduction to Counterfactual Regret Minimization. On lines 25 and 26, we accumulate new values into $r_i$ and $s_i$:
$25.\space \space r_I[a] ← r_I[a] + \pi_{-i} . (v_{\sigma I \rightarrow a}[a] - v_{\sigma}[a])$
$26. \space \space s_I[a] ← s_I[a] + \pi_{i} . \sigma^t(I, a)... |
Most normal linear programming problems look like this:
We choose some point in the double shaded area that solves our optimizer and we're good to go.
However, I've come across a problem where it's fairly common to get a lp problem like this (infeasible):
I'd like to employ some metric such that the solution given re... |
I am currently studying the textbook Principles of Program Analysis by Flemming Nielson, Hanne R. Nielson, and Chris Hankin. Chapter 1.3 Data Flow Analysis says the following:
The least solution. The above system of equations defines the twelve sets
$$\text{RD}_\text{entry}(1), \dots, \text{RD}_{\text{exit}}(6)$$
in t... |
I don't know what this problem is called, so I haven't been able to Google for it, but I have a graph problem that I feel must have been solved many times before, and I just cannot find a good solution.
Given a directed graph, and nodes A and B, I want to find a route that takes me from A to B and back to A again, goin... |
S is defined as S x y z = x z (y z)
This suggest that (y z) should be evaluated just after x z and the the results of x z is applied to the results of (y z).
I'm implementing call by value in lambda calculus, I would need to support parenthesis when evaluating this expression right? Does this affect the results? I thou... |
I was reading the book by Kozen-Theory of Computation. There is a statement that Turing machine is the best model for defining basic time and space complexity because atleast for higher levels of complexity the definitions are robust and reflect fairly accurately our expectations of real life computation. I did not ... |
So this question has two questions and i have to use the answer from 1 to answer question 2. Assuming that my answer for 1 is good. I need help with 2. ( Correct me if wrong please.)
Question 1 :
Show the following language is decidable
$L=\{\langle G,w \rangle $ : $G$ is a grammar in normal form of Chomsky and $w$ is... |
The Fugaku is the most powerful computer. Its performance is 442,010 TFlop/s. That number does not mean much to a layman like me. I want to know how fast it can solve a hard problem. For example, can it solve the Max-Cut Problem of 1,000 vertices in minutes, hours,...,years?
By the way, what is the best record of solvi... |
I'm reading the book Introduction to Algorithms. In the book, in the initial step of proving that a red-black tree with $n$ internal nodes has height at most $2\lg(n+1)$, they prove that any subtree rooted at any node $x$ in a red-black tree has at least $2^{bh(x)} -1$ internal nodes. However I couldn't wrap my head ar... |
Can anyone kindly give me some hint on solving this?
There are $n$ water containers placed on the top of each other (container1 on top of container2, container2 on top of container3, ...), each with capacity $c_i$ and initial water $a_i$ ($a_i<c_i$).
In case of breakage of any container, all the water inside it will po... |
Here is the description of a problem
Given an array of strings representing an $N$x$N$ grid of $red$ and $blue$ cells and a target color $r$ or $b$, partition the grid into $N$ sections of $N$ contiguous cells. The goal is to have the maximum number of sections where more than half of cells are of the target color. Re... |
I have N objects, each of which has a weight. I need to form combinations of the objects to maximize how many sets of objects add up to at least x total weight. Combinations can consist of any number of objects.
1). What is a fast and correct algorithm to solve this?
2). Is this NP-complete, hard, or neither?
Ideally, ... |
I am confused about the precise definition of the DPLL algorithm. Various sources tend to define DPLL differently:
In pages 110-114 of the book Handbook of Satisfiability(Editors: Biere, A., Heule, M., Van Maaren, H., Walsh, T. Feb 2009. Volume 185 of Frontiers in Artificial Intelligence and Applications) it defines i... |
For a given set of coordinates (lat/lng) I need a path which will visit each coordinate only once. The path needs to be selected to minimize the number of times the haversine distance between two subsequent points along the path is greater than X (ex: 200 miles).
The practical application:
I have airports on a map. I h... |
I've got this question from an exercise and i'm not sure if it is possible to do so
Think of new data structure Q with priotry queue which allow us to find the median in $O(1)$ and the data structure need to support the following operations:
Insert(v,Q) which insert into Q (no time complexity constrain here)
Delete-Me... |
I am given a set of items S = {a1,a2,a3,...,an}. Each item has a corresponding M dimensional bit vector indicating the properties of that item. For example, if item x has corresponding vector: {0, 1, 0}, then item x does not have property 1, does have property 2, and does not have property 3.
I am also given a M dimens... |
Is there a general rule to convert a CFG to its CFL?
For example, how do I approach the following question?
What is the language generated by the following CFG?
$$ S \to aS \mid Sb \mid \epsilon $$
As per my understanding, $S\to aS$ is $a^*$ and $S\to Sb$ is $b^*$.
But how do I make sure that the language is $a^* b^*... |
I've head the lecture today and we saw this theorem:
$\mathsf{NP}^{\mathsf{NP}}=\Sigma_2$
But without a proof.
Here are the definitions I use:
A language $L$ belongs to $\Sigma_k$ if there is a deterministic Turing machine $M(x,y_1,y_2,\dots,y_k)$ such that:
There exists a constant $c$ such that $|y_i|=|x|^c$ and $M... |
I am wondering if there is a way to solve a recurrence time function with the master theorem if no $b$ exists. Like in this case.
$$ T(n) = 2\times T(n-1)+4$$
|
Currently, I have a hard time to find out the solution to this problem:
Given a matrix $A \in Z^{m \times n}$, $b \in Z^m$, $c \in R^n$ and $\lambda \in R$. Is there $x \in R^n$ with $Ax \leq b$ and $c^Tx \geq \lambda$?
I was able to show that the given problem is $NP$, but now I have to show it is in $NP \cap co-NP$ ... |
I want to solve $$T(n)=3T\bigl(\bigl\lfloor \frac{n}{3}\bigr\rfloor\bigr) +2n\log n,$$
with base case $T(n) = 1$ if $n \leq 1$.
I am sure that the Master Theorem does not work. I am trying a lot with the substitution method, but I am very frustrated since I can't find a solid expression. Does any one have a good "hint"... |
Prove by induction that $T(n)=\Theta(n^2 \log_{3}n)$ where
$$T(n)= \begin{cases} 1 & \mbox{if } n=1,\\ 9T(\lceil n/3 \rceil)+n^2 & \mbox{otherwise.} \end{cases}$$
The base case for $n=1$ seems to work, but I am unable to do the induction step.
|
I was reading http://barrywatson.se/lsi/lsi_delta_reduction.html, where
((+ 1) 2) →δ 3 is a δ-reduction.
((+ 1) ((+ 1) 1)) is a not a δ-redex.
Wouldn't $((+ 1) ((+ 1) 1)) \rightarrow ((+1) 2)) \rightarrow 3$?
|
I am trying to prove the following claim:
Let $(G,*)$ be a cyclic group of size $m$ with generator $g$. Assume
there exists some adversary $A'$ of size
$T'=\frac{\left(T-O\left(\log m\right)\right)}{2}$, for some
$T$, such that $$\mathbb{P}_{b\gets
G}\left[A'(b)=\log_{g}(b)\right]>\frac{1}{2}.$$ Show that there exist... |
so I know we can have 2 busy adjacent nodes for the fit algo since there'll always be free memory available, but what about when it comes to 2 free adjacent nodes? Is it possible to have 2 adjacent free nodes and why? Thanks
|
I'm trying to understand how we can construct an admissible ordering of the computable (meaning, partial recursive) functions.
Initially my take on such an enumeration was from the point of view of an enumeration of programs. For instance, we could enumerate all possible Turing machines using some set of rules (for ins... |
I wanted to know that based on Kleene's theorem (a language is regular iff some FSA recognizes it), does every regex have a TM (Turing machine) that halts on exactly the same language?
Is this implication valid or are we not entirely sure about this? (ambiguous/unclear given the theorem). Kind of like the Church-Turing... |
Can we enumerate all probabilistic Turing machines (with bounded error), like we do for deterministic Turing machines (when using diagonalization arguments against deterministic Turing machines)? If not, does this mean we cannot diagonalize against BPP machines?
|
At the moment I use HdrHistogram to track approximate distribution of a stream of values. But I don't really need all percentiles, just three of them. Is there some algorithm to track specific percentiles? Precise algorithm with two heaps isn't feasible because of number of values.
|
In section 17.2 of the book "Combinatorial optimization polyhedra and efficiency" by Schrijver, he describes the Hungarian method for maximum weight matching in bi-partite graphs (with classes $U$ and $W$). He defines for a matching, $M$, $U_M$ and $W_M$ as the set of vertices in $U$ and $W$ missed by $M$. He then says... |
In this paper, it is mentioned that BPTIME does not have a time hierarchy theorem, unlike DTIME. To quote the part where the author explains why:
It must hold that for any $x$, either $\Pr[M(x) = 1] \geq \frac{2}{3}$
or $\Pr[M(x) = 1] \leq \frac{1}{3}$. It is undecidable to test whether
a machine $M$ satisfies this pr... |
I know , if P = NP then it can easily be proven that P = NP = Co-NP. But I was wondering,
if we assume P≠ NP, also then can it be proven that, NP =co-NP??
|
Suppose we have an instance P of the PCP, and there exists a match for it.
I am wondering if we remove all dominos that has the same string on the top and bottom, would there still be a match?
My intuition is yes, there would still be a match, but i don't know how to justify.
Can someone please give me some hints or gi... |
private static < T extends Comparable < ?super T >> int partition(T[] a, int first, int last) {
int mid = (first + last) / 2;
sortFirstMiddleLast(a, first, mid, last);
swap(a, mid, last - 1);
int pivotIndex = last - 1;
T pivot = a[pivotIndex];
int indexFromLeft = first + 1;
int indexFromRight = last - ... |
A program runs in a low-spec hardware utilizes coroutines writes to a single socket but how does the socket know when the data should be sent as there could more coroutines writing given N time.
I find this problem similar to The halting problem even tho contexts are different.
Does anyone know how could be a one find ... |
Show that if the discrete log problem is $(T,1-\epsilon)$-hard, then it's $(O(\frac{T}{\frac{1}{\epsilon}log\frac{1}{\epsilon}}-nlogm),\epsilon)$-hard
Let $G$ be a cyclic group of size $m$, and let $g \in G$ be a generator.
We say the the discrete log problem is $(T,\epsilon)$-hard if for every algorithm $A$ of complex... |
I was wondering how to create a TM that it's $L(M) = 10$, I think it would be recognizable, but I need help building that TM.
so far I have this pseudocode:
$$
N:" ∀x∈sigma^*
$$
$run$ $N$ $on$ $x$
if N acc $then$ $i=i+1$
if i==11 then $stop$
please help solve this
|
Given a certain x86_64 "vanilla" binary, without micro-architecture instructions, which can therefore be executed by any x86_64 computer, what are the conditions for the result to be deterministic ?
Can we assume that without parallelization, without the use of entropy-generating instructions, the result will be "bit-p... |
Are the two interchangeable or is there a difference?
|
If I have two tuples (a1,b1,c1) and (a2,b2,c2), where we know each is ordered from smallest to largest, how would I return a tuple that takes the minimum elements from both tuples and orders them from least to largest?
I tried to break down the problem for two tuples so:
a1, b1 and a2, b2 are two tuples and we can do
i... |
How would we find the three smallest elements in a list and return it as a tuple (a,b,c) using divide and conquer?
So far I've considered the following:
def sm(L):
# base
if len(L) == 3:
return L sorted
else:
# divide
How would I divide the list so that we guarantee the list to be of size... |
If an algorithm can solve a problem in X iterations using Y bytes of space, then another algorithm that solves it in less bytes than Y, will usually end up needing to do it in more iterations (or time) than X.
One can keep increasing the space/memory to reduce the cycles or cpu time, but will eventually get cursed by s... |
In the standard proof of the halting theorem, you are asked to assume that a TM_0() exists that takes another TM_1() and a string W and outputs whether TM_1() halts or executes forever right on string W, right? The proof seems to be to assume that such a TM_0() exists. Now a new TM_2() is taken that takes TM_0() as in... |
Let PCPk be a version of PCP where we can use at most k copies of each domino to create correspondences. Prove that for any finite k = 1, 2, 3 … PCPk is decidable.
I know this kind of PCP is called bounded PCP which is decidable. Does anyone know how to prove the decidability?
|
I'm trying to understand how vector clocks compare to DAGs for causality detection in a distributed system.
When trying to detect causality relations in a distributed system, a very commonly proposed technique is the use vector clocks. Vector clocks are presented as:
Timestamping is a common method of totally ordering... |
I have a task of hashing DNA sequences. Let the DNA be long sequences of four amino acids, which we will denote by the letters $A, T, G$ and $C$.
My hash function $h$ take DNA as an input and return the sum of amino acid numbers by some large simple modulus as a hash, and then add it to a hash table with a public key. ... |
Given the language $K$ $=\{<M> $ where $M$ is a turing machine ( that is on the alphabet {0,1}) and $L(M)$ contains at least one word of form $0^k1^l$ with $k,l\geq 0\}$
I would like to know if my proof makes sens. I am using the reduction.
Considering the function $f$ given $<M,w>$ ( where M is a turing machine and $... |
Can you build a solver from a verifier?
I see that if you start with an NP-verifier TM the answer is yes, you can build a solver TM. How about for circuits? Can you go from a circuit that implements a verifier for instances of size n that is of size polynomial in n to a circuit that implements a solver for instances of... |
If you have a solver for an L in NP do you have enough information to build a solver for co-L in Co-NP? Meaning, is there a procedure that can take you from a solver for one to a solver for another?
|
Suppose we have an array$[1..n]$ and run linear search to find $x$, on it with following specification:
probability of existence $x$ in first half of array is $p$,and probability of existence $x$ in second half is $3p$ and in each half probability of any element to be x is equally likely.Calculate Average case linear s... |
I am currently learning category theory and a saying that I see a lot is that X is the algebra of something (e.g. Monoid is an algebra of something). Can someone explain to me what that means? Thanks!
|
Suppose we have observations with associated labels $\{({\bf x}_1, y_1), ({\bf x}_2, y_2), \dots, ({\bf x}_n, y_n)\}$ where ${\bf x}_i \in \mathbb{R}^d$ and $y_i \in \mathbb{R}$.
Can we efficiently find a separating plane of the observation space $\mathbb{R}^d$ such that the sum of the variances of the labels of the o... |
given a graph G = (V, E) of n vertices, decide whether G is k-colorable. if I were to have an oracle that solves for 3 color, how do I use it to solve the k color graph problem?
|
I am struggling to find how can I know the number of errors that can be corrected and detected using (n=10) bit code with a (k=550) codewords.
As far as I know, to calculate the number of errors to be corrected and/or detected someone must know the Hamming distance between 2 codewords. However, I do not have any releva... |
I have a pattern $P$ of length $m$, i.e. $P = p_0, p_1, \ldots, p_{m-1}$
which I want to build a simple jump table for (not considering special optimizing cases for now).
I only want to build a jump table based on matching suffixes of $P$ (the bad character rule is not relevant here).
The problem is to build a table su... |
I came across some code and I'm trying to crack the case as to what it does:
for $0 \leq f \leq l < len(A)$, the function is
def foo(A, f, l):
if f == l:
return A[f]
m = (f+l) // 2
x = foo(A, f, m)
c = 0
i = f
while i <= l:
if A[i] == x:
c += 1
i += 1
if c > (l - f + 1)/2:
return x
... |
Problem: Given a line segment on the cartesian plane, determine where and which order it intersects a regular grid. This sounds simple, but is actually quite a tough problem. It's related to, but distinct from, both Bresenham and supercover.
More specifically, consider:
A line segment with start $(x_1, y_1)$ and end... |
What is the SetHorspool string searching algorithm with pseudo-code so it can be easily implemented in a language of choice?
This has been implemented in 2 libraries I have come across:
https://app-db.com/seqan/1.3/SPEC_Set_Horspool.html,
http://stringsearchalgorithms.amygdalum.net/.
But there seem to be very little ... |
For Curiosity Sake, I was wondering if there was some history behind the naming of "Las Vegas" and "Monte Carlo" classes.
I've searched on the internet for quite some time now but I did not find a proper answer, is it just because they are probabilistic which gives them the "gambling" nature, or is there something more... |
L=4; N=4; N_l=2; P=10;
w = ones(L,1);
beta = ones(L,1);
%p = zeros(L,1);
H = sqrt(.5)*(randn(N_l,N)+1i*(randn(N_l,N)));
u_l = sqrt(.5)*(randn(N,1)+1i*(randn(N,1)));
u_i = sqrt(.5)*(randn(N,1)+1i*(randn(N,1)));
v_l = sqrt(.5)*(randn(N_l,1)+1i*(randn(N_l,1)));
u_l = u_l./norm(u_l,2);
v_l = v_l./norm(v_l,2);
u_i = u_i... |
I have stumbled across this question about the Random restart algorithm in search problems:
Random restart is technique which used for:
a)algorithms for search in space state when they get stuck
b)algorithms for informed search for better solution
c)algorithms for uninformed search for better solution
d)algorithms for ... |
ALBA={⟨M;w⟩ | M is linear bounded automata which accepts input w}
Show that ALBA is PSPACE-complete.
How I would try to solve it...
We need to prove ALBA belongs to PSPACE. So I would construct TM A which accepts <M;w>. Simulate M till qng^n steps or when it halts. If it halts: Accept <M,w> if M accepts w, otherwise ... |
I have a homework where I have to construct two way deterministic pushdown automaton that accepts this language:
{ww | w ∈ {a, b}*}
Does anyone have any idea? Thanks a lot
|
I am currently trying to implement a Tabu Search algorithm for the binary knapsack problem. Part of my goal is to have a variety of different configurations of attributes used and stopping conditions.
This means I need different ways of creating neighbours of my current solution. The obvious method is to pick some obje... |
Could it be that three languages $A, B, C$ such that $A \subset B \subset C$, and $B \in P$, but $A$ and $C$ are $NP$-complete?
|
I need to construct a CFG for the following language$$L = \{ w \in \{0,1\}^*\text{ } |\text{ } w = w^R \text{ and } |w| \text{ is even}\}$$
I know that the two middle position should always be the same. E.g. $11,00,0\underline{11}0,0\underline{00}0,\dots$ Each position on the opposite sides of the middle points should ... |
I want to solve $$T(n)=3T\bigl(\bigl\lfloor \frac{n}{3}\bigr\rfloor\bigr) +2n\log n,$$
with base case $T(n) = 1$ if $n \leq 1$.
I know that the solution is(with the help of the Master Theorem) $$\Theta(n*log^2(n))$$
I tried without the Master theorem and witht the help of the substuition method I got the following expr... |
A Finite State Machine cannot accept the language
$$L = \{ 0^n1^n \mid n > 0 \} $$
because it will require infinite amount of memory to remember the number of zeros. But a Push Down Automaton can recognize it with an infinite stack.
Why are we allowing infinite storage for the stack of PDA but not for the states of an... |
I am quite familiar with Ford-Fulkerson algorithm but I am having a trouble to apply the algorithm to the following problem. Can someone please give me some hints or better instructions how to use FF method to this problem?
Let O be a set of n objects. It is required to form a set G of m groups. There are three possibl... |
How to prove the NP-hardness of the language $\{G \mid \alpha(G) =\frac{1}{3} |V(G)|\}$?
Here $G$ is a graph, $V(G)$ is its vertex set, and $\alpha(G)$ is the independence number of $G$, which is the maximum size of an independent set.
|
suppose for $n$ elements we using mergesort.
each number compared at most $O(\log n)$ = False
in average each element compared with $O(\log n)$ elements = True
there exist an element compared with $\Omega (\log n)$ elements = True
is there anyone can share idea about these facts (i.e: why first is false and others is t... |
How do I prove the following proposition?
Let $T$ be a tree, and let $S$ be a subset of the vertices. If $|S|$ is even then we can partition $S$ into pairs $(x_i,y_i)$ such that the paths $x_i-y_i$ are edge-disjoint.
|
Consider the language $L = \{\langle M \rangle: \text{ $M$ accepts at most two single-letter words}\}$, where $\langle M\rangle$ is the encoding of Turing machine $M$.
We need to determine, without using Rice's Theorem, whether:
$L\in \text{R}$, i.e., $L$ is decidable.
$L \in \text{RE}\setminus \text{R}$, i.e., $L$ is... |
$F(z_1,...,z_n)$ is a Boolean expression. The assignment of variable ($x_1,...,x_n \in {0, 1}$) is the answer of $F$, if $F$ for that assignment equals to $1$.
If that case is true and the conditions are met, then both of them are considered to be NP-Hard.
A) The number of answers of $F$ in $DNF$ format.
B) The number... |
Trying to prove the following problem:
Given a graph $G=(V,E)$ and vertex $s\in V$, prove that: $\forall (u,v)\in E,\ |d_{s}(u)-d_{s}(v)|\leq1$ where $d_s(v)$ is the shortest path from $s$ to $v$ in BFS.
What I did: Let assume that it's isn't true, meaning there is $(u,v)\in E$ so $|d_{s}(u)-d_{s}(v)|>1$. Lets run BF... |
I see a lot of interest online to the problems of finding shortest paths, longest paths, and all simple paths. I'm interested in implementing a state-of-the-art algorithm to find all (simple) maximal paths of an directed graph without weights for an open-source package.
It may be useful for me to quickly demarcate some... |
This is a follow-up to this question. Even though BPTIME does not have a time hierarchy theorem, the reasons that prevent it from having one are essentially bypassed by PromiseBPTIME. Thus, does PromiseBPTIME have a hierarchy theorem? If so, how does it look like and how to prove it?
|
We are given the 2D coordinates of 2 points: the first point is where the ray starts and it goes through the second point. We are given another ray in the same way. How do we determine if they have a point of intersection? I would like to know the general algorithm and its explanation, don't mind about the extreme case... |
Is $L = \{ a^ib^j : 0 < j < i < 2j\}$ context free?
If so, can there be a pushdown automaton described for it?
If not, does the pumping lemma apply?
|
I am not sure about the answer. Intuitivly I would say that there are alphabets for which there are no non-regular languages. In particular I am thinking of languages with only one element. But I am not sure.
|
I was asking myself if it is not possible to decide the language where a TM M gets the Godel number of a TM M' as input and the checks if, let us say, the TM M' has a certain amount of transitions.
My idea was that it is decidable because we have an countably infinite amount of Godel numbers and the number of TMs which... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.