instruction stringlengths 0 29.8k ⌀ |
|---|
What languages are you familiar with? Are you familiar with the fact that $ALL_{TM}=\{\langle M\rangle : L(M)=\Sigma^*\}$ is not decidable? If so try a reduction from $ALL_{TM}$ where given a machine $M$, construct a machine $M^3$, such that $w=w_1\cdot w_2\cdots w_k$ is a accepted by $M^3$ iff $w[i,\infty)$ is accept... |
What languages are you familiar with? Are you familiar with the fact that $ALL_{TM}=\{\langle M\rangle : L(M)=\Sigma^*\}$ is not decidable? If so try a reduction from $ALL_{TM}$ where given a machine $M$, construct a machine $M^3$, such that $w=w_1\cdot w_2\cdots w_k$ is a accepted by $M^3$ iff $|w|(\mathrm{mod}\ 3)=0... |
Algorithm for iteratively distributing $5$ units to two variables |
null |
null |
Please point me to the right place if this isn't the right one to ask in.
- There are 2 initial integer variables (the values of the two can be changed). a = 4 and b = 1
- There's a function. Each run of the function can distribute a total of 5 to a and/or b.
- So any positive integer combination of 5 is possible.... |
Please point me to the right place if this isn't the right one to ask in.
- There are 2 initial integer variables (the values of the two can be changed). a = 4 and b = 1
- There's a function. Each run of the function can distribute a total of 5 to a and/or b.
- So any positive integer combination of 5 is possible.... |
Since you add $1$ to $a$ at each iteration, while $b$ can only be increased summing a portion of $5$ at each iterations, the idea is that of bringing $b$ to $99$ and then take care of $a$.
This is an outline for the algorithm:
1) while $b<95$ add $5$ to $b$. As a consequence, you will add $1$ to $a$
2) if $b<99$... |
Let $\mathcal{I}$ be an instance of the problem with profit requirement at least $P(\mathcal{I})/2$, where $P(\mathcal{I}) = p_1+\dotsc+p_{3n}$. By the [previous reduction](https://cs.stackexchange.com/questions/161881/knapsack-with-fixed-size), we know that the problem is $\mathsf{NP}$-hard. Moreover, the reduced hard... |
I have two types of objects, X and Y, each are recursive structures, and contain different structures sets of tuples containing sets.. etc. The number of elements in X and Y are is the same.
I need to proof that for every x in X, there is a unique y in Y.
Can this be achieved by defining a bijective function whic... |
Can proofs by induction be achieved by defining a recursive function between two recursive objects? |
|proof-techniques|recursion|induction| |
by definition log(n)=O(f(n)) therefor if M uses O(f(n)) cells it might as well uses log(n) cells, how do I continue?
|
$log(n)<=f(n)$, $L\inDSPACE(f(n))$ means $L\inDTIME(c^(F(n)))$ |
|complexity-theory| |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^(F(n)))$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^(f(n)))$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^f(n))$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^$f(n)$)$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^[f(n)])$ |
$log(n)\leqslanf(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^[f(n)])$ |
$log(n)\leqslan f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^[f(n)])$ |
$log(n) \leqslan f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^[f(n)])$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^f(n))$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME((c)^(f(n))$ |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME($ $(c)^(f(n)$) |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^{f(n)}) |
$log(n)<=f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^{f(n)})$ |
$log(n)\geq f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^{f(n)})$ |
$log(n)\leq f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(c^{f(n)})$ |
$log(n)\leq f(n)$, $L\in DSPACE(f(n))$ means $L\in DTIME(C^{f(n)})$ for some C |
If you can establish that the function you define is a bijection from $X$ to $Y$, then that constitutes a proof, whatever technique you use, induction or other.
The proposition you wish to prove is essentially the **definition** of *bijection*. |
I was reading about [star-free languages](https://en.wikipedia.org/wiki/Star-free_language) recently and a common example of a non-star free language is the one given by (aa)\*.
I was wondering if (ab)\* would also work (for an alphabet of two symbols let's say). |
Is the language given by the regex (ab)* star-free? |
|formal-languages|regular-languages| |
Please point me to the right place if this isn't the right one to ask in.
- There are 2 initial integer variables (the values of the two can be changed). $a = 4$ and $b = 1$
- There's a function. Each run of the function can distribute a total of $5$ to $a$ and $b$.
- So any positive integer combination of $5$ is ... |
null |
No. $L=(ab)^*$ is [star-free](https://en.wikipedia.org/wiki/Star-free_language). A word is in $L$ iff
1. It starts with $a$ (or is empty)
2. It ends with $b$ (or is empty)
3. It does not contain any consecutive $a$'s
4. It does not contain any consecutive $b$'s
Each of those conditions can be represented by ... |
**Definitions**: Let $n \in \mathbb{N}, n \geq 1$. We write $|\alpha|$ to denote the length in characters of an expression $\alpha$ in propositional logic. We define *partial evaluation* in the normal way where evaluation is applied to an expression containing constants until no more evaluation is possible. So for exam... |
Growth of a set of propositional formulas under partial evaluation |
|complexity-theory|logic|combinatorics|propositional-logic| |
null |
No, that doesn't follow. 1 is $\le$ a million. Therefore if $M$ uses at most a million cells, it might as well use 1 cell. Wait, there is something wrong with that logic...
|
This follows immediately from [Rice's theorem](https://en.wikipedia.org/wiki/Rice%27s_theorem). However, if you don't know that theorem yet and you're asked to prove it by an explicit reduction, see oleshkowitz's answer. |
null |
null |
null |
null |
null |
**Definitions**: Let $n \in \mathbb{N}, n \geq 1$. We write $|\alpha|$ to denote the length in characters of an expression $\alpha$ in propositional logic. We define *partial evaluation* in the normal way where evaluation is applied to an expression containing constants until no more evaluation is possible. So for exam... |
null |
I am working on exact algorithms for an NP-hard problem $P$. I was able to get a $(1.75^n$) time algorithm for split graphs. When it comes to bipartite graphs, the problem becomes hard to tackle. Now, I want to prove that there is no sub-exponential algorithm for the problem on bipartite graphs. So to prove this, I hav... |
Subexponential reduction |
|algorithms|np-hard| |
Yes, obviously the lower bounds you get depend on the size of the reduction. Second thing is, you have no lower bounds as we don't know if P = NP. You have a _conditional_ lower bound.
Under ETH, your problem cannot be solved in time $2^{o(\sqrt[3]{n})}$. |
null |
Haskell's monads are usually considered to mean strong monads in category theory, but it seems like the former is a bit stronger than the latter. With strong monads, you have a Kleisli extension operator
$-^* : C(a, Tb) → C(Ta, Tb)$
that operates outside the category $C$, whereas with Haskell's monads you can wr... |
Are Haskell monads stronger than strong monads? |
|category-theory|haskell|monad| |
Induction applies to infinite processes. Unless you address a special theoretical problem, I don't think that induction can be of any use. In any case, you would not establish equal values, but equicardinality.
|
null |
It depends on what is meant by a *syntax analyzer*.
Generally, in computer science, different people often mean different things by the same term, so always consult the definition you were given.
It is very easy for a syntax analyzer to do this.
Let's assume it is based on a parser that uses a well-known parsing... |
Your substitution is correct and indeed leads to Fibonacci. Anyway the final answer does not respect $T(1)=-3$ and there is a sign error.
I would prefer to rework the recurrence independently of $T(1)$, writing
$$T(n)+n=T(n-1)+n+T(n-2)+n$$
or $$U(n)=U(n-1)+U(n-2)+3$$
then
$$U(n)+3=U(n-1)+3+U(n-2)+3$$ and... |
Nope,
PROCEDURE P;
BEGIN
END Q;
is syntactically valid. A BNF description cannot express the equality of the identifiers.
|
It depends on what is meant by a *syntax analyzer*.
Generally, in computer science, different people often mean different things by the same term, so always consult the definition you were given.
It is very easy for a syntax analyzer to do this.
Let's assume it is based on a parser that uses a well-known parsing... |
Obviously, classification rests on the idea of similarity. Always. And in a metric space, similarity is measured with distances, and equal-distance loci are planes. [In fact, you try to minimize the intra-class distances while maximizing the inter-class distances.] |
null |
From this reference: http://wtkrieger.faculty.noctrl.edu/csc220_winter2014/lecture/note22.pdf,
12 bits control the selection of the next microinstruction:
- Addr (9 bits) - the address of the next micro-instruction
- JAM (3 bits) - these bits determine how the next micro-instruction is chosen
JAM bits are compl... |
Each address in this RAM chip stores 4 bits. For example, you can write data 0100 to address 01010101010101010101 and then write data 0011 to address 00000000001111111111 and then read address 01010101010101010101 and you get the data 0100 again.
You can view it as 4 1-bit RAM chips in parallel. Each address selects... |
Can the strengths of Mulitple Dispatch system of Julia language be replicated in a newly designed language language like Mojo through cleverly designed mechanism? Or only Julia gets to have such a feature due to its strong type system. Can programming languages theory address this this issue? |
Is it possible for Mojo language to include multiple dispatch feature of Julia through some hints or decorators mechanism? |
|programming-languages| |
Can the strengths of Mulitple Dispatch system of Julia language be replicated in a newly designed language like Mojo through cleverly designed mechanism? Or only Julia gets to have such a feature due to its strong type system. Can programming languages theory address this issue? |
null |
This question is because I think it would be fun to make an A.I.
Any programming language is acceptable. I am wondering how do I make a simple program that can associate certain things with points and learn to prefer things with more points associated with them. It is a very general question.
If you need an examp... |
How do I make an A.I. reward system? |
|artificial-intelligence| |
Say that I have a plasma gun:
[![enter image description here][1]][1]
It's easy to compute the trajectory of the plasma ray starting from the gun.
However, another ray may come from afar:
[![enter image description here][2]][2]
As everybody knows, plasma rays are deviated when they collide. In fact, they a... |
Trajectories with collisions |
|backtracking|path| |
Say that I have a plasma gun:
[![enter image description here][1]][1]
It's easy to compute the trajectory of the plasma ray starting from the gun.
However, another ray may come from afar:
[![enter image description here][2]][2]
As everybody knows, plasma rays are deviated when they collide. In fact, they a... |
{"Voters":[{"Id":-1,"DisplayName":"Community"}]} |
{"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
{"Voters":[{"Id":755,"DisplayName":"D.W."}],"SiteSpecificCloseReasonIds":[]} |
One possible approach is to use the [Bentley-Ottman algorithm](https://en.wikipedia.org/wiki/Bentley%E2%80%93Ottmann_algorithm) (or similar algorithm) to find all intersections between line segments.
More specifically: for each plasma gun, add a directed line starting at the plasma gun and proceeding in a straight l... |
|computational-geometry|backtracking|path| |
Can any SAT problem be converted into one with only affine formulas?
[*Handbook of Satisfiability*][1] p. 672:
>**Affine formulas.** A *linear equation over the two-element field* is an expression of the form $x_1 ⊕ … ⊕ x_k = δ$ where $⊕$ denotes the sum modulo $2$ and $δ$ stands for $0$ or $1$. Such an equation ... |
Can any SAT problem be converted to a system of linear equations over $\mathbf{Z}_2$? |
|satisfiability|linear-algebra| |
null |
From [Discrete lizard][1]'s answer and Handbook of Computational Geometry (Third edition, 2018) Section 26, Chazelle's solution of high dimensional convex hull achieved worst case optimal. T.M. Chan's algorithm made the practical implementation, and Avis and K. Fukuda's solution was more efficient.
However, I recen... |
Quickhull vs T.M. Chan vs Avis and Fukuda |
|convex-hull| |
I recently came across this question, and the way I think people usually go about this is to find a certificate that answers 'yes' to the decision problem 'Is this LP infeasible?' Or, given a certificate, verify if that yields infeasibility or not. I know of the theorem that says Ax = b is infeasible if there exists y ... |
Why is infeasibility of linear programming considered to be an NP problem? |
|complexity-theory|np|linear-programming|co-np|simplex| |
I expect you'll also have to prove that: (1) the "infeasible if" is an "infeasible iff", (2) the "size" of $y$ (the number of bits needed to represent it) is polynomial in the size of $A,b$, and (3) you can find $y$ in polynomial time. |
The steps to get a number in 2's complement are simple:
1. Flip the bits (Using NOT)
2. Add +1 (afaik this step is done to eliminate the duplicate 0)
Recently I've seen an ALU design that can operate negative numbers in 2's complement without the seconds step. For example, we want to perform the following operat... |
Relation between NOT gate and negative numbers 2's complement |
|combinatory-logic| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.