instruction stringlengths 0 29.8k ⌀ |
|---|
|turing-machines| |
From book "Fabric of reality" by David Deutsch.
> We know from quantum theory that all such variables are quantized, and therefore that, no matter how the computer works, the set of possible programs is discrete. Each program can therefore be expressed as a finite sequence of symbols in a discrete code or computer ... |
David Deutsch says "number of atoms in universe is finite", but then says "number of programs of all finite lengths is infinite". Contradiction? |
A good analogy would be the integers: There is an infinite amount of finite integers. We can prove that by contradiction: Let's say there was a largest finite integer $i$, then $(i+1)$ would be even larger and still finite. So there is no finite limit. A very similar argument can be made for computer programs by append... |
A good analogy would be the integers: There is an infinite amount of finite integers. We can prove that by contradiction: Let's say there was a largest finite integer $i$, then $(i+1)$ would be even larger and still finite. So there is no finite limit. A very similar argument can be made for computer programs by append... |
null |
I have been trying to solve the following problem. I have n intervals each with a cost.I want to choose a subset of the intervals that maximizes the cost but with the following constraint. Each interval when chosen uses one resource from a limited amount say k and when it finishes releases the resource to be used by an... |
null |
null |
null |
isn't this the same problem: https://stackoverflow.com/questions/2309752/why-is-anbn-n-0-not-regular
$if \,\,\,\, |x|=|y| \,\,\,\, then \,\,\,\ L = \{a^n b^n \mid n \geq 0\} $
|
null |
Push-relabel with 'highest label first' heuristic is considered state of the art for a long time. It has a theoretical running time of $O(n^2 \sqrt{m})$, but runs very fast in practice.
As far as I know, most algorithms that uses sophisticated data structures such as dynamic trees are outperformed in practice.
You ca... |
The part that I have problems with is showing the existence of an oracle for which:
- $NP^B \neq coNP^B$
The hint:
consider the language: $L_B = \{ 1^n : \forall x \in {0,1}^n, x \in B \} $
Having seen the proof for $P^B \neq NP^B$ my thought process goes along the line that I want to show the following:
... |
null |
(This is a somewhat fuzzy question.)
I believe that most of the "standard" complexity classes that one comes across in complexity theory are countably infinite, because they are defined in terms of decision problems that can be solved by Turing machines with certain prescribed capabilities, and the set of Turing mac... |
Are any "standard" complexity classes uncountably infinite? |
|complexity-theory|computability|complexity-classes|uncountability|infinity| |
Because the number of possible lengths is infinite.
---
Consider the set of all possible sequences of the 26 upper case letters of the English alphabet, for all possible lengths of such a sequence.
The possible symbols in each sequence in such a set are themselves a finite set. There are only 26.
The possib... |
null |
This is algorithms and data structures assignment and I have been thinking 3 days about it.
Given N intervals, each represented by two numbers - startpoint and endpoint, what is maximum intervals that can be covered after removing exactly K intervals. (Interval [1,8] covers 7 intervals on axis between points 1 and 8)... |
Dynamic Programming problem about intervals |
|algorithms|dynamic-programming|intervals| |
Nonuniform complexity class P/poly is uncountable. We can just choose for each input length its own circuit, so for any subset $S \subset \mathbb{N}$ the language $L_S = \{w \colon |w| \in S \}$ is in P/poly.
In general, nonuniform/advice complexity classes are usually uncountable for the same reason. |
I know that if decidability of A ∩ B and A ∪ B doesn’t
guarantee the decidability of any of A or B. We can prove that:
ATM is not decidable. Since decidable languages are closed under complementation, ATM' is also not decidable. But ATM ∪ ATM' = Σ∗ and ATM ∩ ATM' = φ both are decidable.
But what about recognizab... |
If A U B and A ∩ B are recognizable, then is at least one of A, A', B, B' also recognizable? |
|turing-machines|undecidability|sets|turing-recognizable| |
If A U B and A ∩ B are recognizable, then is one of A, A', B, B' also recognizable? |
The key distinction here is that a program is a concept. A concept is distinct from the place that concept is represented or stored.
You can have the same program represented by different physical chunks of matter. The program `print("Hello World")` is the same program whether it is stored on my computer or on your... |
A register in a CPU can be much more well utilized if it could be divided and its parts can be used independently. For example, if you need 8 8-bit values, you could just use a single 64-bit register, and each 8-bit segment could be treated independently of one another. But the way CPUs are designed, using 8 64-bit reg... |
Why aren't all smaller components of 64-bit registers accessible and readily usable? |
|cpu| |
I'm not sure how to solve this problem. Problem statement is: Consider the binary classification problem where X = R
d and Y = {0, 1}. Consider the
class of Binary classifiers given by intersection of three half-spaces.
Show that proper learning w.r.t. this class of intersection of three half-spaces (the
class F)... |
Computational Learning Problem: 3-DNF Reduction |
|np-complete|np|satisfiability|3-sat|learning-theory| |
To prove the that the halting problem is undecidable I was provided with 5 lemmas.
I understood each Lemma individually and also the proof itself. What I'm confused about is that one of the Lemmas seem like it didnt contribute to the proof at all. If someone could tell me if I have missed the importance of the Lemma t... |
Proof of the halting problem being undecidable |
|undecidability| |
A good analogy would be the integers: There is an infinite amount of finite integers. We can prove that by contradiction: Let's say there was a largest finite integer $i$, then $(i+1)$ would be even larger and still finite. So there is no finite limit. A very similar argument can be made for computer programs by append... |
Reed Solomon codes are cyclic. A cyclic code [over whatever Galois field] of length $n$ is defined with respect to reduction modulo $x^n-1$ to get the cyclic property.
Now, the generator polynomial $g$ and the parity check polynomials $h$ are defined by $g(x)h(x)=x^n-1,$ more exactly one is chosen and then the other... |
{"Voters":[{"Id":48921,"DisplayName":"kodlu"}],"DeleteType":1} |
null |
Then answer is no.
The language $A$ of Turing machines that halt on every input is not recognizable, but its complement $A^c$ is also not recognizable.
Then both $A \cup A^c = \Sigma^*$ and $A \cap A^c = \varnothing$ are recognizable, but neither are $A$ nor $A^c$. |
Suppose you chose $M_1 = \Sigma^*$. Could you find a $M_2$ that would fill the bill here? |
{"Voters":[{"Id":13107,"DisplayName":"Rick Decker"}],"DeleteType":1} |
null |
{"Voters":[{"Id":13107,"DisplayName":"Rick Decker"}]} |
I know that if decidability of $A \cap B$ and $A \cup B$ doesn’t
guarantee the decidability of any of $A$ or $B$. We can prove that:
ATM is not decidable. Since decidable languages are closed under complementation, ATM' is also not decidable. But $\textrm{ATM} \cup \textrm{ATM}' = \Sigma^*$ and $\textrm{ATM} \cap \... |
null |
I need help with this is possible. Could someone who has a good understanding of Linux and Windows explain how they differ in file implementation foxuing on low level end? There isn't a huge amount of literature on this, thanks. |
What are the main differences in file implementation between linux ext4 and wi dows 10 ntfs at low level? |
|operating-systems| |
I understood now (after ["program has a finite size"][1]) - this is "potential/unrealized vs actual/realized infinity" problem.
I, like Zeno in Zeno paradox with Achilles vs turtle, was thinking that something is an actual/realized infinity, while in reality it is potential/unrealized infinity.
Let me explain.
... |
From book "Fabric of reality" by David Deutsch.
> We know from quantum theory that all such variables are quantized, and therefore that, no matter how the computer works, the set of possible programs is discrete. Each program can therefore be expressed as a finite sequence of symbols in a discrete code or computer ... |
null |
null |
{"Voters":[{"Id":6553,"DisplayName":"Pseudonym"}]} |
I am reading a paper ([link][1]) in which an algorithm proposes a solution $\hat{\mathbf x}^{(t)}$ in each iteration $t = 1, \dots, T$, and each time, learns the true solution $\mathbf x^{(t)}$, so we learn whether the algorithm made a mistake, i.e. $\hat{\mathbf x}^{(t)} \neq \mathbf x^{(t)}$.
In Theorem 9, we lear... |
Expected number of mistakes grows logarithmically in number of iterations - improving performance? |
|algorithms|algorithm-analysis|asymptotics|big-o-notation| |
I have a large set $\mathbf{V}$ of vectors in $\mathbb{R}^d\setminus\{\mathbf{0}\}$ and need to find a vector $\mathbf{u}$ that maximizes $\sum_{\mathbf{v}\in\mathbf{V}}\mathbf{1}_{\mathbf{u}\cdot\mathbf{v}>0}$, which is to say the count of vectors in $\mathbf{V}$ that have a positive dot product with $\mathbf{u}$. Alt... |
Efficient algorithm for finding a vector to maximize the number of positive dot products with a given set (finding the maximum overlap of half-spaces) |
|algorithms|optimization|linear-algebra|mathematical-programming| |
The [Wikipedia page about interpreters][1] mentions the following three strategies
> 1. Parse the source code and perform its behavior directly
> 2. Translate source code into some efficient intermediate representation or object code and immediately execute that
> 3. Explicitly execute stored precompiled byt... |
Intermediate Representation vs Byte Code |
|interpreters| |
This is from just the summary of the article, and I'm not sure that it is a terribly helpful one.
What I think the author was trying to say is that the difference between 2 and 3 is *who* translates the source code into an intermediate representation. If that translation is done *ahead* of time (as you see in JVM la... |
If I understand your question correctly, you are describing a problem that is almost identical to the optimization problem in [Support Vector Machines](https://en.wikipedia.org/wiki/Support_vector_machine). The only difference is that in your case the separating plane is not offset from the origin, i.e. $b=0$. If a $u$... |
We know Insertion Sort would be faster than Merge Sort and Quick Sort for nearly sorted data. What about Binary Insertion Sort? At what case is it better than Insertion Sort?
Also, is there a better solution than Binary Insertion Sort, for the problem is solves better than Insertion Sort? |
At what case/problem, Binary Insertion Sort would be faster than Insertion Sort? |
|sorting| |
First, notice that binary insertion sort and insertion sort both do the same number of permutations between elements.
The main difference between the two is the number of comparisons. If comparisons are hard/time-consuming relatively to permutations, the binary insertion sort becomes interesting.
As an example, i... |
$b$ bits have a total of $2^b$ distinct bit-patterns. To store 8 *distinct values*, you need at least 3 bits.
This does *not* tell you on its own how many bits are required to store the number 8, because that depends on the way that you assign numbers to bit patterns.
A typical "unsigned integer" uses $b$ bits t... |
```The program is designed to start with values for x and y. The variables u1 and u2 are intended to represent x and y in ascending order. Provide suitable preconditions and postconditions for the program. Then, using Hoare logic, prove the correctness of the program. Specify all proof obligations and justify their... |
Hoare Logic: Identifying Hoare Triple given a simple function |
|algorithms|logic|discrete-mathematics|hoare-logic| |
My question is simply this: is it possible to upper bound the output length of a **halting** turing machine? Ie for all inputs length $n$, is there some $f$ such that the size of output $|M(x)| = O(f(n))$?
On the one hand, it seems like yes because every halting machine will leave some finite string on the tape so s... |
null |
I am working through the exercises in the book "Term Rewriting and All That" and got stuck on question 2.3. The question reads: find a reduction $\rightarrow$ on $\mathbb{N}$ such that $\rightarrow$ is decidable, but it is undecidable for some $n$ in normal form. A friend and I came up with two different solutions. But... |
null |
The answer is yes! Fix your favorite flavour of Turing machines (for instance: non-deterministic Turing machines with a single tape), and fix both the input and output alphabet. Then for each $s \in \mathbb{N}$, there are finitely many machines with $s$ states (up to relabeling the states). Also, for each $n \in \mathb... |
I think there are two main reasons explaining the current design:
1. it is a historical choice that took into account the manufacturing process (hardware complexity and realization cost) which had to be reduced,
2. the architecture currently used allows you to do what you are asking for at a reasonable price, paid ... |
null |
I am trying to understand how the algorithm used by Flex works. I refer to the determinization procedure producing the output DFA. The algorithm is publicly available and contained in Flex's source code (`dfa.c:345`). However, I am experiencing several difficulties making out the idea behind it: this is mostly due to t... |
Flex's NFA Determinization Algorithm |
|regular-expressions|flex|determinization| |
We would need to choose a tree data structure that preprocesses $n$ elements in $O(n)$ and processes each of the $m$ order-statistics queries in $O(log\ n)$, leading to a complexity of $O(m\ log\ n + n)$. Notice when $m > n$, this will be less optimal than an alternative $O(n\ log\ n)$ solution. |
We would need to choose a tree data structure that preprocesses $n$ elements in $O(n)$ and processes each of the $m$ order-statistics queries in $O(log\ n)$, leading to a complexity of $O(m\ log\ n + n)$. Notice when $m > n$, this will be less optimal than a static $O(n\ log\ n)$ solution. |
My question is simply this: is it possible to upper bound the output length of a **halting** turing machine? I.e., is there a function $f$ such that for every halting machine $M$ and every input $x$ we have $|M(x)| \in O(f(|x|))$?
On the one hand, it seems like yes because every halting machine will leave some finit... |
All the classes you mention *are* classes of languages, formally, even if P and NP are often discussed in different (more sloppy?) terms. Note that terminology revolving around *decision problems* is equivalent to formal languages; the decision is always whether a word is in the given language, i.e. the problem is to s... |
This is Exercise 83 in Schöning's book "Logic for Computer Scientists". Similarly, the solution to this problem can be found in the original paper of Robinson. He gives an example with clauses $Q(a)$ and $\neg Q(x) \vee Q(f(x))$. |
I have a computer science problem that seems relatively simple.
1. We are given a number of 2D rectangles that we want to place next to each other on a 1D line (without rotating them). Their width is randomly and uniformly distributed between 0.1 - 10 units. The height is distributed as follows: 99% of elements are... |
Online Bin Packing in 1D with Order Constraint |
|packing| |
How do I calculate the complexity of this Algorithm below?
int i,j,k,s;
for(i=0; i < N-1; i++)
for(j=i+1; j < N; j++)
for(k=1; k < j; k++)
s = 1;
On |
Complexity of an algorithm with nested loops |
|time-complexity| |
How to learn DSA if you are already working as a software engineer and have decent knowledge about development. Only thing that makes me procratinate is going over theories behind different data structures. I thinkg solving problems is fun but the begineer phase is really boring and after a year i have almost forgotten... |
I want to start preparing for a job interviews for which i want to get a decent at solving DSA problems |
|algorithms|data-structures|dynamic-programming|greedy-algorithms| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.