instruction
stringlengths
0
29.8k
⌀
It's common in machine learning papers to see things like $p(x,z|\theta)$ or $p(x|z)$. Where $x$ is usually the data vector, $z$ the latent vector and $\theta$ the model parameter, like network weights. However is there a way to make sense of these notations from measure theory's perspective? Perhaps $(x,z,\theta)$ ...
Latent variable model from measure theory perspective
|machine-learning|probability-theory|
If I understand correctly, the first incompleteness theorem implies that Turing complete formal languages must be either inconsistent or incomplete, i.e. that they must include statements that are contradictory or that cannot be proven or disproven using only the language itself. Alternatively, it can be stated in...
If a programming language has undefined behavior, does that mean it's incomplete, in the sense of the incompleteness theorems?
|formal-languages|programming-languages|logic|turing-completeness|incompleteness|
I wondered if, for a fixed integer k ≥ 3, the divisibility by k is in P/poly. How can I construct a boolean circuit for each n ∈ N, that takes as input an n-bit integer x and outputs whether 3|x? The Chinese Remainder Theorem and Little Fermat's Theorem can be of help here but I haven't figured out how I can const...
n (mod k) circuit
Here is some JS code that performs the n mod k operations. To visualize I generate all 8-bit representations and let them run through the function to output a truth table, outputting True if divisible by k and False otherwise. For higher bit-inputs one can adapt the code. function mod(n, k) { if (n < 0 |...
You don't need measure theory to understand that notation. Measure theory doesn't really add anything. That said: Yes, you can in the same way that you can understand probabilities via measure theory, regardless of whether they come from machine learning or anything else. See, e.g., https://math.stackexchange.com/...
Does the first incompleteness theorem imply that any Turing complete programming language must have undefined behavior?
It's given that the bandwidth-delay product defines the number of bits that can fill the link; while the sender can send (1+(2 * Bandwidth * Delay)) units before getting acknowledged for the first unit. Can anyone help me to realize the practical implication the phenomenon of filling the link will imply? What can be th...
No, it doesn't require that. These are two orthogonal issues. You can easily define a new programming language where you provide fully defined semantics for all operations; yet it can be Turing complete. For a concrete example, consider [Bitwise Cycle Tag](https://esolangs.org/wiki/Bitwise_Cyclic_Tag); it is Turing ...
If I understand correctly, the first incompleteness theorem says that any "effectively axiomatized" formal system which is consistent must contain theorems which are _independent_ of the axioms. In other words, there are models of the system where the theorem is provably true and others where it's provably false. ...
How is a video file read frame by frame without loading the entire video file in memory?
We are given an array of length $N$ and $Q$ queries (offline) where each query is a value $K$, for each query we need to count number of pairs in array with XOR $K$. If $N$ and $Q$ can both be upto $10^5$, is it possible to answer these queries better than traversing entire array for each query? An analogous vers...
XOR pair frequency queries
|counting|xor|fast-fourier-transform|
null
It's an apples and oranges comparison. When you want something to be truly random, you must use a TRNG. Examples include a lottery, or a secret/private key in cryptography. When you want something repeatable, you must use a PRNG. An example is a large secret keystream for XOR encryption, generated (imperatively: ...
The incompleteness theorem only applies to formal systems that can express a certain amount of arithmetic. In particular, they have to support statements of the form $\forall n\in\mathbb N. P(n)$, because the Gödel sentence has that form. If your formal system can only express statements of the form $P(n)$ for fixed $n...
I agree with you, the definition is incorrect. You are trying to prove that $\exists l.\text{0L-L(l)}\land\lnot CFL(l)$. This proof amounts at telling what $l$ is, to show (in separate branches) that it satisfies $\text{0L-L}(\cdot)$ and fails to satisfy $CFL(\cdot)$. You pointed out $L(S_C)$ satifies $\text{0L-L}$...
I thought about it a bit after posting the question and came up with a counter-example for the second (and wrong) assumption: L1 = { 0^p | p is a prime number} (Not a regular language), L2 = 0* (regular); Both the concatenations are regular since they become L1L2 = L2L1 = { 000* } ; Thank you all for the help and...
Having a *one-step* functional $G := (\lambda r.\lambda x.\ \dots r\dots)$ where $r$ is used for a "recursive" call, the corresponding recursive function denoted by the $\lambda$-term $R$ must fulfill $$R = G\ R = G(GR) = \dots $$ precisely because $r$ is used for the recursive call. Lambda terms have no na...
null
I'm reading a [paper][1] that involves an algorithm for RSGD. It's clearly a form of stochastic gradient descent, but I can't find what the R stands for. The authors provide their own implementation of it, and I would like to find its original formulation to compare. [1]: https://papers.neurips.cc/paper_files/pa...
What does RSGD stand for?
|gradient-descent|
It's probably Riemannian stochastic gradient descent (R-SGD), (Stochastic Gradient Descent on Riemannian Manifolds). You'll find several articles on the subject by searching for this term.
If you want ro prove that L-complement is RE, you can construct a TM which enumerates L-complement. L-complement contains the M's which are not some Turing machine's code or they are code of Turing machines that accept some input which is not in the form of 0'1' . If such an input exists, It can be computably found. So...
Actually Mapping reduction is the reduction that can do that. Mapping reduction is defined as A is many reducible to B if there is some computable((recursive))function say f such that For all x, x belongs to A if and only if f(x) belongs to B. It can be proved that in many one reducability if B is r.e, then so is...
One possible answer can be that an enumerater program for a set say A is actually made of two other program: One is the program that computes A'enumerating function((a total function which its range is A)). Let's call this function f. So it is a program that takes some natural number say m and returns f(m) Th...
How can I prove that BPP is close to Symmetric difference? I tried to find proof online but couldn't. Can anyone please provide a quick explanation (if it's trivial and I just can't see it) or a link to proof?
BPP is closed to Symmetric difference?
|complexity-theory|
I am a math undergrad and we have algorithms as one of our courses. We came across TSP and algos to solve them. I thought of an algorithm and apparently its already known as the Nearest Neighbour algorithm. Could anyone tell why it might lead to longer tours with instances (short numerical examples maybe) ? ***Thank...
Doubt on nearest-neighbour approach to solve TSP
|traveling-salesman|
Consider the following points on a line, where $0$ is the starting point: $0, 1, -2, 5$. An optimal tour has length $10$, while your algorithm produces a tour of length $1 +3+7+5 = 16$.
Consider the following points on a line, where $0$ is the starting point: $0, 1, -2, 5$. An optimal tour has length $14$, while your algorithm produces a tour of length $1 +3+7+5 = 16$.
Let $A, B \in BPP$, and let $\mathcal{A}$ (resp. $\mathcal{B}$) be an algorithm for $A$ (resp. $B$) with a probability of error of at most $\frac{1}{3}$. Given $x$ the following algorithm decides whether $x \in A \Delta B$ with a probability of error of at most $\frac{1}{3}$: - Perform nine independent executions o...
Try using (integer) linear programming. The matching problem can be expressed as a linear programming instance. In particular, you have a variable $x_{u,v}$ for each pair of variables joined by an edge, with the intended meaning that $x_{u,v}=1$ means $(u,v)$ is included in the matching and $x_{u,v}=0$ means it is ...
Let $A, B \in BPP$, and let $\mathcal{A}$ (resp. $\mathcal{B}$) be an algorithm for $A$ (resp. $B$) with a probability of error of at most $\frac{1}{3}$. Given $x$ the following algorithm decides whether $x \in A \Delta B$ with a probability of error of at most $\frac{1}{3}$: - Perform nine independent executions o...
I have this tiny program for finding largest prime divisor (taken from Code Review Stackexchange and written by user Altinak: https://codereview.stackexchange.com/a/74792): Here is my try to write it in pseudocode: ``` GLOBAL VARIABLE highest; // This function takes parameters n and f with 1 <= n and 2 <= f. ...
null
**Statement of problem** We have two sets of vertices, $V$ and $U$, each of which has a vector of attributes $A$. The set of edges $E$ is defined such that there is an edge $vu\in{E}$ between vertices $v$ with attributes $[a_1,a_2,...]$ and $u$ with attributes $[a'_1,a'_2,...]$ IFF a function $f([a_1,a_2,...],[a'...
*(The following sample code is written in Scala, but is hopefully understandable without Scala knowledge.)* If I understand Your question correctly You are looking for a faster alternative to the following $\mathcal{O}(n²)$ function: ```scala def countXorPairsV1( a: Array[Int], k: Int ): Long = var n = 0 ...
If I understand correctly, the first incompleteness theorem says that any "effectively axiomatized" formal system which is consistent must contain theorems which are _independent_ of the axioms. In other words, there are models of the system where the theorem is provably true and others where it's provably false. ...
null
null
For context, yesterday I posted https://cs.stackexchange.com/q/161643/131435. Part of what prompted me to ask that question in the first place is that, awhile ago, someone on the learnprogramming subreddit told me something about the reason C++ in particular has so much undefined behavior is because, for it to _not_ h...
What are the conditions necessary for a programming language to have no undefined behavior?
|programming-languages|undecidability|mathematical-foundations|decidability|incompleteness|
*(The following sample code is written in Scala, but is hopefully understandable without Scala knowledge.)* If I understand Your question correctly You are looking for a faster alternative to the following $\mathcal{O}(n²)$ function: ```scala def countXorPairsV1( a: Array[Int], k: Int ): Long = var n = 0 ...
The problem of statically detecting undefined behavior has nothing to do with undefinedness as such. It's just impossible to prove in general that programs in a Turing-complete language will do anything ([Rice's theorem](https://en.wikipedia.org/wiki/Rice's_theorem)). For example, if your `main` function looks like ...
Recent research work has shown that transductive learning/inference outperforms standard methods that were used before, where people embed features in a high dimensional space and then use the distance metric in that space to classify objects. This has been found in few-shot learning, other metric learning works, etc. ...
Transductive Information Maximization vs classification with feature embedding in higher dimensional spaces?
|optimization|machine-learning|probability-theory|classification|learning-theory|
For context, yesterday I posted https://cs.stackexchange.com/q/161643/131435. Part of what prompted me to ask that question in the first place is that, awhile ago, someone on the learnprogramming subreddit told me something about the reason C++ in particular having so much undefined behavior is because, for it to _not...
I was visiting the dynamic programming questions in the CLRS the other day, and I saw this problem. I think this can be solved in $O(nD)$. Let $C(i,j)$ be the minimum cost of producing a total of $1 \leq j \leq D$ machines at the end of $1 \leq i \leq n$ months. Since the production must meet the demand, if we have ...
null
First off, let's be clear on what "undefined behaviour" is. In just C alone (and this is the understanding inherited by C++), there are two possible meanings, depending on which version of the standard you choose. [The C89 standard][1], section 3.16, defines: > **undefined behavior**: Behavior, upon use of a nonp...
The invariant says that the current value of `n` is the initial value of `n` divided by all its factors in the sequence 2, 3, 5, 7, 11, 13, 17, 19... until `i`. Some of the numbers in this sequence are not primes, but their factors have been previously processed and simplified, so equivalently, we have `n` divided by a...
I want to relate **Turing completeness** to the **Halting Problem**. As far as I know we say something is turing complete (eg: a programming language) when it can compute any function and can do any task. But since **Halting Problem** can't be solved by any programming language so every programming language should ...
Can we ever achieve Turing completeness?
|turing-machines|programming-languages|halting-problem|turing-completeness|
The invariant says that the current value of `n` is the initial value of `n` divided by all its factors in the trial sequence 2, 3, 5, 7, 11, 13, 17, 19... until `i`. Some of the numbers in this sequence are not primes, but their factors have been previously processed and simplified, so equivalently, we have `n` divide...
In most video formats, the frame data is in fact stored in chronological order, for many reasons: * video recording to file * video streaming * avoiding slow file seeking on HDDs * ... In most video formats, most frames are stored as a difference to the previous frame (so-called [inter frames](https://...
The invariant says that the current value of `n` is the initial value of `n` divided by all its factors in the trial sequence 2, 3, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31... until `i`. Some of the numbers in this sequence are not primes, but their factors have been previously processed and simplified, so equivalently, we...
*(The following sample code is written in Scala, but is hopefully understandable without Scala knowledge.)* If I understand Your question correctly You are looking for a faster alternative to the following $\mathcal{O}(n²)$ function: ```scala def countXorPairsV1( a: Array[Int], k: Int ): Long = var n = 0 ...
> As far as I know we say something is turing complete (eg: a programming language) when it can compute any function and can do any task. No. A model of computation is *Turing-complete* if it can compute any function that *can be computed by a Turing Machine*. > But since Halting Problem can't be solved by any pr...
> So my question now is, what conditions need to be imposed on a Turing complete language in order to guarantee that all possible programs written in the language will have fully defined behavior determined by the language specification? 1. Enough time and attention to specify all possible behaviors in all corner ca...
*Disclaimer: Please double check everything in this answer, because I am no expert on the topic.* The Halting problem is not a necessary condition for Turing completeness. On the contrary: the Turing machine itself cannot solve the halting problem. If You did build a "machine" that *could* solve the halting problem ...
*Disclaimer: Please double check everything in this answer, because I am no expert on the topic.* The Halting problem is not a necessary condition for Turing completeness. On the contrary: the Turing machine itself cannot solve the halting problem. If You did build a "machine" that *could* solve the halting problem ...
*Disclaimer: Please double check everything in this answer, because I am no expert on the topic.* The Halting problem is not a necessary condition for Turing completeness. On the contrary: the Turing machine itself cannot solve the halting problem. If You did build a "machine" that *could* solve the halting problem ...
*Disclaimer: Please double check everything in this answer, because I am no expert on the topic.* The Halting problem is not a necessary condition for Turing completeness. On the contrary: the Turing machine itself cannot solve the halting problem. If You did build a "machine" that *could* solve the halting problem ...
First off, let's be clear on what "undefined behaviour" is. In just C alone (and this is the understanding inherited by C++), there are two possible meanings, depending on which version of the standard you choose. [The C89 standard][1], section 3.16, defines: > **undefined behavior**: Behavior, upon use of a nonp...
The C language may say "if you do X, then whatever the result is, is not a violation of the C Standard". "Whatever the result is" can include the result that you hoped for, some completely different result, your software crashing, or your program doing strange things. An example for this would be to write int a[...
Short answer: - no machine can solve the Halting problem, this is a mathematical impossibility. - a system is called Turing-complete when it is able to simulate a Turing machine. ---------- It is an easy matter to program a Turing machine in C. Strictly speaking, anyway, the simulation cannot be perfect bec...
According to the book " Operating Systems Concepts " , 9th edition, page 637, we have the following statement : > Rather than associating the columns of the access matrix with the > objects as access lists, we can associate each row with its domain. A > capability list for a domain is a list of objects together wi...
Protection in OS
|operating-systems|
null
null
> As far as I know we say something is turing complete (eg: a programming language) when it can compute any function and can do any task. No. A [model of computation](https://wikipedia.org/wiki/Model_of_computation) is [*Turing-complete*](https://wikipedia.org/wiki/Turing_completeness) if it can compute any *Turing-...
Lets look at a sample program Collatz_thingy(bigint n): seen = set() While not n in seen: seen.add(n) If n odd: n = 3n + 1 Else: n = n / 2 N_64 = Cast(n, int64) result = new char[5] result[N_64] = ‘x’ Return result ` In a language w...
null
Your intuition is incorrect. The analogies you're trying to draw are not there, even though it's understandable you would expect them. Programming languages can be defined as formal systems, but they are of a different kind than logic. Gödel's incompleteness theorems do not apply to them, because the formal systems...
> As far as I know we say something is turing complete (eg: a programming language) when it can compute any function and can do any task. No. A [model of computation](https://wikipedia.org/wiki/Model_of_computation) is [*Turing-complete*](https://wikipedia.org/wiki/Turing_completeness) if it can compute any *Turing-...
The problem of statically detecting undefined behavior has nothing to do with undefinedness as such. It's just impossible to prove in general that programs in a Turing-complete language will do anything ([Rice's theorem](https://en.wikipedia.org/wiki/Rice's_theorem)). For example, if your `main` function looks like ...
This is what is known as a modular inverse. The easiest way to think about this is to think of the multiplication table in modular arithmetic. Let's start with the modulus being a prime number, 5. $$\begin{array} {}\times{} & 0 & 1 & 2 & 3 & 4 \\ \hline 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 2 & 3 & 4 \\ 2 & 0...
null
The if-statement alone is fully Turing complete for any computation that can be performed, so while it would not be efficient or pretty you could write any program purely with if-statements. I think that a lot of the meaning around this term has kind of taken on a sort of extended meaning that is more like saying "can...
The if-statement alone is fully Turing complete for any computation that can be performed, so while it would not be efficient or pretty you could write any program purely with if-statements. I think that a lot of the meaning around this term has kind of taken on a sort of extended meaning that is more like saying "can...
> As far as I know we say something is turing complete (eg: a programming language) when it can compute any function and can do any task. No. A [model of computation](https://wikipedia.org/wiki/Model_of_computation) is [*Turing-complete*](https://wikipedia.org/wiki/Turing_completeness) if it can compute any *Turing-...
null
I believe its true but struggle to prove. I know NP=union over positive c's of RP(2^-(n^c)) and from here to prove that RP(1/2^n) contained in NP is immediate. the other side is the problem. I've tried the following: Given L in NP and a polynomial verifier V for L with polynomial P, to use a random Turing machi...
Is NP=RP(2^-n)?
|complexity-theory|np|probabilistic-turing-machines|
null