instruction
stringlengths
0
29.8k
⌀
Does Cutting Planes solve Pigeongole Principle for holes of different sizes?
|complexity-theory|proof-techniques|
Let $x_{ij}$ state that pigeon $i$ goes to hole $j$. One can axiomatize the pigeonhole principle as follows: 1. Booleanity: $0 \leq x_{ij} \leq 1$. 2. Pigeon axioms: for all $i$, $\sum_j x_{ij} \ge 1$. 3. Hole axioms: for all $j$, $\sum_i x_{ij} \le b_j$. Summing the pigeon axioms, we get $$ \sum_{ij} x_{ij} ...
null
I have been wracking my head around the understanding on how to calculate $N_{1}(f)$ and $N_{0}(f)$ from the communication matrix. **Definitions:**\ $N_{1}(f)$ = least cost of non-deterministic protocol that accepts $f^{-1}(1) = \{(x,y) : f(x,y) = 1 \}$ $N_{1}(f)$ = ceiling( log(number of rectangles needed to cove...
Nondeterministic Communication Complexity - How to Calculate it from Communication Matrix?
|complexity-theory|
I have been wracking my head around the understanding on how to calculate $N_{1}(f)$ and $N_{0}(f)$ from the communication matrix. **Definitions:**\ $N_{1}(f)$ = least cost of non-deterministic protocol that accepts $f^{-1}(1) = \{(x,y) : f(x,y) = 1 \}$ $N_{1}(f)$ = ceiling( log(number of rectangles needed to cove...
Here are the $\log n + 1$ rectanges that cover all 0s in the case of the Equality function: for all $i \in [\log n]$ and $b \in \{0, 1\}$, there is a rectangle $$ \{ (x,y) : x_i = b, y_i \neq b \} = \{ x : x_i = b \} \times \{y : y_i \neq b \} . $$
Here is a simple but somewhat interesting example: the equality function on $n+n$ bits. This function accepts two input binary strings of length $n$, and returns whether they are equal. Call the two inputs $x$ and $y$. The adversary's algorithm is as follows. When $x_i$ is queried, if $y_i$ is unknown, then we let t...
null
I have been wracking my head around the understanding on how to calculate $N_{1}(f)$ and $N_{0}(f)$ from the communication matrix. **Definitions:**\ $N_{1}(f)$ = least cost of non-deterministic protocol that accepts $f^{-1}(1) = \{(x,y) : f(x,y) = 1 \}$ $N_{1}(f)$ = ceiling( log(number of rectangles needed to co...
|complexity-theory|communication-complexity|
Communication complexity is a model of computation invented by Yao. In this model, two or more parties are cooperating in computing a function whose input is distributed among the parties. Their goal is to minimize the number of bits communicated. Interesting on its own, communication complexity also has many applic...
null
Questions about the amount of communication required to compute a function whose input is distributed between two or more parties
null
If L1 is non-regular because something at the start and L2 is non-regular because something at the end: L1 = a^n b^n a+ b+ ab, n >= 1 L2 = ab a+ b+ a^n b^n, n >= 1 then the intersection is ab a+ b+ ab and regular.
null
null
Let me first specify my question. I am looking for decision problems with polynomial algorithms but such that the simpliest or fastests verifiers do many computations. Here by verifiers I mean both YES and NO verifiers. It might be the case that this is too specific. By "verifiers with many computations" I mean verifie...
Examples of problems in P but with verifiers with many computations
|algorithms|complexity-theory|
There are none. For every problem in NP, there is a way to build a verifier such that the verifier is very simple and uses only trivial methods. Proof: Let $L$ be any language in NP. Then it has a verifier $V$, such that $x \in L$ iff $\exists y . V(x,y) = \text{true}$. We call $y$ the certificate or witness. ...
We know that the number of permutations possible for $n$ unique items is $n!$. We can uniquely label each permutation with a number from $0$ to $(n!-1)$. Suppose if $n=4$, the possible permutations with their labels are, ``` 0: 1234 1: 1243 2: 1324 3: 1342 4: 1432 5: 1423 6: 2134 7: 2143 8: 231...
I have been wracking my head around the understanding on how to calculate $N_{1}(f)$ and $N_{0}(f)$ from the communication matrix. **Definitions:**\ $N_{1}(f)$ = least cost of non-deterministic protocol that accepts $f^{-1}(1) = \{(x,y) : f(x,y) = 1 \}$ $N_{1}(f)$ = ceiling( log(number of monochromatic rectangle...
Problem: given a set of class and classroom,then given a set M of pair (a,b),which means it is valid assignment from class a to calssroom b(ex:(c,2),(c,3),(d,2),means calss c can be assigned to classroom 2 or 3,class d can only be assiged to classroom 2),each class can only be assign to a classroom at the same time,...
flow network,class and classroom matching
|graphs|network-flow|bipartite-matching|minimum-cuts|
null
null
I have a lossless compression algorithm that compresses randomized binary data at a constant of 28 bytes no matter the input size. Here is a run from 1000 generated bit sequence: Random Binary Data: 0b11000010111000110001111111101111111010101100010010101010110011011111000110100000000111010101011111110111000001000110...
The transition from state 2 to state 3 should be 0
null
Problem: > given a set of classes and classrooms, then given a set M of pairs (a,b), which means it is valid assignment from class a to classroom b(ex:(c,2), (c,3), (d,2), means class c can be assigned to classroom 2 or 3, class d can only be assigned to classroom 2), each class can only be assign to a classroom at ...
flow network, class and classroom matching
null
I'm working with sparse vectors represented as `index` (array of unsigned integers) and `coefficient` (array of floats with the same dimension). Suppose I have two vectors, `v1` of dimension `m` and `v2` of dimension `n`. Their product, `v12 = v1 * v2`, results in an `index12` array with dimension `m * n`. However...
What's the name of the genre of algorithms for efficiently collecting common factors?
|algorithms|optimization|reductions|sparse-matrices|
null
I'm working with sparse vectors represented as `index` (array of unsigned integers) and `coefficient` (array of floats with the same dimension). Suppose I have two vectors, `v1` of dimension `m` and `v2` of dimension `n`. Their product, `v12 = v1 * v2`, results in an `index12` array with dimension `m * n`. However...
null
null
## The Short Version of my Question ## The following two [regular expressions][1] represent two sets of strings. | REGEX | EXAMPLES OF STRINGS OF TEXT THAT MATCH THE REGEX | |--------------------|-------------------------------------------------------| | `I?D?A?H?O?` | “IDAHO”<br>“ID”<...
If a person accidentally deletes a few letters when they try to type "IDAHO" or "ILLIONOIS", then when is state name unclear or ambiguous?
|regular-languages|regular-expressions|
null
Historically, processors often increase in bit-size by powers of 2, such as 8-bit, then 16-bit, 32-bit, 64-bit. Although this has not always been the case, it is a well known trend. One benefit is backwards compatibility. Another is that components can be scaled by combining two 8-bit components into a 16-bit, and so o...
Mathematical benefit to use CPU/memory that increases by powers of 2 as 8-bit, 16-bit, 32-bit, 64-bit, etc?
|cpu|history|
I'm working with sparse vectors represented as `index` (array of unsigned integers) and `coefficient` (array of floats with the same dimension). Suppose I have two vectors, `v1` of dimension `m` and `v2` of dimension `n`. A complex/complicated product, `v12 = v1 * v2`, results in an `index12` array with dimension ...
I recently asked a question on [Stack Overflow][1] and found that I need to solve a 0/1 knapsack problem. However, the problem has evolved to one where the knapsack problem is only part of it. The problem is as follows I have a variable named *num_items* which determines the number of items in the knapsack. Each ite...
Minimizing leftover items in a 0/1 knapsack problem
|knapsack-problems|
I recently asked a question on [Stack Overflow][1] and found that I need to solve a 0/1 knapsack problem. However, the problem has evolved to one where the knapsack problem is only part of it. The problem is as follows: I have a variable named *num_items* which determines the number of items in the knapsack. Each it...
Given a binary $n \times n$ matrix, we would like to decide whether there is a row or a column which consists entirely of $1$s. The caveat is that after we read an entry of the matrix, it is erased. How much space do we need in order to solve this task? If entries do not get erased, the task can be solved in space $...
It’s beneficial if you can combine smaller units into a larger unit. Imagine you had 12 bit and 20 bit numbers. 20 bits could hold one 12 bit number and waste 8 bit. 24 bits could hold one twenty bit number and waste four bit. You’d need to go up to 60 bits to hold 5x12 or 3x20 bits. You wouldn’t have that problem ...
I'm working with sparse vectors represented as `index` (array of unsigned integers) and `coefficient` (array of floats with the same dimension). Suppose I have many vectors of different length, and I want to add them all, summing the corresponding coefficients for each unique index. I need to calculate it the fas...
null
null
I'm working with sparse vectors represented as `index` (array of unsigned integers) and `coefficient` (array of floats with the same dimension). Suppose I have many vectors of different length, and I want to add them all, summing the corresponding coefficients for each unique index. I need to calculate it the fas...
Given a binary $n \times n$ matrix, we would like to decide whether there is a row or a column which consists entirely of $1$s. The caveat is that after we read an entry of the matrix, it is erased. How much space do we need in order to solve this task? If entries do not get erased, the task can be solved in space $...
Answer: `I?O?`. Simple justification: neither D, A, nor H appear in ILLINOIS, so they cannot appear in the intersection. That leaves only I,O. Systematic solution: Let me teach you the general way to solve this kind of problem. Convert each regexp to a NFA, then compute the intersection of both NFAs using the p...
Your question was completely solved by Bentley and Yao, [An almost optimal algorithm for unbounded sorting](https://www.slac.stanford.edu/cgi-bin/getdoc/slac-pub-1679.pdf), and Beigel, [Unbounded searching algorithms](https://cis.temple.edu/~beigel/papers/unbounded-search-sicomp.PS.gz). They showed that if $f\colon \ma...
null
null
If I understand CHC correctly, simply typed lambda calculus corresponds to propositional logic. As HM allows polymorphic definitions by let-expressions, my guess is that it would correspond to a version of propositional logic where universal quantification over variables is allowed. But as polymorphism in HM is only al...
What logical system does hindley-milner correspond to, according to the curry howard correspondence?
|logic|type-theory|propositional-logic|types-and-programming-languages|curry-howard|
null
null
null
On the level of assembly code, having $2^k$ bits in a word is convenient for bit operations. The result is that if you have an assembly command like "set bit $i$ of register $r$", then $k$ bits of the opcode will be devoted to specifying $i$. If the number of bits is not a power of $2$, then either some opcodes are was...
On top of what everyone else has said, [bit shift circuits][1] are easier to design if the "shift amount" is a whole number of bits in size. [1]: https://en.wikipedia.org/wiki/Barrel_shifter
yes, if all probabilities are in form of $2^{-k}$ then the arithmetic encoding will be the same as huffman encoding. both achieving the expected length of $H(X)$ (entropy). In such conditions branching in arithmetic coding will be exact and behave the same way huffman coding does.
null
ERROR: type should be string, got "https://superuser.com/questions/1735122/why-are-most-of-the-common-processors-bit-counts-powers-of-2/1735399#1735399 and other answers discuss some of the engineering problems you'd have with e.g. 24-bit words on a byte-addressable machine. (24-bit DSPs use word-addressable memory) - some 3-byte words will span wider boundaries, differing in higher bits of the address. But CPU caches and memory systems really want to group binary addresses by ignoring some low bits, not by doing a full division.\r\n\r\nIn algorithm terms, this is optimization of `i / sizeof(int)` into a right shift for unsigned `i`, and `i * sizeof(int)` into a left shift.\r\n\r\nAnother algorithm where this is relevant is a bit-array: given an integer bit-index, you need to break that up into a byte index or word index, and a bit number within the byte (to use as a shift count).\r\n\r\n```\r\n#include <limits>\r\nint get_bit(unsigned int *bit_array, size_t n)\r\n{\r\n size_t element_idx = n / std::numeric_limits<unsigned int>::digits;\r\n int bit_idx = n % std::numeric_limits<unsigned int>::digits;\r\n unsigned chunk = bit_array[element_idx];\r\n return (chunk >> bit_idx) & 1;\r\n}\r\n```\r\n\r\nWhen [`numeric_limits<unsigned int>::digits`][1] is a power of 2, like 32 on typical C++ implementations, this unsigned division and remainder become simple right-shift and bitwise AND, like `n >> 5` and `n & 31`.\r\n\r\nThis wouldn't be the case for 24-bit `unsigned int`, for example, unless you choose to only use 16 of the 24 bits per `unsigned int`. Division by a constant `24` or `3` is not *very* expensive if you have a fast multiplier, but it's non-trivial.\r\n\r\nIn hardware it's even more significant: splitting a value into multiple fields is literally just wiring. But for `n%24`, the remainder depends on all 24 bits, not just the low 5 bits, as well as requiring some significant computation.\r\n\r\n\r\n\r\n\r\n [1]: https://en.cppreference.com/w/cpp/types/numeric_limits/digits"
Let $L$ be a language for which there exists some turing machine deciding it in at most $n^2$ steps. > Is it decidable whether a given turing machine $M$ decides $L$ and runs in at most $n^2$ steps? I expect the answer to always be "No", regardless of $L$, but I fail to see exactly how.
Deciding whether a turing machine decides a language L in at most n^2 steps
|undecidability|rice-theorem|
Here is a semi-algorithm. I don't know if it is a good one. If your conjecture is true, it always terminates. In particular, if a solution exists, it will find it; if no solution exists, it will run forever, searching for one. Let $p(x)$ be the original polynomial; it can be expressed in the form $$p(x) = \sum_S...
I had a discussion with a C++ developer on whether aborting a thread causes memory leaks. His opinion on how aborting a thread works was 1. all destructors of the stack objects of the thread to abort are executed by the C++ runtime 0. the C++ runtime calls the OS method to abort the thread 0. the kernel gets rid ...
Would it be possible to run destructors on when aborting a thread?
|threads|c++|program-correctness|
Here is the explanation in Sipser's. For step 3, why should we accept only when none of the markers lie on the accept state? If the alphabet of the language is {a,b,c}, and after the first iteration, let's say a, b lies on the accept state while c doesn't, meaning that c is not in the language. Thus, this language will...
Question about ALL-NFA in PSPACE
|complexity-theory|automata|space-complexity|
Here is the explanation in Sipser's. For step 3, why should we accept only when none of the markers lie on the accept state? If the alphabet of the language is {a,b,c}, and after the first iteration, let's say a, b lies on the accept state while c doesn't, meaning that c is not in the language. Thus, this language will...
What is the parameterized complexity of *Weighted-CNF-SAT*, when parameterized by the **number of clauses**? **Input:** A CNF formula $\phi$ with $m$ clauses and $n$ variables, and an integer $k$. **Parameter:** $m$ **Output:** Does there exist an assignment to $\phi$ with hamming weight $k$? When this prob...
The parameterized complexity of Weighted-CNF-SAT parameterized by the number of clauses
|complexity-theory|np-hard|satisfiability|3-sat|parameterized-complexity|
The class [$\mathsf{NPO}$](https://en.wikipedia.org/wiki/Combinatorial_optimization#NP_optimization_problem) is defined as optimization problems such that the corresponding decision problems defined with a threshold are in $\mathsf{NP}$. Let $A$ be an optimization problem and $B$ a decision problem associated to $A$...
Does $\mathsf{P} = \mathsf{NP}$ imply $\mathsf{PO} = \mathsf{NPO}$?
|algorithms|optimization|p-vs-np|
This problem is indeed undecidable, assuming that $n$ is not a constant but refers to the length of the machine's input. Consider the problem $P$ of, given a Turing machine $\mathcal{M}$, to decide if it runs in at most $|x|$ steps on every input $x$. Problem $P$ is undecidable. For any constants $c,c' > 0$, let...
I had a discussion with a C++ developer on whether aborting a thread causes memory leaks. His opinion on how aborting a thread works was 1. all destructors of the stack objects of the thread to abort are executed by the C++ runtime 0. the C++ runtime calls the OS method to abort the thread 0. the kernel gets rid ...
Would it be possible to run destructors when aborting a thread?
There are some $n$ people and $2 n$ items. Each person assigns a positive value to each item. The items should be allocated to the people, giving exactly 2 items to each person. The value of a person is the sum of values of the two allocated items. The goal is to maximize the minimum value of a person. For example, sup...
Max-min one-to-two matching