instruction
stringlengths
0
29.8k
⌀
Relationship between cartesian product and dependent product type
|type-theory|dependent-types|
null
Lets introduce $[n] = \{1,...,n\}$ as a convenience type and look a function $f$ in $\Pi (i:[n]) X(i)$. Now $f[i]$ maps to $x_i \in X_i$. So we could think of $f$ as an ordered sequence/tuple: $f \simeq (x_1,...,x_n)$. Of course for different indexing types its not an ordered tuple in the "classical integer index" sens...
null
Lets introduce $[n] = \{1,...,n\}$ as a convenience type and look a function $f$ in $\Pi (i:[n]) X(i)$. Now $f[i]$ maps to $x_i \in X_i$. So we could think of $f$ as an ordered sequence/tuple: $f \simeq (x_1,...,x_n)$. Of course for different indexing types its not an ordered tuple in the "classical integer index" sens...
null
null
#define ptr uintptr_t int H(ptr p, ptr i); // simulating halt decider H Simulates its input until it correctly predicts that this simulated input would never terminate normally then rejects this input as non-halting. void P(ptr x) { if (H(x, x)) HERE: goto HERE; ...
Does H(P,P) correctly determine the halt status of the halting problem's pathological input?
Let $\Sigma$ be a finite alphabet. All strings below are over $\Sigma$. Definitions: If a string $s = vw$, then $v$ is a $\textit{prefix}$ of $s$ and $w$ is a $\textit{suffix}$ of $s$. For a language $L \subseteq \Sigma^*$, define $L_n \subseteq L$ to be the set of strings in $L$ of length $n$: $L_n = \{s \mi...
null
The question is: How long does it actually take to solve the problem given the compressed data as the input? Let’s say your original problem takes a square matrix with n elements as it’s input (that is sqrt(n) rows and columns) and your algorithm calculates a function of the diagonal in O(n^2). If you compress your...
As far as I know, XMM is used to store floating point. But Highest width floating point according IEEE754 standard is double precision (64-bit). But why XMM register width is 128-bit. Is another 64-bit space is wasted? If not, then what the purpose of another wasted part (another 64-bit)?
Why XMM register width is 128-bit while double precision floating point is 64-bit?
|cpu|floating-point|
First we factorise the integer and then we convert the problem to a multiset partition problem. The multiset partition problem can be solved by a backtracking algorithm. Given an integer $n$, let its factorization be $n=p^{a_1}_1\cdot p^{a_2}_2 \cdots p^{a_m}_m$ where $p_1, \cdots, p_m$ are distinc primes. We list a...
{"Voters":[{"Id":472,"DisplayName":"Juho"},{"Id":35842,"DisplayName":"Evil"},{"Id":91753,"DisplayName":"John L."}]}
Let $\Sigma$ be a finite alphabet. All strings below are over $\Sigma$. Definitions: If a string $s = vw$, then $v$ is a $\textit{prefix}$ of $s$ and $w$ is a $\textit{suffix}$ of $s$. For a language $L \subseteq \Sigma^*$, define $L_n \subseteq L$ to be the set of strings in $L$ of length $n$: $L_n = \{s \mi...
Let $\Sigma$ be a finite alphabet. All strings below are over $\Sigma$. Definitions: If a string $s = vw$, then $v$ is a $\textit{prefix}$ of $s$ and $w$ is a $\textit{suffix}$ of $s$. For a language $L \subseteq \Sigma^*$, define $L_n \subseteq L$ to be the set of strings in $L$ of length $n$: $L_n = \{s \mi...
null
Assume we have an algorithm consists of several (assume m and m<10) different algorithms each of which has time complexity $O(log N)$. Is the time complexity of our algorithm is $m*O(log N)$ or it is $O(log N)$. which one? Based on what I understand as the complexity is an approximation, the complexity is $O(log N)$ b...
having multiple $O(logn)$ means the complexity is $mO(log N)$?
|asymptotics|big-o-notation|
null
Complexity of multiple $O(\log N)$ is $m*O(\log N)$ or $O(\log N)$?
Assume we have an algorithm consists of several (assume m and m<10) different algorithms each of which has time complexity $O(\log N)$. Is the time complexity of our algorithm is $m*O(\log N)$ or it is $O(\log N)$. which one? Based on what I understand as the complexity is an approximation, the complexity is $O(\log N...
I am trying to understand why some combinatorial games are EXPTIME complete. In particular I would like to see a "direct" proof, where arbitrary exptime problems are encoded as instances of some combinatorial game. Hence I tried to read the original paper "Provably Difficult Combinatorial Games" by Stockmeyer and Chand...
It is very surprising to me that some combinatorial games such as generalized chess are EXPTIME complete. I have no idea why having a solver for a combinatorial game allows you to solve arbitrary exponential problems. The reason is that while I understand that such games can be solved in exponential time, they seem to ...
null
If $L_n$ contains $m$ words, then it is accepted by a DFA having at most $nm + 2$ states. The DFA has a state for each prefix of each word in $L_n$, together with a sink state. In particular, if $|L_n| = O(n^c)$, then the state complexity of $L_n$ is $O(n^{c+1})$. The following example shows that a loss of a factor ...
I'm embarking on my first adventure into the world of interactive proofs IPs. Reading through [Thaler's survey](https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.html), I became interested in IP transformations with respect to error. Since it's possible to transform an arbitrary IP with completeness error (≤ ...
Is there a useful analogy for understanding why only NP languages have IPs with perfect soundness?
|interactive-proof-systems|
This certain Khan Academy videos introduces the intuition about information entropy: https://www.youtube.com/watch?v=2s3aJfRr9gE&t=102s . It relates information entropy to the expected number of questions needed to be asked to determine the given letter produced by a certain machine according to certain way of asking s...
the principle behind asking the minimum amount of questions for determining information entropy
|information-theory|entropy|
Is there a useful analogy for understanding why only NP languages allow IP transformations to perfect soundness?
I'm embarking on my first adventure into the world of interactive proofs (IPs). Reading through [Thaler's survey](https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.html), I became interested in IP transformations with respect to error. Since it's possible to transform an arbitrary IP with completeness error (...
null
We have property $$O(f)+O(f)=O(f)$$ which means, that you can add big-$O$ fixed amount times and still get same. It's like your program have several consecutive parts with one and same complexity. Then all program have that complexity. As to second question, then you can try to prove following $$ O(n^{k}) + O(n^...
Given multiple sets of three items, how can I find the most-commonly occurring item among the sets using only one item from each set. The sets don't have duplicates, but if I'm thinking about this properly, it shouldn't matter. Example: (1,2,3), (5,3,6), (4,3,7), (8,7,9), (5,1,8) I want to see which number is the...
Algorithm to find number of occurrences in mutually exclusive sets
|algorithms|sorting|counting|
If $L_n$ contains $m$ words, then it is accepted by a DFA having at most $nm + 2$ states. The DFA has a state for each prefix of each word in $L_n$, together with a sink state. In particular, if $|L_n| = O(n^c)$, then the state complexity of $L_n$ is $O(n^{c+1})$. The following example shows that a loss of a factor ...
Concatenate all lists, and count which element appears the most times. Using a hash table, this can be implemented in linear time, and otherwise, you can obtain an $O(n\log n)$ algorithm (where $n$ is the total size of the lists) which sorts the concatenated list.
{"Voters":[{"Id":40909,"DisplayName":"David"}]}
The question [Is busy beaver the fastest growing function known to man?](https://cs.stackexchange.com/questions/4678/is-busy-beaver-the-fastest-growing-function-known-to-man) is answered negatively, pointing out that arbitrarily fast functions can be constructed. Is there a "reachable" lower bound for uncomputable f...
Is there a slowest growing uncomputable function?
|computability|
{"Voters":[{"Id":40909,"DisplayName":"David"}]}
You can also use a balanced BST to achieve $O(n \log n)$ running-time. Use as key of a node an element of a set. Along with the key is a counter that gets incremented when inserting an existing key. Once all elements are inserted, perform a traversal to find the node with the highest counter and return its key. If ...
The question [Is busy beaver the fastest growing function known to man?](https://cs.stackexchange.com/questions/4678/is-busy-beaver-the-fastest-growing-function-known-to-man) is answered negatively, pointing out that arbitrarily fast growing functions can be constructed. But is there a "reachable" *lower* bound for ...
|optimization|machine-learning|neural-networks|
I'm trying to solve a problem which I can solve in 3SAT or as a mixed 2,3,4 SAT. I know how hard each of those categories are individually and know the derivations of their hardness individually. But I don't see how those can be combined to give me an idea of comparative hardness of 3SAT vs 2,3,4 SAT. By how hard, I me...
I'm trying solve a problem using different versions of SAT, how exactly does mixing SAT affect the hardness of the problem?
|complexity-theory|complexity-classes|3-sat|2-sat|
null
This question is chapter 5, problem 33 (5.33) from Michael Sisper's Introduction to the Theory of Computation: >Let $S = \{\langle M\rangle | M \text{ is a TM and } L(M) = \{ \langle M\rangle\}\}$. Prove that neither $S$ nor $\overline{S}$ is Turing-recognizable. I think the statement can be proved via a contrad...
Yes of course it can get stuck in a local optimum. The idea is that hopefully we get closer to the global optimum, and if we get stuck in a local optimum, hopefully it'll be close to the global optimum... or maybe even exactly in the global optimum. It's important to understand that there are no guarantees. Simulat...
I have a string $a_0a_1..a_{n-1}$ Lets say we split the sting at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+1}....a_{n-1}$ Now I need to compute: $max(LCS($a_0a_1....a_{i}$ , $a_{i+1}a_{i+1}....a_{n-1}$)))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we u...
Is it possible to find Longest common subsequence of all pair of splits of a string in better than $O(n^3)$?
|subsequences|string-matching|
I have a string $a_0a_1..a_{n-1}$ Lets say we split the sting at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+2}....a_{n-1}$ Now I need to compute: $max(LCS($a_0a_1....a_{i}$ , $a_{i+1}a_{i+1}....a_{n-1}$)))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we u...
I have a string $a_0a_1..a_{n-1}$ Lets say we split the sting at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+2}....a_{n-1}$ Now I need to compute: $max(LCS(a_0a_1....a_{i} , a_{i+1}a_{i+2}....a_{n-1})))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we use t...
I am stuck on the following question. > If $L$ is regular show that $\text{even}(L)$ is also regular. Here $\text{even}(L) = \{ \text{even}(w) : w \in L \}$, $\text{even}(w)$ is the string obtained by extracting from $w$ the letters in even numbered positions. For example, if $L=\{0, 01, 02, 0202, 12120\}$, then $\t...
I have a string $a_0a_1..a_{n-1}$ Lets say we split the sting at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+2}....a_{n-1}$ Now I need to compute: $max(LCS(a_0a_1....a_{i} , a_{i+1}a_{i+2}....a_{n-1}))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we use th...
I have a string $a_0a_1..a_{n-1}$ Lets say we split the string at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+2}....a_{n-1}$ Now I need to compute: $max(LCS(a_0a_1....a_{i} , a_{i+1}a_{i+2}....a_{n-1}))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we use t...
I have a string $a_0a_1..a_{n-1}$ Lets say we split the string at pos $i$, so the string are $a_0a_1....a_{i}$ and $a_{i+1}a_{i+2}....a_{n-1}$ Now I need to compute: $max(LCS(a_0a_1....a_{i} , a_{i+1}a_{i+2}....a_{n-1}))$ for all $i$ in $[0,n-1]$ common LCS algorithms takes $O(n^2)$ time. so if we use t...
null
This answer is on the **dynamic programming** algorithm to solve the problem. I think it's better to present it as a new answer, instead of attaching it to my previous answer about the backtracking algorithm. Define a *distinct* factorization as the factorization of distinct factors. Let the *order* of a factoriza...
> The sets don't have duplicates That fact massively simplifies the problem down to a simple histogram of all the elements across all sets. Nothing ever stops you from selecting all the `3`s for example, because each one must be in a different set. As the other answers point out, a histogram needs some kind of...
First we factorize the integer and then we convert the problem to a multiset partition problem. The multiset partition problem can be solved by a **backtracking** algorithm. Given an integer $n$, let its factorization be $n=p^{a_1}_1\cdot p^{a_2}_2 \cdots p^{a_m}_m$ where $p_1, \cdots, p_m$ are distinc primes. We li...
null
I am working at a Biomedical Center right now and my task is to track both pawns of rats and count the number of times they touch the glass surface. To elaborate. I have a setup that contains one glass cylinder and 4 cameras that record the rat at 4 perpendicular angles. I need to train a model to track the rat's le...
How to detect touching on a glass with Object Tracking?
|algorithms|machine-learning|
I am working at a Biomedical Center right now and my task is to track both pawns of rats and count the number of times they touch the glass surface. To elaborate. I have a setup that contains one glass cylinder and 4 cameras that record the rat at 4 perpendicular angles. I need to train a model to track the rat's le...
I can't seem to grasp the term of reduction that well. To explain I will take an example the problem of $$\sqrt{k} - clique $$ such that $$ k \leq \sqrt{V}$$ Solving by reduction with normal k-clique such as $k-clique \leq \sqrt{k}- clique$ The reduction would be function f, such that f(G,k,) = (G',k') whe...
Computational Complexity theory - Confusion about solving by reduction an NPC problem
|algorithms|complexity-theory|graphs|np-complete|
{"OriginalQuestionIds":[152719],"Voters":[{"Id":683,"DisplayName":"Yuval Filmus","BindingReason":{"GoldTagBadge":"computability"}}]}
null
`R3` denotes the content of the register R3. `[R3]` denotes the content of the memory at the address contained in R3. (This implies that the registers are able to store addresses.) This mechanism is call *indirect addressing*. Without it no serious program could be written and computers would be of little use. ----...
You can create a dictionary by looping all items in the set. New Item will be key and you can increase its value once it is appeared. In the diction if a new item which is appeared first time, you will add it to dictionary and make its value as 1. Finally, you can find out max value in its dictionary.
I think Steven's comment answers this sufficiently: 2SAT is in P, anything above that is NP-hard. By mixing it I just have two different NP-hard problems. How exactly 3SAT and 2,3,4 SAT differ in scaling probably depends on my algorithm.
I've been under the impression that RBM can be used for a variety of applications and a cursory search on google seems to confirm this. But I've heard from multiple people (including a peer reviewer) that they're not considered to be "good," whatever that means. Is there a limitation of RBMs that I'm not aware of? Is i...
Why are restricted Boltzman machines not considered useful?
|machine-learning|artificial-intelligence|boltzmann-machine|
Consider this homomorphism: $$ f(a)=a\ ,f(b)=bb,\ f(c)=ccc $$ Context free languages are close to revered homomorphism What is $$ f^{-1}(L)?$$ I hope that gives you a hint
Consider this homomorphism: $ f(a)=a\ ,f(b)=bb,\ f(c)=ccc $ Context free languages are close to revered homomorphism What is $ f^{-1}(L)? $ I hope that gives you a hint
lets choose $ z = (01)^n2^n(01)^n$ when $n$ is the constant of the lemma $ z = uvwxy,\ |vx|\geq1,\ |vwx|\leq n,\ uv^iwx^iy\in L$ The core concept is to prove that all possible disassemling is not pumpable for this $z$ case 1: $u=(01)^s, vwx = (01)^t,\ s,t\leq n,\ y=(01)^{n-t}2^n(01)^n \rightarrow uv^iw^ixy \no...
Most programming languages are Turing complete (finite memory blah blah blah), and when we design languages this is a goal. But is it really necessary? What algorithms do we typically use that *require* Turing completeness? And do most industry software actually require it? Like what can't pushdown automata do?
Is Turing completeness necessary?
|computability|pushdown-automata|turing-completeness|
I’ve been researching an optimal strategy of playing in mobile game of Ingress and came up with an interesting (for me) computational geometry problem. Statement of the problem: You’re given N distinct points on plane, and number M < N. Find a simple polygon with M vertices out of the given N points, that maximizes ...
Find simple polygon with most guards outside of it
|computational-geometry|polygons|
Updated Updated Updated Updated
Empirically, the performance of RBMs on many important tasks is (so far) not as good as other competing approaches. Answering "why" questions about why one model does better than other is very hard. We don't really understand why neural networks work as well as they do; but empirically we can measure their performa...