instruction stringlengths 0 29.8k ⌀ |
|---|
null |
I want to transmit values over an error prone channel. When transmitting analog values, the precision degrades smoothly when the transmission becomes worse. But when transmitting binary integers, an error in the first bit has catastrophic consequences.
Now say I want to transmit an 8 bit integer, I could transmit 25... |
Binary codes with analog like qualities |
|error-correcting-codes| |
null |
I want to know how can I reduce Subset Sum or Partition problem to N3DM problem in which each set has exactly 3 elements and same sum.
N3DM Problem: https://en.wikipedia.org/wiki/Numerical_3-dimensional_matching |
reduction from partition to N3DM or balanced 3 partition problem |
|np-complete|np|p-vs-np|partitions|subset-sum| |
Is it possible to show, by reduction(Reduction in the length of the path and the running time), that for a Turing machine M and an input X, there exists a run in which M accepts X if and only if there is a path from the initial configuration in M's run on X to some accepting configuration |
Existence of a Path from Initial to Accepting Configuration in Turing Machine Runs: A Reduction-Based Proof |
|graphs|turing-machines|reductions|mathematical-programming|path| |
Consider the following schedule -
```
T1 T2
R(A)
W(A)
R(A)
W(A)
Commit
Commit
```
I understand that this schedule is non-recoverable, because if a failure occurs between the two commits, then we can't rollback the operations performed by T2, as they would already have been committ... |
How are blind writes recoverable in a transaction schedule? |
|database-theory|database-concurrency| |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2. Is it possible to show that the First-Fit-Decreasing algorithm computes an asymp... |
First-Fit-Decreasing algorithm for bin packing with bins of capacity 2 |
|algorithms|algorithm-analysis|approximation| |
Lets **assume P = NP**, so all problems in NP are decidable in polynomial time,
Therefore I can solve all problems in NP in polynomial claiming **P = NP = NPC**.
But then, how come Σ* belongs to P = NPC because I can't reduce the even length string language (as an example of a language that is not trivial) to Σ*?
... |
if P = NP, does it mean that P = NP = NP-complete? |
|complexity-theory|np-complete|p-vs-np|check-my-answer| |
null |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2. Is it possible to show that the First-Fit-Decreasing algorithm computes an asymp... |
No. Even assuming $\mathsf{P}=\mathsf{NP}$, it is not true that all the languages therein are $NP$-complete.
An example of a language that is in $P$ but it is not $NP$-complete (regardless of the $P$ vs $NP$ matter) is $\Sigma^*$. Indeed, there is no way to reduce any language $L \in \mathsf{NP} \setminus \{ \Sigma^... |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2. Is it possible to show that the First-Fit-Decreasing algorithm computes an asymp... |
No. Even assuming $\mathsf{P}=\mathsf{NP}$, it is not true that all the languages therein are $\mathsf{NP}$-complete.
An example of a language that is in $P$ but it is not $NP$-complete (regardless of the $P$ vs $NP$ matter) is $\Sigma^*$, as you noticed. Indeed, there is no way to reduce any language $L \in \mathsf... |
I wrote this c++ code for a operator precedence parser.
it works perfectly for expressions without parentheis.
Eg: `i*i+i` is accepted
```cpp
#include <iostream>
#include <string>
#include <unordered_map>
#include <stack>
#include <vector>
#include <fstream>
std::unordered_map<std::string, std::vector<s... |
How to handle parentheis in Operator Precedence Parser? |
|compilers|c++| |
The following reduction mapping should work.
For any input $M\in TM$ we define $M_f$ as follows:
For any $x\in\Sigma^*$,
1. If $x=0^n1^n$ for any $n\in \mathbb{N}$ then $M_f$ Accepts.
2. Else, we run simultaneously $M$ on all words $y\in\Sigma^*$ in Minlex order such that $|y|\geq|x|$. If $M$ Accepts, then $M_f$ ... |
What would Helman-JaJa listrank pseudocode be like? I tried looking around but all I found were "prosecode" descriptions (eg pp. 18-19 [here][1]) which I find kinda hard to follow.
[1]: https://eprints.ucm.es/id/eprint/11387/1/HugoDocument.pdf |
Parallel Algorithm Pseudocode: Helman-JaJa Listrank |
|algorithms|randomized-algorithms|parallel-computing|linked-lists|pseudocode| |
Suppose we have used First-Fit-Decreasing algorithm to open $\ell$ bins.
Consider any used bin except the last one. Name it $B$.
**Consider the moment the total piece size of $B$ became greater than $1$, when an item of size $u$ was added.** There are two cases.
- $u\le\frac23$.
Then all items after this i... |
When proving the non-computability of the Busy Beaver function by contradiction, people create machines that are able to calculate the Busy Beaver function, BB(n), and also write more than 1s than BB(k), where k is the number of states of such machines.
[Proof link]( https://en.wikipedia.org/wiki/Busy_beaver#Proof_f... |
Busy Beaver non-computability proof by contradiction |
|turing-machines|busy-beaver| |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2.
Is it possible to show that the First-Fit-Decreasing algorithm computes an as... |
First-Fit-Decreasing algorithm packs items of size at most 1 into bins of capacity 2 |
|algorithms|algorithm-analysis|approximation|greedy-algorithms|packing| |
Let $G$ be a CNF Grammar. It exists $K$ dependent to $G$ so that for each $w\in L(G)$ with length bigger than $K$, it can be written as $uv^nxy^nz \in L(G) \forall n\geq 0$.
My question is that this statement does not include the case of $|vxy|\leq K$. Should it be included for the theorem completeness, or is it red... |
Is this variation correct for pumping lemma to context free languages? |
|context-free|pumping-lemma| |
Consider the bin packing problem where we are given item sizes $a_1,\dots, a_n \in (0, 1)$, and all bins have capacity 2. The task is to pack the items in as few bins as possible, such that the total size of items in each bin is at most 2.
Is it possible to show that the First-Fit-Decreasing algorithm computes an as... |
I have briefly read through much of the [Interaction Combinators](https://www.semanticscholar.org/paper/Interaction-Combinators-Lafont/6cfe09aa6e5da6ce98077b7a048cb1badd78cc76) paper, and am looking at [this blog post](https://zicklag.github.io/blog/interaction-nets-combinators-calculus/) for some help, but they both j... |
What are the ports used for in a practical sense in the Interaction Net paradigm? |
|interaction-nets| |
I have briefly read through much of the [Interaction Combinators](https://www.semanticscholar.org/paper/Interaction-Combinators-Lafont/6cfe09aa6e5da6ce98077b7a048cb1badd78cc76) paper, and am looking at [this blog post](https://zicklag.github.io/blog/interaction-nets-combinators-calculus/) for some help, but they both j... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want this? First is... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want this? First is... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want this? First is... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want this? First is... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports are connected where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want ... |
The point of the principal ports is to indicate when a rewrite rule should be activated. In interaction nets, all rewrite rules start with two nodes with connected principal ports. If two ports are connected where one or both are auxiliary, then there will be no rewrite rules associated to that link. Why would we want ... |
null |
null |
null |
null |
Let $G$ be a CNF Grammar. There exists number $K$ dependent to $G$ so that for each $w\in L(G)$ with length bigger than $K$, we can be write $w=uvxyz$ such that $uv^nxy^nz \in L(G)\; \forall\,n\geq 0$.
My question is that this statement does not include the case of $|vxy|\leq K$. Should it be included for the theore... |
It is odd that your professor disseminated a very-weak and misleading version of pumping lemma for context-free languages. It is reasonable to suspect that there is some misunderstanding between the course and your professor, between your professor and you, or between you and your post (even after I have corrected one ... |
Briefly, it is correct and useless.
It is odd that your professor disseminated a very-weak and misleading version of pumping lemma for context-free languages. It looks there is some misunderstanding between the course and your professor, between your professor and you, or between you and your post (even after I have... |
In the context of surveillance, I am working on a project where the goal is to find an algorithm that determines a path along a polygonal area, connecting a root node to a target node, while maximizing the surveillance area covered within the polygon. The given inputs for my algorithm include a root node, a target node... |
Let $G$ be a CNF Grammar. There exists number $K$ dependent to $G$ so that for each $w\in L(G)$ with length bigger or equal than $K$, we can be write $w=uvxyz$ such that $uv^nxy^nz \in L(G)\; \forall\,n\geq 0$ and $|vy|\geq 1$.
My question is that this statement does not include the case of $|vxy|\leq K$. Should it ... |
Let $G$ be any CFG Grammar. There exists number $K$ dependent to $G$ so that for each $w\in L(G)$ with length bigger or equal than $K$, we can be write $w=uvxyz$ such that $uv^nxy^nz \in L(G)\; \forall\,n\geq 0$ and $|vy|\geq 1$.
My question is that this statement does not include the case of $|vxy|\leq K$. Should i... |
There is no deeper meaning from an interpretability perspective. Neural networks are, generally speaking, not interpretable. They are universal function approximators, which means they are a way to approximate any function. You don't have to care about how they approximate it, and you shouldn't expect any explanatio... |
*(Apologies if this kind of post is not allowed).*
I remember seeing a list of False Proofs when I was taking Discrete Maths and I found it to be very interesting and also helpful.
I'm going to be a UCA (undergraduate course assistant) for an algorithms course next semester (this is a theoretical sophomore/juni... |
Sneaky/Cool False Proofs |
|algorithms|np|proof-techniques|education| |
{"Voters":[{"Id":161065,"DisplayName":"Skynet"}],"DeleteType":1} |
{"Voters":[{"Id":161065,"DisplayName":"Skynet"}]} |
One of my favourites is the "brothers paradox":
https://en.wikipedia.org/wiki/Boy_or_Girl_paradox
I tell it as I learned it*, as follows:
in a village, each family has two children, elder and younger. The children are born with probability $\frac12$ for either boy or girl.
I knock on a door, and a boy opens it ... |
I have often seen among undergraduates that they believe that the heaps are constructed in $\Theta(n \log n)$ time.
The standard algorithm for that is to insert an element to a heap one after another. Each insertion takes $O(\log n)$ time. Atleast $n/2$ elements have heapify cost $\Theta(\log n)$. This gives overal... |
This one is regarding $\mathsf{FPT}$ time algorithm.
Suppose an algorithm has time complexity of: $\Theta((\log n)^k \cdot n)$.
Is it an $\mathsf{FPT}$ time algorithm in parameter $k$?
Well obviously no since the time complexity is not of the form $\Theta(f(k) \cdot n^{O(1)})$. This is what most of people th... |
This one is regarding $\mathsf{FPT}$ time algorithm.
Suppose an algorithm has time complexity of: $\Theta((\log n)^k \cdot n)$.
Is it an $\mathsf{FPT}$ time algorithm in parameter $k$?
Well obviously no since the time complexity is not of the form $\Theta(f(k) \cdot n^{O(1)})$. This is what most of people th... |
null |
False proofs that look correct |
IMO, the various symptom descriptions should be classified by a human and regrouped. Later, when an unknown expression is fed to the system, it should be scrutinized by an expert. For every group, you can choose a canonical representative or just a number. Better use the Hamming distance than a geometric metric, as the... |
null |
null |
An simple example that I can think of, which is commonly use as introductory topic in amortized analysis, is the analysis of dynamic table. The usual scenario is to analyze the total time needed to insert $n$ elements in a dynamic table with some initial capacity, say 1. Now each time the table is full, it will be resi... |
(Too long and formatting-heavy for a comment.)
For each of the false proofs you linked (https://imgur.com/a/SUT0cRX), here is my brief analysis of each. I've spoilered them in case you want to look at each one individually yourself before checking what I said. Please let me know in the comments if I made any mistake... |
Merge-sort can be done in linear time!
Indeed, the time complexity to sort a list or array of length $n$ verifies$^{(1)}$:
$$T(n) = T\left(\left\lfloor\frac{n}2\right\rfloor\right) + T\left(\left\lceil\frac{n}2\right\rceil\right)+ \Theta(n)$$
Let us prove by induction that $T(n) = \Theta(n)$:
- the base case i... |
(Too long and formatting-heavy for a comment.)
For each of the false proofs you linked (https://imgur.com/a/SUT0cRX), here is my brief analysis of each. I've spoilered them in case you want to look at each one individually yourself before checking what I said. Please let me know in the comments if I made any mistake... |
This one is classic.
$0$-$1$ Knapsack problem is polynomial time problem since there is [dynamic programming solution](https://en.wikipedia.org/wiki/Knapsack_problem#0-1_knapsack_problem) with running time $O(n W)$ time.
However, it is incorrect.
Note that the input size is $poly(n + \log W)$. Therefore, the... |
This one is classic.
$0$-$1$ Knapsack problem is polynomial time problem since there is [dynamic programming solution](https://en.wikipedia.org/wiki/Knapsack_problem#0-1_knapsack_problem) with running time $O(n W)$ time.
However, it is incorrect.
Note that the input size is $poly(n + \log W)$. Therefore, the... |
*(Apologies if this kind of post is not allowed).*
I remember seeing a list of False Proofs when I was taking Discrete Maths and I found it to be very interesting and also helpful.
I'm going to be a UCA (undergraduate course assistant) for an algorithms course next semester (this is a theoretical sophomore/juni... |
I have an exercise on paging and page tables that I can't get my head around.
So the data is: my virtual addresses are 32 bits long, 1 page is 1 KiB, 1 PTE is 32 bits big and 1 page table is 1 page.
And then the prof asks how many page table levels are needed for this addressing.
so my solution would be:
- I ... |
An excercise on Pagin and Page tables |
|virtual-memory|paging|page-replacement| |
I have been doing web/app development for a few years, primarily involving high-level programming and stuff. However, I am interested in jumping into some low-level stuff and genuinely understanding how computers work.
There are a lot of resources online that I found myself being overwhelmed by all the choices. Gene... |
I want to get into Operating Systems, where do I start? |
|computer-architecture|operating-systems|c|assembly| |
Consider the $k$-center problem where we are given an undirected, complete graph $G=(V, E)$, with a distance $d(u, v) \geq 0$ for each pair $u, v \in V$. Furthermore, we assume that the triangle inequality holds: for each triple $u, v, w \in V$ it is the case that $d(u, w) \leq d(u, v)+d(v+w)$. The goal is to find $k$ ... |
Hardness of the k-center problem with relaxed triangle inequality |
|algorithms|complexity-theory|np|approximation| |
It is odd that your professor taught you a weaker version of pumping lemma for context-free languages. I would believe it was unintentional.
------
As noted in the question, the condition $|vxy|\le K$ is included in the standard pumping lemma for context-free languages on [this Wikpedia page](https://en.wikipedi... |
What happens if we remove the length condition on the pumpable part in the pumping lemma for context free languages? |
|formal-languages|context-free|pumping-lemma| |
It is odd that your professor taught you a weaker version of pumping lemma for context-free languages. I would believe it was unintentional.
------
As noted in the question, the condition $|vxy|\le K$ where $v\ y$ is the pumpable part and $K$ is the pumping length is included in the standard pumping lemma for co... |
You can show hardness of approximation of any $\rho < 2c$.
Simply take the distance between non-adjacent vertices to be $2c$ and distance between the adjacent vertices to be $1$. Note that the graph should satisfy relaxed triangle-inequality, and it indeed does, given that $c \geq 1$. |
|algorithms|complexity-theory|np|approximation|clustering| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.