instruction stringlengths 0 29.8k ⌀ |
|---|
i refuted it for example take L={a^i b^i a^j | i, j >=0}
means L^R = L={a^j b^i a^i | i, j >=0}
which leads us to L interaction L^R = {a^n b^n a^n | n>= 0 } which is clearly not an CFL |
Here are two different ways to see this, first a more "direct reasoning" way and second by induction. Let $\oplus$ denote the XOR operation.
### Direct reasoning:
If $x$ is an even number, then what is $x \oplus (x + 1)$? Notice that because $x$ is even (ends in a $0$), $x + 1$ only modifies the last bit, so that... |
null |
To run alternative software on a device, you need to be able to install the software somehow.
If the device runs software from a storage medium that can be removed, this is easy: attach the storage medium to a different computer, install the software onto this medium, and insert the medium back into the device. You ... |
We have $c$ arrays of positive integers, named $j[1],j[2],j[3]..,j[c]$. We know that the length of $j[i]$ is $c-i+1$. In addition, the sum of the numbers of $j[i]$ is greater than or equal to the sum of numbers of $j[y]$ if $i \leq y$. Moreover, we have $k$ tuples, each with a length of at most $c$. If we use a tuple $... |
Is this minimizing problem NP-hard? |
|algorithms|np-complete|np-hard|arrays|polynomial-time-reductions| |
Dijkstra's do loop as defined in the abstract language of guarded commands, which is a non-deterministic construct, is not found in the programming languages.
$$\begin{align}\underline{do}&\\
&\text{[] condition }1\to\text{instruction }1\\
&\text{[] condition }2\to\text{instruction }2\\
&\cdots\\
&\text{[] condi... |
As the page size increases, the number of pages in memory decreases. Now, each entry in a page table is an address translation of a page. So, the page table will have fewer entries when the number of pages decreases. Hence, page table size decreases with an increase in page size. |
I am new to reinforcement learning, and recently came across the following issue. When implementing a multi-armed bandit algorithm using thompson sampling, each arm's t*rue success probability* is required to derive the *estimated* reward distributions of each option. However, I was under the assumption that multi-arme... |
null |
I am new to reinforcement learning, and recently came across the following issue. When implementing a multi-armed bandit algorithm using thompson sampling, each arm's t*rue success probability* is required to derive the *estimated* reward distributions of each option. However, I was under the assumption that multi-arme... |
null |
Let $\ast$ stand for "type" and $\square$ stand for "kind" so that $\ast:\square$. Suppose I want to find an inhabitant of $\Pi x: A.\Pi y:B(x). \ast$. The derivation rules are given [here][1].
Intuitively, as far as I understand, this inhabitant should have the form $\lambda x:A.\lambda y:B(x). P(x,y)$ for some $P:... |
Finding an inhabitant of $\Pi x: A.\Pi y:B(x). \ast$ |
|logic|lambda-calculus|type-theory|dependent-types| |
We have $c$ arrays of positive integers, named $j[1],j[2],j[3]..,j[c]$. We know that the length of $j[i]$ is $c-i+1$. In addition, the sum of the numbers of $j[i]$ is greater than or equal to the sum of numbers of $j[y]$ if $i \leq y$. Moreover, we have $k$ tuples, each with a length of at most $c$. If we use a tuple $... |
Some devices (for example Android devices) are "[locked][1]", the bootloader checks following bootloader/software sign, right? [Chain of trust][2]. Signing technically means that the file must be encrypt with one (private) key and decrypted with another (public) key.
The software is compiled to executable binary and... |
How executable binary can be signed? |
|operating-systems|binary| |
Best C++ STL container to store bodies in an N-body simulation? |
null |
I want to know if there exist a algorithm to efficiently compute the number of odd vertex in an undirected graph?
A graph vertex in a graph is said to be an odd vertex if its vertex degree is odd, degree of a graph vertex ***v*** of a graph **G** is the number of graph edges which touch vertex ***v***.
This [post... |
You are indeed correct : Given a graph $G$ in the form of its adjacency matrix, you can find all the odd degree vertices in polynomial time of the number of vertices.
The post that you mention does something different. Notice that you may decide to mention the graph in some form other than the adjacency matrix. Assu... |
[![divisible by 5][1]][1]
[1]: https://i.stack.imgur.com/gyoIg.jpg
I tried the same question to check divisibility by 5. As @m.farokhian said, this doesn’t need to be reversed, but for the strings 10011 & 1001100, it doesn’t seem to work.
Ps. I couldn’t comment due to my contribution. That's why added it ... |
Aho-Corasick can result in a quadratic number of matches because it finds all occurrences of each searched-for substring. What is a faster algorithm or modification to this one to simply determine if there is any occurrence for each of the substrings? |
Is there a faster alternative to Aho-Corasick when searching for any occurrence rather than all occurrences of each of the substrings? |
|strings|search-trees|substrings| |
To my knowledge a Turing machine is able to compute anything considered computable.
If so, how can one achieve anything more than Turing equivalence? |
If a Turing machine can compute any computable problem how can Turing completeness be achived? |
|turing-machines|computability|turing-completeness| |
Suppose there is a simple path of weight $-(n-1)$ from $i$ to $j$. Since each edge has weight $-1$, this path must contain $n-1$ edges, and so it corresponds to a Hamiltonian path in the original graph.
Conversely, suppose that the original graph has a Hamiltonian path, say starting at $i$ and ending at $j$. This pa... |
null |
Suppose there is a simple path of weight $-(n-1)$ from $i$ to $j$. Since each edge has weight $-1$, this path must contain $n-1$ edges, and so it corresponds to a Hamiltonian path in the original graph.
Conversely, suppose that the original graph has a Hamiltonian path, say starting at $i$ and ending at $j$. This pa... |
To my knowledge a Turing machine is able to compute anything considered computable.
I got the definition of Turing completeness from this answer https://cs.stackexchange.com/questions/134273/explain-the-difference-between-turing-complete-and-turing-equivalence/134286#134286?newreg=1f531fb2e7f941b9b3d788aad0a8ea5a
... |
To my knowledge a Turing machine is able to compute anything considered computable.
I got the definition of Turing completeness from this answer https://cs.stackexchange.com/questions/134273/explain-the-difference-between-turing-complete-and-turing-equivalence/134286#134286?newreg=1f531fb2e7f941b9b3d788aad0a8ea5a
... |
null |
null |
Since you are asking to find *any* inhabitant, how about $\lambda (x : A). \lambda y : B(x). A$?
In other words, we take $P := \lambda (u : A) . \lambda (v : B u) . A$. It looks like part of your problem is that you want somehow to use an unspecified $P$. |
While I know that every edge is fully saturated in every min-cut of a network flow, I'm trying to get some intuition when the converse is true.
I can find an example using edges with infinite capacity, but is there any way to generalize this idea?
Are there graphs where every saturated edge is part of some min-cut? |
Network Flow - qualities of saturated edges |
|graphs|network-flow|minimum-cuts| |
I think the correct approach to questions of this sort that try to give a better understanding of definitions is first to look at the,
$\displaystyle f\in\Theta(\lg n)\Rightarrow c_1\lg(n)\leq f\leq c_2\lg(n)$
We want to show that $\lg(\Theta(n))$ satisfies this requirement. I think the best way would be to show ... |
I think the correct approach to questions of this sort that try to give a better understanding of definitions is first to look at the,
$\displaystyle f\in\Theta(\lg n)\Rightarrow c_1\lg(n)\leq f\leq c_2\lg(n)$
We want to show that $\lg(\Theta(n))$ satisfies this requirement. I think the best way would be to show ... |
Given an arbitrary (potentially ambiguous) context free grammar $G: \mathbb{G}$, and string $\alpha: \Sigma^\ast$, is there a decision procedure that returns whether appending and/or prepending symbols can alter the parse forest of $\alpha$? In other words, we want a function $F: (\mathbb{G} \times \Sigma^\ast) \righta... |
null |
When adding two 2D matrices of the same size (in row major format), in sequential code with no vector operations, is it faster to add them column by column or row by row?
At first I thought it would be faster to add them row by row, but now I'm thinking it would be faster to add them column by column. If you have th... |
Adding two 2D matrices together: row by row vs column by column |
|matrices|cpu-cache| |
null |
My textbook claims the worst-case running time of Shellsort with Shell's increments is $Ω(N^2)$, but this analysis is done when $N = 2^m$ for a positive integer $m$. I see why the proof would work for those cases of $N$. However, the definition of $Ω$ requires that the running time be above a multiple of $N^2$ for all ... |
Shell's Increments Worst Case Analysis |
|asymptotics|sorting| |
Every value of $N$ is within a factor of two of a power of two.
In particular, given any $N$, let $N_0$ be the largest power of two such that $N_0 \le N$. Your textbook apparently proves that the worst-case running time on an input of length $N_0$ is at least $c \cdot N_0^2$. The worst-case running time only incre... |
I was also thinking about this and eventually understood it this way:
Gamma is a parameter of the environment the agent is operating in (yes we can change it, but policies can only be evaluated and improved in relation to a single value of gamma).
In order for the backwards update to accurately reflect the amount... |
I was also thinking about this and eventually understood it this way:
Gamma is a parameter of the environment the agent is operating in (yes we can change it, but policies can only be evaluated and improved in relation to a single value of gamma).
In order for the backwards update to accurately reflect the amount... |
null |
If you want to find collision pairs for $10^6$ objects, I would suggest using a spatial data structure (as suggested by @D.W. in the comments).
For collision detection, some useful structures are [quadtrees][1], [R-trees][2] and [BVH][3].
For collision detection you usually want window queries (rectangular query... |
My textbook claims the worst-case running time of Shellsort with Shell's increments is $Ω(N^2)$, but this analysis is done when $N = 2^m$ for a positive integer $m$. I see why the proof would work for those cases of $N$. The reasoning for the proof does not appear to, in general, hold for arbitrary $N$. However, the de... |
null |
Given the challenge of proving algorithmic bounds on the likes of 3-SAT to resolve P versus NP, I wondered whether it might be possible to use undecidability **within** an NP problem to ensure that we can never find **any** algorithm as an alternative to brute force. I couldn't find any references on this type of idea.... |
An idea to use undecidability to prove P != NP |
|complexity-theory|np|halting-problem|p-vs-np| |
Let's start with a simple approach: Stored on your hard drive is a 1 to 1 image of an executable file. Your operating system allocates space for the executable file, reads it from the hard drive, and transfers control to the address where the executable file should start execution. That works just fine.
Now we can ... |
Using undecidability to prove P != NP |
Given the challenge of proving algorithmic bounds on the likes of 3-SAT to resolve P versus NP, I wondered whether it might be possible to use undecidability **within** an NP problem to ensure that we can never find **any** algorithm as an alternative to brute force. I couldn't find any references on this type of idea.... |
There's a question I've long had about reversible computing: do non-trivial algorithms usually end up generating strongly pseudorandom data as an artifact of the computation?
The most straightforward example of this would be if you used Fredkin gates or equivalent to wire together a binary multiplier circuit. My und... |
Reversible computing as a path to a useful PRNG or hash function? |
|hash|number-theory|cryptography|one-way-functions|reversible-computing| |
I am not aware of any reason to believe that the junk bits will be strongly pseudorandom (for instance, in the sense of polynomial-time indistinguishability from random or cryptographic pseudorandomness), and I would be surprised if they were for most algorithms. I would not expect this to provide a strong method for ... |
I don't think the approach you outline is valid.
> Therefore we have to go through all possible
Your "Therefore" does not follow. This is not an accurate deduction.
For one thing, the halting problem talks about decidability, i.e., existence of an algorithm that has unlimited time. Your problem asks about th... |
null |
null |
The path-convergence criterion states that there should be a φ-function for variable
a at node z of the flow graph exactly when all of the following are true:
1. There is a block x containing a definition of a,
2. There is a block y (y $\neq$ x) containing a definition of a,
3. There is a nonempty path $P_{xz}$ of ... |
Why Path-convergence criterion Requirement 6 is necessary? |
|compilers| |
There is no solution.
#### Proof by induction
Here is one-line summary: the bottom string is always longer than the top string by a string in the form $(abca\mid abcaaa\mid abcaaab)^+$.
------
Suppose we try to construct a solution by adding dominos one by one, keeping the string on the top row (the top str... |
Thompson sampling doesn't require knowing the true success probability of each arm. I'm not clear on why you suggest it does. Quite to the contrary, it computes an integral over all possibilities for what that probability could be (or, it estimates this integral by sampling from the distribution over such probabiliti... |
To find the tree decomposition of a subgraph, you can first identify the bags of the tree decomposition that correspond to the vertices of the subgraph. Then, you can use these bags to construct a new tree decomposition for the subgraph. To do this, you can start by creating a new bag for the root of the subgraph's dec... |
Recently, I am reading paper [An Upper Bound for Resolution Size: Characterization of Tractable SAT Instances][1], which use tree decomposition to give an upper bound for SAT resolution refutation.
For a given nice tree decomposition $T=(V(T),G(T))$.
**My question:** Why $O(3^{treewidth})*V(T)$ is still $O(3^{tre... |
the size of nice tree decomposition |
|trees|satisfiability|big-o-notation| |
I don't see the claim that $O(3^{tw}) \cdot |V(T)| = O(3^{tw})$, as you mention.
Instead, $O^*(3^{tw}) \cdot |V(T)| = O^*(3^{tw})$. The notation $O^*$ is shorthand used to suppress polynomial factors in the input size $n$. You should read $O^*(3^{tw})$ as $O^*(3^{tw} \cdot \text{poly}(n))$. |
While I know that every edge is fully saturated in every min-cut of a network flow, I'm trying to get some intuition when the converse is true.
I can find an example using edges with infinite capacity, but is there any way to generalize this idea?
Are there graphs where every saturated edge is part of some min-cut?... |
I'd like to know if there's a reduction $\mathsf{ALL}_{\mathsf{TM}}\leq_{m}\overline{\mathsf{ALL}_{\mathsf{TM}}}$ where of course $\mathsf{ALL}_{\mathsf{TM}}=\left\{ \left\langle M\right\rangle \mid\mathsf{L}\left(M\right)=\Sigma^{*}\right\} $
All attempts I've tried failed - if for example I try to define the redu... |
Reduction from $\mathsf{ALL}_{\mathsf{TM}}$ to it's complement |
|turing-machines|reductions|undecidability|recursively-enumerable| |
I am new to reinforcement learning, and recently came across the following issue. When implementing a multi-armed bandit algorithm, we assume we have k machines with reward probabilities [p_1,..., p_k] which we try to approximate. While these probabilities are clearly unknown to the player himself, they must still be e... |
Multi-Armed Bandit - Reward Probabilities |
I am new to reinforcement learning, and recently came across the following issue. When implementing a multi-armed bandit algorithm, we assume we have k machines with reward probabilities [p_1,..., p_k] which we try to approximate. While these probabilities are clearly unknown to the player himself, they must still be e... |
I have a language $L$ which is NP-hard and I have another language $L_1$, s.t. if I take an instance $q$ of the decision problem corresponding to $L$, and if one of polynomially many instances, $f_1(q),\ldots,f_{p(|q|)}(q)$ is in $L_1$, then $q\in L$.
Is this enough to say that $L_1$ is NP-hard? |
Polynomially many instances imply a polynomial reduction? |
|np-complete|np-hard|polynomial-time-reductions| |
null |
I Hope someone Can help me with that: enter image description here
[![enter image description here][1]][1]
I will be asked to answer what is the runtime complexity of the algorithm. I tried to set m=2^ and still failed Thanks
[1]: https://i.stack.imgur.com/LKJf8.png |
Solving a Recurrence relation formula with squared |
|algorithms|runtime-analysis|recurrence-relation| |
null |
Not a complete answer, but in T. Kloks _Treewidth_ you have the following lemma:
>There always exists a _nice tree decomposition_ of width $k$ and with at most $4n$ bags.
It is NP-complete to determine the minimum number of bags in a tree decomposition of width $k$.
---
At request of references:
> Lemma ... |
Assuming base-$2$ logarithms, we set
$$n=2^{2^{2^m}}$$ and transform
$$T\left(2^{2^{2^m}}\right)=\\
T\left(2^{\sqrt{\log\left(2^{2^{2^m}}\right)}}\right)+1
=T\left(2^{\sqrt{{2^{2^m}}}}\right)+1
=T\left(2^{2^{\left(2^m\right)}/2}\right)+1
=T\left(2^{2^{2^{m-1}}}\right)+1
.$$
This is of the form
$$S(m)=S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.