instruction stringlengths 0 29.8k ⌀ |
|---|
I don't quite understand what you mean by if (A) is decidable then it is a language in R, if you mean that A is regular and B is regular then the intersection of two regular languages is still regular.
However, if you mean that A is decidable and it isn't certainly regular then no. take for example:
$$A=\{a^nb^nc... |
I already asked this question over on [Mathematics][1] and got the suggestion to ask it here.
So I'm basically implementing a number type that can represent all fractions and was working on an algorithm to compute the decimal expansion for said fractions.
Let's say we have the reduced fraction $\frac{n}{m}$. For ... |
null |
null |
I'm looking for a book that contains the formal definition of sigma protocol (something like: *A sigma protocol for a relation $R$ and a challenge space $C$ is... that satisfies the properties of soundness..., completeness..., honest verifier zero-knowledge...*)
I keep finding books that gives an *example* of sigma ... |
Reference for the formal definition of sigma protocol |
|reference-request|cryptography|zero-knowledge-proofs| |
One such model of computation is explained in [this note](https://yuvalfilmus.cs.technion.ac.il/Courses/AlgebraicMethods/2017/PolySAT.pdf). In this model of computation, we are allowed to perform arithmetic operations, logical operations, and comparisons on integers of arbitrary precision. We encode Boolean functions $... |
A *complete $k$-CNF formula* on $n$ variables $(k\le n)$ is a $k$-CNF formula which contains all clauses of width $k$ or lower it implies.
Let us define the (Complete/Assign) 3-SAT problem: Given $F$, a complete 3-CNF formula on $n$ variables and $I$, a partial assignment of $l$ literals among $n$ (where $l\le n$).... |
Let $C_1 \lor \cdots \lor C_m$ be a 3CNF. We replace the clause $C_i = \ell_1 \lor \ell_2 \lor \ell_3$ with the clause $C'_i = \ell_1^{(i)} \lor \ell_2^{(i)} \lor \ell_3^{(i)}$, that is, with a clause which contains three literals, appearing only in that clause. For every variable $x_i$ and for every two clauses $C_j,C... |
Suppose there is an integer array $a_1,a_2,...,a_n$. Calculate the sum of average of all subarrays. For example, the sum of average of all subarrays of array $[1,3,5]$ is $1+3+4+\frac{1+3}{2}+\frac{3+5}{2}+\frac{1+3+5}{3} = 17$
I'm wondering does it exist an $O(n)$ algorithm? |
Sum of average of all subarrays |
|algorithms|discrete-mathematics| |
Suppose there is an integer array $a_1,a_2,...,a_n$. Calculate the sum of average of all subarrays. For example, the sum of average of all subarrays of array $[1,3,5]$ is $1+3+5+\frac{1+3}{2}+\frac{3+5}{2}+\frac{1+3+5}{3} = 18$
I'm wondering does it exist an $O(n)$ algorithm? |
**Hint:**
This sum is a linear combination of the array elements, with varying weights .
In the case of four elements,
$$a+b+c+d+\frac{a+b}2+\frac{b+c}2+\frac{c+d}2+\frac{a+b+c}3+\frac{b+c+d}3+\frac{a+b+c+d}4$$
$$a:1+\frac12+\frac13+\frac14$$
$$b:1+\frac22+\frac23+\frac14$$
and symmetrically for $c,d$.
... |
{"Voters":[{"Id":151199,"DisplayName":"nam mi"}]} |
{"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
if A is decidable,B reg is the intersection between A and B regular |
if A is decidable,B reg is the intersection between A and B decidable |
if A dec and B reg is the inters. between A and B decidable |
I'm wondering if a language (A) is a decidable language, meaning it is a language in R, and language (B) is a regular language, is the intersection between A and B regular? Why/Why not??? |
I'm wondering if a language (A) is a decidable language and language (B) is a regular language, is the intersection between A and B decdiable? |
null |
null |
null |
Decidability of intersection of regular languages |
I'm wondering if a language (A) is a decidable language, meaning it is a language in R, and language (B) is a regular language, is the intersection between A and B regular? Why/Why not??? |
Decidability of intersection of regular and decidable languages |
I'm wondering if a language (A) is a decidable language and language (B) is a regular language, is the intersection between A and B regular? |
proof that if L is Context-free language then exists n>0 $ n\in \mathbb{N} $ such that
>$ \forall z\in L $ that that sustains $ |z|\ge n $ exists a dissolution $ z=uvwxy $ that sustains
>$ I. |vwx|\ \ II.|x|+|v|\geq2 \ \ III.\forall i\geq 0 : uv^iwx^iy\in L$
HINT: n needs to be bounded $ n\leq 2^{2k}$ which giv... |
**This is an answer to "a solution for remained divided by 5 of a given integer".**
The problem is not with `output= input/5 - int(input/5)`, which is a correct way to get the fractional part of a number (alternatively, `input/5 - floor(input/5)`). The problem is with `output == 0.2`. Comparisons for exact equality ... |
**This is an answer to "a solution for remained divided by 5 of a given integer".**
The problem is not with `output= input/5 - int(input/5)`, which is a correct way to get the fractional part of a number (alternatively, `input/5 - floor(input/5)`). The problem is with `output == 0.2`. Comparisons for exact equality ... |
**This is an answer to "a solution for remained divided by 5 of a given integer".**
The problem is not with `output= input/5 - int(input/5)`, which is a correct way to get the fractional part of a number (alternatively, `input/5 - floor(input/5)`). The problem is with `output == 0.2`. Comparisons for exact equality ... |
Yes this is possible. For instance when the protocol sends several frames without waiting for the individual acknowledgements: if one of the frames gets lost it will be retransmitted out of order.
|
Let $C_1 \lor \cdots \lor C_m$ be a 3CNF. We replace the clause $C_i = \ell_1 \lor \ell_2 \lor \ell_3$ with the clause $C'_i = \ell_1^{(i)} \lor \ell_2^{(i)} \lor \ell_3^{(i)}$, that is, with a clause which contains three literals, appearing only in that clause. For every variable $x_i$ and for every two clauses $C_j,C... |
Problem solving is the art of finding the solution(s) from a problem statement. Theorem proving is the art of showing that a known solution is indisputably correct.
But if the given problem is to craft a proof, then theorem proving is an instance of problem solving. :-) |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
Strategy to designing grammar for a LR(1) parser |
|parsers| |
The idea is provided by [Yves Daoust](https://cs.stackexchange.com/users/16034/yves-daoust).
Here is the C++ code I implemented just now.
The input format is like
```
n
a_1 a_2 ... a_n
```
The modular number is $10^9+7$.
```cpp
#include<bits/stdc++.h>
using namespace std;
constexpr int mod = 1e9+7;
v... |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
I'm looking for a reduction $SAT\leq_p ONLY-TRUE$ like this:
$$\phi(x_1,...,x_n) \in SAT \Leftrightarrow f(\phi) \in ONLY-TRUE$$
$$\phi(x_1,...,x_n) \text{ satisfiable} \Leftrightarrow f(\phi) \text{ has only all true assignament}$$
Is this reduction possible?
|
reduction to boolean formula that has every variable assignament true |
|turing-machines|computability|reductions| |
$L = \{{a^{2n+1}b^{m+2}a^n | m \neq 2n}\}$
I tried to split $L$ in 2: when $m > 2n$ and $m<2n$, however both resulting languages are not context-free, so I did not find out anything about $L$.
The pumping lemma did not give any results either, because the string $a^{2p+1}b^pa^p$ for example can be pumped when $vw... |
Is the language L = {a^(2n+1)b^(m+2)a^n | m \neq context-free? |
|context-free|formal-grammars|pumping-lemma| |
Is the language $L = \{{a^{2n+1}b^{m+2}a^n | m \neq 2n}\}$ context-free? |
You can try multiplicative normalization (pixel brightness / mean brightness), or subtractive normalization *after transforming with a logarithmic LUT*.
|
null |
Let $(X_1,Y_1)$ and $(X_2,Y_2)$ be identically and independently distributed. Also consider $Z=X_1+X_2$. I am trying to prove the following inequality:
$$ H(X_2 \vert Y_1 Y_2 Z) \leq H (X_1 \vert Y_1)\leq H(Z \vert Y_1 Y_2).$$
I think I can show that middle term is the average of the other two. So now if I can s... |
Conditional entropies of sum relations |
|probability-theory|entropy| |
Suppose we have a directed, weighted graph, $G = (V, E, w)$, with non-negative weights. We define the weight of the shortest path different from the original definition.\
The weight of a path with at most 5 edges (including 5) will be defined as usual, meaning the sum of the edges weights. The weight of a path with at... |
Shortest path in a directed weighted graph |
|graphs|dijkstras-algorithm| |
I'm looking for a reduction $\mathrm{SAT}\leq_p \mathrm{ONLY}\text-\mathrm{TRUE}$ like this:
$$\phi(x_1,\dots,x_n) \in \mathrm{SAT} \Leftrightarrow f(\phi) \in \mathrm{ONLY\text-TRUE}$$
$$\phi(x_1,\dots,x_n) \text{ satisfiable} \Leftrightarrow f(\phi) \text{ is satisfied only by the all-true assignment}$$
Is such... |
Determining whether formula is only satisfied by the all-true assignment |
|reductions|np-hard| |
You can take this approach: <br>
**Step one:**<br>
Duplicate G's nodes 6 times to get a new graph with 6 levels $L_1,...,L_6.$
<br>
For $1\le i\le5$ and nodes $a,b: $ There will be an edge between $a \in L_i$ and $ b \in L_{i+1} $ if there was an edge between $a$ and $b$ in the original graph, and the weights will ... |
You can take this approach: <br>
**Step one:**<br>
Duplicate G's nodes 6 times to get a new directed graph with 6 levels $L_1,...,L_6.$
<br>
For $1\le i\le5$ and nodes $a,b: $ There will be an edge from $a \in L_i$ to $ b \in L_{i+1} $ if there was an edge from $a$ to $b$ in the original graph, and the weights wil... |
My vote goes to LZP. It's hilariously simple.
It should be drastically simpler and faster than anything that uses trees in any capacity, such as Huffman coding, LZW or practically every compression algorithm that remotely tries to achieve better compression. Compression ratios aren't great however, works better on l... |
null |
An instance of the Dominating Set problem is given by an undirected graph
$G = (V, E)$ and an integer $k$; it is a ‘yes’-instance if there is a subset of vertices $S ⊆ V$
with $|S| ≤ k$ such that for each $v ∈ V$ we have $v ∈ S$ or $u ∈ S$ for some ${u, v} ∈ E$.
I'm trying to show that if the degree of each verte... |
FPT algorithm for dominating set |
|graphs| |
I'm trying to prove that $\mathrm{HALF}\text-\mathrm{FALSE}$ is NP-hard, where $\mathrm{HALF}\text-\mathrm{FALSE}$ is the following problem:
> given a boolean formula $\phi(x_1,\dots,x_n)$, is there a satisfying assignament in which exactly $n/2$ variables have value false?
Now, i got the problem down if it was lik... |
I'm trying to prove that $\mathrm{HALF}\text-\mathrm{FALSE}$ is NP-hard, where $\mathrm{HALF}\text-\mathrm{FALSE}$ is the following problem:
> given a boolean formula $\phi(x_1,\dots,x_n)$, is there a satisfying assignament in which exactly $n/2$ variables have value false?
Now, i got the problem down if it was lik... |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
I'm trying to prove that $\mathrm{HALF}\text-\mathrm{FALSE}$ is NP-hard, where $\mathrm{HALF}\text-\mathrm{FALSE}$ is the following problem:
> given a boolean formula $\phi(x_1,\dots,x_n)$, is there a satisfying assignament in which exactly $n/2$ variables have value false?
Now, i got the problem down if it was lik... |
I'm trying to prove that $\mathrm{HALF}\text-\mathrm{FALSE}$ is NP-hard, where $\mathrm{HALF}\text-\mathrm{FALSE}$ is the following problem:
> given a boolean formula $\phi(x_1,\dots,x_n)$, is there a satisfying assignament in which exactly $n/2$ variables have value false?
Now, i got the problem down if it was lik... |
See the FPT algorithm in [Linear Time Algorithms for Finding a Dominating Set of Fixed Size in Degenerated Graphs](https://arxiv.org/abs/0806.4735). Since the proof applies for $k$-degenerate graphs, it also applies for graphs whose maximum degree is $k$. |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
null |
null |
Convert your formula into 3-CNF (not strictly necessary, I think). Duplicate every clause in the formula with new variables and every literal inverted. Then if there exists a satisfying assignment in the original formula one exists in the new one and exactly half of the variables are false. Clearly, if this HALF-FALSE ... |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
Is it better to think about tokens from right to left and perform right factoring on grammar for an LR(1) parser? As apposed to thinking about tokens left to right and doing left factoring on grammar for an LL(1) parser.
Example java import statement.
```
S1 -> S2 ;
S2 -> S5
S2 -> S3 id
S2 -> S4 *
S3 -> S5 a... |
The problem that I'm trying to solve goes like this:
A project is split into tasks. Each task takes a known number of days. Some tasks can be done at any time(lets call these simple tasks), others depend on other tasks that must first be done. Design an algorithm that can find the minimum number of days necessary to... |
Topological sort of minimum cost |
|graphs| |
null |
null |
It's not difficult to write grammars, and particularly not LR(k) grammars (despite all the claims to the contrary you'll find floating around). You should start by trying to write down a simple description of the language which reflects the actual structure of the language. In many cases, that's easier to do if you all... |
It's not difficult to write grammars, and particularly not LR(k) grammars (despite all the claims to the contrary you'll find floating around). You should start by trying to write down a simple description of the language which reflects the actual structure of the language. In many cases, that's easier to do if you all... |
Unlike the general halting problem, this problem does not require a mechanical procedure to generate a proof for each evaluation which can potentially depend on the procedure itself, but instead, it allows the proof to depend on the specific instance of evaluation. It is thus a much weaker version.
There are obvious... |
Is it provably true/false that for the evaluation of a given zero-place function, there exists a proof whether it halts or not? |
|logic|halting-problem|termination| |
Lets say a system has 1TB of memory and 4kB blocks. How many MB of memory do we need if we want to store a bitvector to represent the current memory allocation situation with a bitvector?
**Bitvector**: a string of concatenated 0s and 1s, where 0 means a block is free, 1 means it is already allocated.
The soluti... |
Bitvector for Memory Allocation |
|memory-management|memory-allocation| |
I'm trying to train some linear logistic regression models and I need regularization. My models contain around 4000 features.
I know that without regularization, a good rule of thumb is to have 10x the number of data points as the number of features.
Unfortunately I have on the order of 1000 examples. With high ... |
Is there a good rule of thumb for regularization constants? |
|machine-learning| |
##### Edit1: A standalone statement of my question
Given a computable function that takes no argument (maybe a better word would be a computational procedure?), we are interested in whether the evaluation of such function will terminate. My question is this:
Theoretically speaking, can we always find a proof of ... |
Is it provably true/false that for a given evaluation, there exists a proof whether it halts or not? |
##### A standalone statement of my question
Given a computable function that takes no argument (maybe a better word would be a computational procedure?), we are interested in whether the evaluation of such function will terminate. My question is this:
Theoretically speaking, can we always find a proof of the ter... |
##### A standalone statement of my question
Given a program that takes no argument (maybe a better word would be a computational procedure?), we are interested in whether the program will eventually terminate. My question is this:
Theoretically speaking, can we always find a proof of the termination/non-terminat... |
Is it provably true/false that for a program, there exists a proof whether it halts or not? |
##### A standalone statement of my question
Given a program that takes no argument (maybe a better word would be a computational procedure?), we are interested in whether the program will eventually terminate. My question is this:
Theoretically speaking, can we always find a proof of the termination/non-terminat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.