instruction stringlengths 0 29.8k ⌀ |
|---|
|computability|turing-machines|recursion|check-my-proof| |
It is correct.
Every infinite set has an undecidable subset, you can use the cardinality argument: $\aleph_0\leq C \implies \aleph_0 < 2^C$. In fact most of its subsets are undecidable.
The bad thing about this argument is that it doesn't give any information about how difficult the subset is. We usually want a... |
null |
The graph I consider has the valid words for vertices and edges correspond to one-letter substitutions. In this graph the Hamming distance never *overestimates* the distance but can underestimate it (e.g. between $aa$ and $cc$ in the set of valid words $\{aa,ab,bb,bc,cc\}$)
You don't need an actual graph, you just n... |
False. Consider the functions $f(n) = n$ and
$
g(n) = \begin{cases}
1 & \text{if $n$ is odd},
\\\
n^2 & \text{if $n$ is even}.
\end{cases}
$
|
Why is the worst scenario $\mathcal{O}\left(n^2\right)$ when using quicksort to find the median of a set of numbers?
- If your algorithm continually picks a number larger than or smaller than *all* numbers in the list wouldn't your algorithm fail? For example if the list of numbers are:
$S = (12,75,82,34,55,... |
I am not sure if I understood the problem setting correctly, but I think a breadth-first search works?
**Problem:** Given words $w$ and $w'$ from a dictionary $D$, is it possible to find a sequence of words $w_0,...,w_k$, such that each word is from $D$, $w_0=w$, $w_k=w'$, and $w_i$ and $w_{i+1}$ differ by exactly ... |
The graph I consider has the valid words for vertices and edges correspond to one-letter substitutions. In this graph the Hamming distance never *overestimates* the distance but can underestimate it (e.g. between $aa$ and $cc$ in the set of valid words $\{aa,ab,bb,bc,cc\}$)
You don't need an actual graph, you just n... |
null |
GREEDY will always find a reasonable solution, but not necessarily the optimal one. Simply put the largest object which will fit each time in the knapsack. Stop when no more objects will fit.
|
I am seeking a fast algorithm to compute the following function, a quantile of the [Poisson distribution](http://en.wikipedia.org/wiki/Poisson_distribution):
$$f(n, \lambda) = e^{-\lambda} \sum_{k=0}^{n} \frac{\lambda^k}{k!} $$
I can think of an algorithm in $O(n)$, but considering the structure of the series, ther... |
Fast Poisson quantile computation |
|algorithms| |
Quicksort is for sorting, the algorithm you refer to is a selection algorithm known as QuickSelect.
* Since you can only pick as pivot a number that is in the list case #1 never happens.
* Worst case is that you continually pick a number that partitions the list into 2 lists: A list with just one element and a list... |
Quicksort is for sorting, the algorithm you refer to is a selection algorithm known as QuickSelect.
* Since you can only pick as pivot a number that is in the list case #1 never happens.
* Worst case is that you continually pick a number that partitions the list into 2 lists: A list with just one element and a list... |
it's a well known statement that
"*Cryptographic security must rely on a secret key instead of a secret algorithm*."
I would like to ask about some details about it. *And which are their differences?*
I see the obvious thing that for a multi user system, generating a key is overwhelmingly easier than genera... |
Key secrecy vs Algorithm secrecy |
|algorithms|cryptography|security|encryption|key-exchange| |
I have trouble understanding the cyclic coordinate method. How does it differ with the [Hook and Jeeves method](http://en.wikipedia.org/wiki/Pattern_search_%28optimization%29) and the [Rosenbrock method](http://en.wikipedia.org/wiki/Rosenbrock_methods)?
From a past exam text:
> Describe the cyclic coordinate meth... |
Cyclic coordinate method: how does it differ from Hook & Jeeves and Rosenbrock? |
|algorithms|optimization|numerical-analysis| |
The distinction you want to make between the key and the algorithm proper is not based on whether most of the operation is contained in one or the other, but on where the complexity lies. I am not talking about algorithmic complexity here, but complexity in its everyday meaning: difficulty to understand and reason abou... |
I'm building an application which should suggest products for the users. I want to base my recommendation on different attributes, like location, weather, date, etc. Each of these attributes can have multiple values so the feature space I need to consider is huge.
I was thinking about two approaches to solve this prob... |
null |
|algorithms|numerical-analysis| |
|cryptography|security|encryption| |
Given a precision $ε>0$ you want to compute $f(n,λ)$. When $n≤m$, let $g$ be the error function, that is the difference, between the sum of the $m-1$ first terms and the actual value $f(n,λ)$.
$$g(n,λ,m)=e^{-λ}\sum_{k=m}^n\frac{λ^k}{k!}$$
You want to find a $m$ big enough to have $g(n,λ,m)≤ε$. Then you just have ... |
null |
null |
It is correct.
Every infinite set has an undecidable subset, you can use the cardinality argument: $\aleph_0\leq C \implies \aleph_0 < 2^C$. In fact most of its subsets are undecidable (and you can replace undecidable with any countable class of languages, e.g. c.e., [arithmetical][1], [analytical][2], ...).
The... |
I asked the same question a few years ago from one of the well-known experts in cryptography.
The more interesting point here is that you can think of the key to contain the algorithm's code and the algorithm being a simple Universal Turing Machine. Remember that we want to do is having a fixed algorithm for the cry... |
I asked the same question a few years ago from one of the well-known experts in cryptography.
The more interesting point here is that you can think of the key to contain the algorithm's code and the algorithm being a simple Universal Turing Machine (UTM). Remember that we want to do is having a fixed algorithm for t... |
null |
(i) If there were an algorithm that factored in polynomial time by means of examining each possible factor of a complex number efficiently, could one not also use this algorithm to solve unbounded knapsack problems since two factors can be viewed as one value, say within the set for the knapsack problem, and the other ... |
From FACTOR To KNAPSACK |
|complexity-theory| |
I am trying to study for a exam and i found a assignmet, that i cant solve.
Consider a board of $n$ x $n$ cells, where $n = 2k, k≥2$. Each of the numbers from $S = \{1,...,\frac{n^2}{2}\}$ is written to two cells so that each cell contains exactly one number.
How can i show that $n$ cells $c_{i, j}$ can be chosen... |
A probabilistic method |
|probability-theory|randomized-algorithms|probabilistic-algorithms|random| |
null |
|algorithms|probability-theory|randomized-algorithms|probabilistic-algorithms|random| |
null |
There are $n!$ way to choose numbers, different possible way of choosing cells such that we have at least two same cell is $2 \cdot (n-1)!$ and for $n\ge 4$, always $n! \gt 2\cdot (n-1)!$, so by Pigeonhole principle always there is a selection which has different numbers. |
|algorithms|combinatorics| |
There are $n!$ way to choose numbers, different possible way of choosing cells such that we have at least two same cell at most is $2 \cdot (n-1)!$ and for $n\ge 4$, always $n! \gt 2\cdot (n-1)!$, so by Pigeonhole principle always there is a selection which has different numbers. |
Consider the following sequence as your input:
$$n,n-2,n-1,n-3,n-5,n-4,n-6,n-8,n-7,n-9, .... , n-3 \cdot k - 2, n-3 \cdot k - 1, n-3 \cdot k - 3, ....$$
for simplicity assume $n = 3\cdot t + 1$, longest decreasing subsequence length will be $t$ and number of decreasing subsequence of length $t$ is $2^t$.
So nu... |
As it already turned out in the other replies, your suggestion does not effectively solve the Travelling Salesman Problem, let me please indicate the best way known in the field of heuristic search (since I see Dijkstra's algorithm somewhat related to this field of Artificial Intelligence).
A heuristic algorithm can... |
If the weights of the weighted 3-DIMENSIONAL-MATCHING problem are restricted to let's say, 1 and 2, is there a possibility to reduce this case to the unweighted 3-DIMENSIONAL-MATCHING problem?
(Because for the unweighted version, there is a (1.5+$\epsilon$)-approximation algorithm, for the weighted version, there is o... |
Weighted Maximum 3-DIMENSIONAL-MATCHING with restricted weights (Approx Algo) |
|algorithms|approximation| |
I have always understood the term "regular" to mean that it is based on a pattern repeating itself. After you have enumerated all strings of a certain length, you have seen them all. There will be nothing new afterwards.
(It is only a vague intuition of course.)
|
If the weights of the weighted 3-DIMENSIONAL-MATCHING problem are restricted to let's say, 1 and 2, is there a possibility to reduce this case to the unweighted 3-DIMENSIONAL-MATCHING problem?
(Because for the unweighted version, there is a (1.5+$\epsilon$)-approximation algorithm, for the weighted version, there is o... |
(1) NP-complete only contains problems that can be answer by Yes or No, which are called decision problems. So FACTOR is not a NP-complete problem even your reduction is correct. In fact, if your reduction were correct, it proves that FACTOR is NP-hard.
(2) If you want to prove the NP-hardness of FACTOR by reducing ... |
(1) NP-complete only contains problems that can be answered by Yes or No, which are called decision problems. So FACTOR is not an NP-complete problem even your reduction is correct. In fact, if your reduction were correct, it proves that FACTOR is NP-hard.
(2) If you want to prove the NP-hardness of FACTOR by reduci... |
There are $n!$ ways to choose cells(arbitrary), also different possible ways of choosing cells such that we have at least two same cell is at most $2 \cdot (n-1)!$ and for $n\ge 4$, always $n! \gt 2\cdot (n-1)!$, so by Pigeonhole principle always there are some selections with different numbers. |
|complexity-theory|np-complete|integers|knapsack-problems| |
|algorithms|graphs| |
Consider a board of $n$ x $n$ cells, where $n = 2k, k≥2$. Each of the numbers from $S = \left\{1,...,\frac{n^2}{2}\right\}$ is written to two cells so that each cell contains exactly one number.
How can I show that $n$ cells $c_{i, j}$ can be chosen with one cell per row and one cell per column such that no pair of ... |
Extracting non-duplicate cells in a particular matrix with repeated entries |
|combinatorics| |
There are $n!$ ways to choose cells. The number of different possible ways of choosing cells such that we have at least two cells with the same content is at most $2 \cdot (n-1)!$. For $n\ge 4$, this number always satisfies $n! \gt 2\cdot (n-1)!$, so by the pigeonhole principle there are always some selections with dis... |
As Kaveh says in a comment, Kleene bestowed the name way back when he kicked off automata theory and formal languages. I believe the term was arbitrary, though it has been many years since I read his original paper.
Mathematicians have a habit of hijacking common nouns and adjectives for mathematical objects and pr... |
Given three matrices $A, B,C$ $\epsilon$ $\mathbb{Z}^{(nxn)}$ we want to test whether $AB \neq C$. Assume that the arithmetic operations $+$ and $-$ take constant time when applied to numbers from $\mathbb{Z}$.
How can i state an algorithm with one-sided error that runs in $O(n^2)$ time and prove its correctness?
... |
One-sided error algorithm in O(n^2) (Fingerprinting) |
|algorithms|correctness-proof|matrices| |
Given three matrices $A, B,C \in \mathbb{Z}^{n \times n}$ we want to test whether $AB \neq C$. Assume that the arithmetic operations $+$ and $-$ take constant time when applied to numbers from $\mathbb{Z}$.
How can I state an algorithm with one-sided error that runs in $O(n^2)$ time and prove its correctness?
I ... |
Probabilistic test of matrix multiplication with one-sided error |
|probabilistic-algorithms|matrices|linear-algebra| |
Are there any known problems in NP that aren't NP Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
If there is a problem that is NP, but not NP Complete, would this be a result of no existing isomorphism between instan... |
Are there problems in NP that aren't NP Complete? |
|complexity-theory| |
null |
|algorithms|probabilistic-algorithms|matrices|linear-algebra| |
If $AB=C$, then $A(Bx)=Cx$ for all vectors $x$.
Generate vectors randomly and check. |
Are there any known problems in NP (and not in P) that aren't NP Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
If there is a problem that is NP (and not P) but not NP Complete, would this be a result of no existing ... |
Are there NP problems, not in P and not NP Complete? |
|complexity-theory|np-complete|p-vs-np| |
There are some problems which are NP, but no one knows there are NP-Complete or $P$ like [graph isomorphism][1]. But as I know there isn't special complexity class for such a problems, though may be I'm wrong.
May be it's $P$, e.g before [AKS][2] algorithm no one knows primality testing is $P$ or NPC.
Also there... |
There are some problems which are NP, but no one knows there are NP-Complete or $P$ like [graph isomorphism][1]<sup>1</sup>. But as I know there isn't special complexity class for such a problems, though may be I'm wrong.
May be it's $P$, e.g before [AKS][2] algorithm no one knows primality testing is $P$ or NPC.
... |
There are some problems which are NP, but no one knows there are NP-Complete or $P$, like [graph isomorphism][1]<sup>1</sup>. But as I know there isn't special complexity class for such a problems, may be I'm wrong, though.
May be it's $P$, e.g before [AKS][2] algorithm no one knows primality testing is $P$ or NPC. ... |
There are some problems which are NP, but no one knows they are NP-Complete or $P$, like [graph isomorphism][1]<sup>1</sup>. But as I know there isn't special complexity class for such a problems, may be I'm wrong, though.
May be it's $P$, e.g before [AKS][2] algorithm no one knows primality testing is $P$ or NPC.
... |
> Are there any known problems in NP (and not in P) that aren't NP Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
No, this is unknown (with the exception of the trivial languages $\emptyset$ and $\Sigma^*$, these two are... |
Normally in algorithms we do not care about comparison, addition, subtraction of numbers, we say they are $O(1)$, for example by this way, comparison based sorting is $O(n\log n)$, but if numbers are big we can't do this in registers, and normally we should implement it with string,... but this causes extra calculation... |
I am doing FFT-based multiplication of polynomials with integer coefficients (long integers, in fact). The coefficients have a maximum value of $BASE-1, \quad BASE \in \mathbb{n},\quad BASE > 1$.
I would like to put forward a formal argument that if we use complex DFT for computing a convolution on a physical machi... |
An argument for error accumulation during complex DFT |
|algorithms|proof-techniques| |
|algorithms|proof-techniques|numerical-analysis|fft| |
> Are there any known problems in NP (and not in P) that aren't NP Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
No, this is unknown (with the exception of the trivial languages $\emptyset$ and $\Sigma^*$, these two are... |
If the weights of the weighted 3-DIMENSIONAL-MATCHING problem are restricted to let's say, 1 and 2, is there a possibility to reduce this case to the unweighted 3-DIMENSIONAL-MATCHING problem?
(Because for the unweighted version, there is a (1.5+$\epsilon$)-approximation<sup>1</sup> algorithm, for the weighted version... |
null |
null |
As @Kaveh stated, this question is only interesting if we assume $P \neq NP$; the rest of my answer takes this as an assumption, and mostly provides links to further wet your appetite. Under that assumption, by Ladner's theorem we know that there are problems that are neither in $P$ nor $NPC$; these problems are called... |
Two most important fields that logic plays vital role are:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractable classes][2].
---
Seems needs some clarification, in formal languages you need to extremely work on logic, for clarification take a look at:
1. [Formal language][3].... |
As @Kaveh stated, this question is only interesting if we assume $P \neq NP$; the rest of my answer takes this as an assumption, and mostly provides links to further wet your appetite. Under that assumption, by Ladner's theorem we know that there are problems that are neither in $P$ nor $NPC$; these problems are called... |
Are there any known problems in $\mathsf{NP}$ (and not in $\mathsf{P}$) that aren't $\mathsf{NP}$ Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
If there is a problem that is $\mathsf{NP}$ (and not $\mathsf{P}$) but n... |
null |
There are $n!$ ways to choose cells. The number of different possible ways of choosing cells such that we have at least two cells with the same content is at most $n \cdot (n-2)!$. For $n\ge 4$, this number always satisfies $n! \gt n\cdot (n-2)!$, so by the pigeonhole principle there are always some selections with dis... |
Most of us know the correspondence between combinatory logic and lambda calculus (*cf.* http://en.wikipedia.org/wiki/Combinatory_logic). But I've never seen (maybe I haven't looked deep enough) the equivalent of "typed combinators", corresponding to the simply typed lambda calculus. Does such thing exist? Where could o... |
Is there a types SKI calculus? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.