instruction stringlengths 0 29.8k ⌀ |
|---|
I think the authors assume that the processes start with identical (or empty) internal storage. This seems a reasonable assumption: if the internal storage is arbitrary, a process that reads it could be correct by coincidence, or if it were random, then the process can succeed with a certain probability. And if the sto... |
null |
null |
<!--
Here is a proof for the halting problem.
Towards a contradiction, suppose there is a Turing machine $H$ such that on a input $\langle M, w\rangle$ where $M$ is a TM and $w$ is a string, $H$ will output string "HALT" if $M$ halts on $w$ and $H$ will output string "RUN FOREVER" if $T$ runs forever on $w$.
We... |
<!--
Here is a proof for the halting problem.
Towards a contradiction, suppose there is a Turing machine $H$ such that on a input $\langle M, w\rangle$ where $M$ is a TM and $w$ is a string, $H$ will output string "HALT" if $M$ halts on $w$ and $H$ will output string "RUN FOREVER" if $T$ runs forever on $w$.
We... |
I've recently learnt the execution of MIPS instruction set using single cycle processor. However I'm not getting one thing. Since one clock cycle is needed for the complete instruction we only have one positive clock edge. When the clock is made high on the first time in this rising PC value is written but we may have ... |
Execution of instruction in MIPS on various parts of the clock cycle |
|computer-architecture|mips| |
null |
null |
The operation of shuffle takes two words and merges their symbols, keeping the symbols of each of the strings in the right order. It can be recursively defined by $x \parallel \varepsilon = \varepsilon \parallel x = x$ and $ax \parallel by = a (x \parallel by) \cup b (ax \parallel y)$. Here $a,b\in \Sigma$ and $x,y\in ... |
context-free shuffle for two-letter alphabets |
|formal-languages|context-free|closure-properties| |
Why is it that a Turing machine can perform all kinds of calculations and procedures?
As a test, I tried to perform a four-quadratic calculation using a Turing machine myself.
However, although I found that it can perform the four arithmetic operations as a result, I do not understand the principle of why it can do s... |
Why, in principle, can a Turing machine describe any computation or procedure? |
|turing-machines|automata|lambda-calculus|turing-completeness| |
null |
null |
null |
given this information of a language I need to determine if the language is regular or not:
[![enter image description here][1]][1]
I thought to Assume by way of contradiction that L6 satisfies the conditions of the pumping lemma. Let p be the pumping constant. Consider the word w = 0^(P-1)1...
Clearly w ∈ L6. T... |
pumping lemma misunderstanding |
|pumping-lemma| |
given this information of a language I need to determine if the language is regular or not:
[![enter image description here][1]][1]
I thought to Assume by way of contradiction that L6 satisfies the conditions of the pumping lemma. Let p be the pumping constant. Consider the word w = 0^(P-1)1...
Clearly w ∈ L6. T... |
Here are two additional interesting uses of union find in formal methods and programming languages, that are perhaps lesser-known at an undergraduate level.
- Decision procedure for the quantifier free fragment of theory of equality for uninterpreted functions in Satisfiability Modulo Theory (SMT) solving (https://... |
The language is regular because of the restriction $i_2 < 99$ which makes everything finite. Once you have 99 initial zeroes, it doesn't matter how many more you have. So the pumping lemma isn't going to help. There are a few ten thousand states. |
The language is regular because of the restriction $i_2 < 99$ which makes everything finite. Once you have 99 initial zeroes, it doesn't matter how many more you have. So the pumping lemma isn't going to help. There are a few ten thousand states. Try figuring out what they are. |
null |
In my algorithms class, my professor presented the problem of finding the largest sum of non-adjacent elements in an array. For example, if we have $[1,4,3,8,5]$ the largest sum of non-adjacent elements is $4 + 8 = 12$. My professor said we can solve this problem via dynamic programming since it exhibits optimal substr... |
Why does the non-adjacent sum problem have optimal substructure? |
|algorithms|dynamic-programming| |
null |
The sequences are made up of only digits. A displacement is defined as pair $(i, j)$ such that $i > j$ and $A[i] > A[j]$. For example, 423 has 2 displacements.
The question is to find the number of sequences of length $N$ such that number of displacements is less than a given $k$ in $O(n^2)$.
The only given hint... |
Algorithms for finding number of sequences with length N and displacements less than k |
|algorithms|dynamic-programming| |
The sequences are made up of only digits. A displacement is defined as pair $(i, j)$ such that $i > j$ and $A[i] < A[j]$. For example, 423 has 2 displacements.
The question is to find the number of sequences of length $N$ such that number of displacements is less than a given $k$ in $O(n^2)$.
The only given hint... |
null |
A single clock signal can trigger many, many independent actions. And the processor is pipelined, which means in one cycle it will execute different parts of different instructions. |
Suppose I have $n$ i.i.d. copies of some channel $W_{Y|X}$ for some finite $n$. I wish to send the maximum number of messages over these $n$ copies such that the error in decoding the message is at most $\varepsilon$. There is some encoder and decoder that I use. Let such an encoder result in some input distribution $p... |
Does optimal input distribution for $W^{\otimes n}_{Y|X}$ tell us anything about the optimal input distribution for $W^{\otimes n-1}_{Y|X}$? |
|probability-theory|information-theory| |
null |
null |
You are all familiar with the halting problem so I won't repeat it.
Suppose $H$ is a Turing machine which takes as input an encoding of another Turing machine $M$ searches all possible proof strings until it finds a proof that $M$ halts or a proof that $M$ does not halt. Of course, if there is no such proof then it ... |
Another halting problem problem - where's the mistake? |
|computability|halting-problem| |
Notice that if in your 5 element array, if the last element is 0 or 1, then the optimal solution will be the optimal solution for your example 4 element array.
My point here is that the largest sum in $A[0,..., n-1]$ will either be the $A[n-1]$ plus the largest sum in $A[0,..., n-3]$ (we skip $A[n-2]$ since it is ad... |
Notice that if in your 5 element array, if the last element is 0 or 1, then the optimal solution will be the optimal solution for your example 4 element array.
My point here is that the largest sum in $A[0,..., n-1]$ will either be $A[n-1]$ plus the largest sum in $A[0,..., n-3]$ (we skip $A[n-2]$ since it is adjace... |
NP has several complete problems, which reduce to one another. In this sense, they are all "equal" in terms of hardness.
There are other problems in NP that are also "equal" to one another; for example, all the languages containing only a single string are equal. All of these are in P as they are finite.
Let's de... |
Do reductions (in NP and other classes) follow a linear path? |
|np-complete|reductions|np| |
If P is not equal to NP there exists an infinite number of pairwise incomparable NP intermediate problems.
https://doi.org/10.1016/0020-0190(82)90113-2 |
> Of course, if there is no such proof then it will search forever.
This is your mistake: since we permit $H$ to loop forever, the language accepted by $H$ is recognizable but not necessarily decidable. The conventional proof is that Halting Problem is undecidable – that no $H$ exists that can accept or reject any i... |
the question is as follows:
"Generalize MATRIX-MULTIPLY-RECURSIVE to multiply n × n matrices for which n is not necessarily an exact power of 2. Give a recurrence describing its running time. Argue that it runs in Θ(n^3) time in the worst case."
how do you go about solving this?
my solution to the first part o... |
How to generalize MATRIX-MULTIPLY-RECURSIVE to multiply n × n matrices? |
|algorithms|time-complexity|recurrence-relation|matrices|divide-and-conquer| |
the question is as follows:
"Generalize MATRIX-MULTIPLY-RECURSIVE to multiply n × n matrices for which n is not necessarily an exact power of 2. Give a recurrence describing its running time. Argue that it runs in Θ(n^3) time in the worst case."
how do you go about solving this?
my solution to the first part o... |
Before I introduce my problem I need to define a couple of things. Suppose we have two sets $S_1=\{1,2,3\}$ and $S_2=\{2,3,4\}$. A *compression tree* for $S_1$ and $S_2$ is
{2,3}
/ \
/ \
{1} {4}
i.e. the left leaf is associated with $S_1$ and has the property that the union of th... |
How to show that my problem cannot be approximated within a certain factor unless P=NP? |
|complexity-theory|np-complete|approximation| |
The "halting problem" is about finding a Turing machine X that DECIDEs whether another Turing machine Y halts with input Z, for every Y and Z. You were instead talking about a Turing machine that RECOGNIZEs whether another Turing machine halts. That is a very different problem. And building a halting recognizer is triv... |
null |
As we know, Quickselect chooses a 'random' element in order to partition the array around that element in every iteration.
Assume the random element is at most the $\frac{1}{k}\cdot n$ largest element, and at least the $\frac{k-1}{k}\cdot n$ largest element, for some constant $k>1$.
I'm asked to prove that unde... |
The following is a dublicate of the question presented [here][1]:
> Let $G$ and $H$ be simple graphs. We build the graph $G\times H$ such that every vertex $(u,v) \in V(G\times H)$ is an ordered pair of one vertex from G(the first) and another from H(the latter). Additionally, two vertices $(u_1,v_1),(u_2,v_2)$ are ... |
The conjuction of two graphs is connected iff one of them has an odd cycle |
|graphs| |
If a function `f` has a `while loop` or `for loop`, can I compile this function into an `acyclic boolean circuit` that ensures that each gate is topologically ordered, i.e. there is no feedback? If so, how exactly is that done, by loop expansion? And if compiling the function as a `cyclic boolean circuit` is allowed, d... |
Say there are 5 candidates, A, B, C, D, and E. An election is held using a ranked voting method. That is to say, each voter submits a preference list (the order in which they prefer candidates). E.g. A > B > C > D > E could be my preference list.
For most election schemes, a voter is allowed exclude candidates from ... |
Ranked voting method where unranked candidates on a preference list aren't taken to be the least preferred? |
|sorting|permutations|partial-order|ordering|voting| |
I think I realized an answer. The [Schulze Method][1] traditionally uses **BI**. But it can be easily modified to use **POI** instead. All that needs to be done is, when counting how many pairwise preferences there are for candidate A over B, instead of using **BI** (unranked = preferred less), you use **POI** (unranke... |
Is the *clique decision* problem in *co-NP*?
**Definitions**:
"In the *clique decision problem*, the input is an undirected graph and a number k, and the output is a Boolean value: true if the graph contains a k-clique, and false otherwise." (https://en.wikipedia.org/wiki/Clique_problem)
"A decision problem is... |
Is the clique decision problem in co-NP? |
|complexity-theory|graphs|clique|co-np| |
You are all familiar with the halting problem so I won't repeat it.
Suppose $H$ is a Turing machine which takes as input an encoding of another Turing machine $M$, then searches all possible proof strings until it finds a proof that $M$ halts or a proof that $M$ does not halt. *Of course, if there is no such proof t... |
Halting problem unsolvability leads to a contradiction - where's the mistake? |
First of all, despite claims by several people here, there are models of computation which support computation on topological spaces. The "countable vs. uncountable" distinction is a red herring, arising from being familiar only with notions of computation on discrete spaces. A good introductory text on the topic of co... |
AFAIK, there are no modelizations of physical systems with functions of infinitely many independent variables (which would be your generalization of *complete induction*, I guess).
Instead, models that predict the current value of a continuous signal based on previous "samples" (and some smoothness property) evoke o... |
Let's say that we have a decision problem $P$. Let's also say that $I_n$ is the set of all instances of size $n$ that exist for this problem, and that its cardinality is finite.
There is a sequence of bits that uniquely represents each instance (of that size) of the problem. Each of these sequences has $b(n)$ bits ... |
Given a boolean circuit that computes a boolean function, can we always find an equivalent circuit with optimal size? |
|complexity-theory|optimization|circuits|lower-bounds|boolean-complexity| |
The problem is $\Sigma_2^P$-complete, which means that it is hard -- it is even "harder" than NP-complete problems. In particular, there is unlikely to be any polynomial-time algorithm. See https://en.wikipedia.org/wiki/Logic_optimization#Boolean_expression_minimization.
However, there are many heuristic methods. ... |
null |
I have a matrix:
| -- | c1 | c2 | c3 |
|:--:|:--:|:--:|:--:|
| r1 | AA | BB | CC |
| r2 | CC | RR | BB |
| r3 | EE | DD | FF |
| r4 | KK | DD | EE |
| r5 | DD | GG | KK |
| r6 | PP | QQ | KK |
Each column in a row represents a namespace. I can reorder elements of each row (i.e., row `r1`):
- `[AA, BB, C... |
null |
null |
Assume that I have a bunch of bitsets (strings on $\{0,1\}$) of the same length, e.g.:
101110001
001001101
010101010
101001001
101010101
I want to find the largest set of bits (indices, not necessarily consecutive) that takes all possible values in these bitsets. In the example above:
... |
Faster finding of a subset of bits with all combinations |
|combinatorics|bit-manipulation| |
This is a very natural question, and it hinges on a logical subtlety: what exactly do you mean by "proof"? The only way you derive a contradiction is if there is some system $T$ such that (i) by "proof" you mean "proof in $T$" and (ii) the argument of your post goes through in $T$. However, one crucial assumption you'v... |
Assume that I have a bunch of bitsets (strings on $\{0,1\}$) of the same length, e.g.:
101110001
001001101
010101010
101001001
101010101
I want to find the largest set of bits (indices, not necessarily consecutive) that takes all possible values in these bitsets. In the example above:
... |
Faster finding of a subset of bits with all combinations in the bitstrings |
This is a very natural question, and it hinges on a logical subtlety: what exactly do you mean by "proof"? The only way you derive a contradiction is if there is some system $T$ such that (i) by "proof" you mean "proof in $T$" and (ii) the argument of your post goes through in $T$. However, one crucial assumption you'v... |
null |
This is a very natural question, and it hinges on a logical subtlety: when you describe the machine $H$'s behavior as
> search[ing] all possible proof[s] until it finds a proof that $M$ halts or a proof that $M$ does not halt,
what exactly do you mean by "proof"? The only way you derive a contradiction is if ther... |
null |
null |
null |
null |
I don't really understand why promise problems are classified differently than decision problems.
Consider this problem as an example. Given some real number between $0$ and $1$, determine if it greater than $\frac{1}{2}$ or not.
In this problem, that the real number is between $0$ and $1$. Let's say our alphabet... |
Why aren't promise problems just decision problems; can't we encode the promised inputs in the alphabet? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.