instruction stringlengths 0 29.8k ⌀ |
|---|
For an academic question, I plan to design a medical diagnosis system. Given a description of symptoms, produce a list of probable diseases (with closeness matching). I'm having some trouble finding papers for getting started. Which algorithms and data structure should I consider? |
Data structure and algorithms for a medical diagnosis software |
|algorithms| |
Here's a possible reduction for $A_{tm} \le S_{tm}$.
Map input $\langle M,w\rangle$ to $\langle M', 0w1\rangle$ such that
> $M'$ on input $x$:
> 0. if $x$ can be written as $1x'0$ for some $x'$, accept. Otherwise,
> 1. if $x$ can be written as $0x'1$ for some $x'$, run $M$ on $x'$ and output the same.
>... |
{"Voters":[{"Id":39,"DisplayName":"Gilles"}]} |
I'm not really sure the how you would go about proving this language isn't regular with the pumping lemma:
$L= \{0^m 1^n | 2n \leq m \leq 3n, m,n \geq 0 \}$
Does this indicate that $S = 2$, so we start by by using a string $\geq 2$? |
|regular-languages|proof-techniques|pumping-lemma| |
I'm doing an exercise in my [book](http://www.amazon.com/Introduction-Languages-Theory-Computation-Martin/dp/0073191469/ref=sr_1_1?ie=UTF8&qid=1361736491&sr=8-1&keywords=introduction+to+languages+and+the+theory+of+computation), the question is to find a string of minimum length in $\{a, b\}^*$ not in the language corre... |
String of minimum length in $\{a, b\}^*$ not in a regular expression |
|regular-expressions| |
First, *the* string of minimum length might not be defined properly since it might not be unique.
Here is a way to find a string of minimum length:
1. Convert the regular expression to a nondeterministic finite automaton.
2. Convert the nondeterministic automaton into a deterministic one.
3. Use a breadth... |
your answers look good.
To do this properly, it might helpful to convert the expression into the equivalent language (i.e., using English words to describe it), however, for certain expressions this language will be very complicated.
Another "algorithmic" way is to convert it to a DFA/NFA, and then check all the ... |
Machine learning algorithms and techniques are very successful and best practice in this area (clustering and classification techniques could be uses). For example in [Machine Learning Techniques for AD/MCI Diagnosis and Prognosis][1] or [Medical decision support systems based on machine learning][2], thesis written by... |
The field of probabilistic graphical models is often used for medical diagnosis, and some tools have been implemented. See [this example](http://www.ifw-kiel.de/ifw_portal/konfer/esf-ifw/newtech06/diez_luque.pdf), for a start.
Also see [this](http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1560518/). |
It is totally **depends** on your hardware platform (For example [Nios® II][1] provides some instruction for managing caches). You should read the **instruction and assembly** language. Some processor provide you some instructions to manage cache in some level. for example [WBINVD][2] provides Write back and flush Int... |
I have this confusion. What is the local minimum of a complete binary tree? |
What is the local minimum of a complete binary tree |
|graphs|binary-trees| |
null |
I have this confusion. What is the local minimum of a complete binary tree?
Consider an n-node complete binary tree T, where $n = 2^d − 1$ for some d. Each node v of T is labeled with a real number xv. You may assume that the real numbers labeling the nodes are all distinct. A node v of T is a local minimum if the l... |
I have this confusion. What is the local minimum of a complete binary tree?
Consider an $n$-node complete binary tree $T$, where $n = 2^d − 1$ for some $d$. Each node $v \in V(T)$ is labeled with a real number $x_v$. You may assume that the real numbers labeling the nodes are all distinct. A node $v \in V(T)$ is a... |
Assuming I have shown part of the knowledge base in the clausal format:
[1] p1(banana).
[2] not p1(X) or p2(Y).
[3] p1(X) or not p3(F).
... and more rules.
Most of the books, would do something like this:
[1,2] {X=banana} p2(Y).
and more steps.
First question: is it equally cor... |
For pumping lemma proofs, we have to remember that only strings *longer* than the pumping length are guaranteed to be "pumpable" (if the language is regular). Unfortunately we don't (typically) know what the pumping length is, so we have to work a little more abstractly than picking a fixed length string.
In this ca... |
Just an additional note of possible use: the PLL(0) grammars == the strict deterministic grammars, perhaps an easier approach for both understanding and practical application. A nice description is in Parsing Techniques, 2nd Edition, pp354-357. |
null |
$ S -> 1A0A | 0A1A | 1A | 0A | \epsilon$ Does this count as right-linear grammer?
I know $1A$ does but what about $0A1A$?
Trying to construct a right linear grammer for language $10(0+1)^*10$ |
$ S -> 1A0A | 0A1A | 1A | 0A | \epsilon$ Does this count as right-linear grammer? |
|context-free| |
$ S -> 1A0A | 0A1A | 1A | 0A | \epsilon$ Does this count as right-linear grammer?
(where A is nonterminal)
I know $1A$ does but what about $0A1A$?
Trying to construct a right linear grammer for language $10(0+1)^*10$ |
$ S -> 1A0A | 0A | \epsilon$ Does this count as right-linear grammer?
(where A is nonterminal)
I know $0A$ is but what about $1A0A$?
Trying to construct a right linear grammer for language $10(0+1)^*10$ |
$ S -> 1A0A | 0A | \epsilon$ Does this count as right-linear grammer? |
I'll give some hints as plain text, do try to have a go at solving the questions with this help before revealing the spoilers.
The first part you should be able to answer very easily - check the definition of a linear grammar, how many non-terminals can be on the right-hand side of the production?
>! At most one,... |
I'm doing an exercise from my book that says:
>Let $r$ and $s$ be arbitrary regular expressions over the alphabet $\Sigma$. Find a simpler equivalent regular expression:
>a. $r(r^*r + r^*) + r^*$
>b. $(r + \Lambda)^*$
>c. $(r + s)^*rs(r + s)^* + s^*r^*$
The book doesn't cover how to simplify regular expr... |
Finding simpler equivalent regular expressions |
|regular-expressions| |
I have a quick question on the bubble sort algorithm.
Explain why the bubble sort algorithm does $\Theta(n^2)$ comparisons on an $n$ element list.
Can anyone tell me why this is I looked at Wikipedia page and it does not seem to tell me I know that because of its magnitude it takes a lot of work with large number... |
Why does bubble sort do $\Theta(n^2)$ comparisons on an $n$ element list? |
|algorithms|algorithm-analysis| |
A better approach would be to understand what words do these regular expressions represent. For example, what words are in $(r+\Lambda)^*$? They look something like $r_1r_2 \Lambda r_3 \Lambda = r_1r_2r_3$, where $r_1,r_2,r_3$ are generated by $r$. It seems that $\Lambda$ isn't making much of a difference. This should ... |
null |
|formal-languages|regular-languages|regular-expressions| |
|algorithms|machine-learning| |
|terminology|graphs|binary-trees| |
How to apply the pumping lemma to $\{0^m 1^n | 2n \leq m \leq 3n, m,n \geq 0 \}$? |
Is the grammar
$\qquad S \to 1A0A \mid 0A \mid \varepsilon$
a right-linear grammar? $A$ is a nonterminal here, $0$ and $1$ are terminals.
I know $0A$ is right-regular but what about $1A0A$?
Trying to construct a right-linear grammar for language $10(0+1)^*10$. |
Is this a right-linear grammar? |
|regular-languages|formal-grammars| |
|algorithms|algorithm-analysis|sorting| |
null |
I have a quick question on the bubble sort algorithm. Why does it perform $\Theta(n^2)$ comparisons on an $n$ element list?
I looked at the Wikipedia page and it does not seem to tell me. I know that because of its magnitude it takes a lot of work with large numbers. |
null |
Are there languages generated by linear grammer which aren't regular? |
Are there languages generated by linear grammar which aren't regular? |
|context-free| |
Of course. Look at the first example in [Wikipedia](http://en.wikipedia.org/wiki/Linear_grammar).
If you mean left-linear, or right-linear, then no - they are equivalent to REG. |
null |
I'm working on some exercises regarding graph theory and complexity.
Now I'm asked to give an algorithm that computes a transposed graph of $G$, $G^T$ given the adjacency matrix of $G$. So basically I just have to give an algorithm to transpose an $N \times N$ matrix.
My first thought was to loop through all rows ... |
Complexity matrix transposition |
|graphs|time-complexity|algorithm-analysis|linear-algebra|adjacency-matrix| |
|formal-languages|formal-grammars|context-free| |
The sequence you (correctly) identified sums up to $\frac{n(n-1)}{2}=\theta(n^2)$, which gives the runtime you were looking for.
I'm not sure what you are referring to by "leading constants". Do you mean you can ignore e.g. $1+2+3$ ? sure, but that will reduce $6$ from the complexity, which is clearly meaningless. O... |
Of course. Look at the first example on [Wikipedia](http://en.wikipedia.org/wiki/Linear_grammar):
$\qquad S \to aSb \mid \varepsilon$
is linear and generates $\{a^nb^n \mid n \in \mathbb{N}\}$, a [non-regular language](http://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular).
If ... |
null |
null |
null |
$PSPACE \subset R \subset \text{co-}RE = \Pi_1$. $PSPACE$ problems are decidable in finite time, since $PSPACE \subset EXP$. Languages in $R$ are decidable by a Turing machine, and $R=RE\cap\text{co-}RE$, and $\text{co-}RE$ is $\Pi_1$. This implies that any language in $PSPACE$ is also in $\Pi_1$, so the basic answer t... |
You can get a $\Sigma_2$ sentence for $\mathsf{P}=\mathsf{PSPACE}$, using the same technique as in the blog post, only replace $SAT$ by $QBF$. I doubt there is a known sentence of lower complexity. |
To say simply, can PSPACE problems be written as $\Pi_1$ formula? Or how can these problems be written in terms of (first-order) arithmetic hierarchy?
edit:also currently, by what arithmetic hierarchy formula can P=PSPACE be written?
and what would be the consequence of being able to write P=PSPACE as $\Pi_1$ for... |
Can P=PSPACE and PSPACE problems be formulated as $\Pi_1$ formula? |
|logic|computability| |
As already answered by sdcvvc, $\mathrm P=\mathrm{PSPACE}$ can be written as a $\Sigma^0_2$-sentence. On the other hand, if it is equivalent to a $\Pi^0_2$-sentence (let alone $\Pi^0_1$), then this fact does not relativize, by the same argument as in http://mathoverflow.net/questions/57348. |
I have to disagree slightly with what Shaull said, although it still comes out to the same big-theta run time. It is true that the first element in a reversely sorted list will have n-1 comparisons, but each suqsequent element will have one less. Leading to `sum of i, from i = 0 to n-1` number of comparisons, which sti... |
Is there a general method to solve the recurrence of the form:
$T(n) = T(n-n^c) + T(n^c) + f(n)$
or more generally
$T(n) = T(n-g(n)) + T(r(n)) + f(n)$
where $g(n),r(n)$ are some sub-linear functions of $n$. |
How to solve this reccurence? |
|recurrence-relation| |
null |
|complexity-theory|logic| |
Is there a general method to solve the recurrence of the form:
$T(n) = T(n-n^c) + T(n^c) + f(n)$
for $c < 1$, or more generally
$T(n) = T(n-g(n)) + T(r(n)) + f(n)$
where $g(n),r(n)$ are some sub-linear functions of $n$. |
Solving divide & conquer reccurences if the split-ratio depends on $n$ |
|proof-techniques|recurrence-relation| |
## Generating Functions $\newcommand{\nats}{\mathbb{N}}$
Every series of numbers corresponds to a [generating function](https://en.wikipedia.org/wiki/Generating_function). It can often be comfortably obtained from a recurrence to have its coefficients -- the series' elements -- plucked.
This answer includes the g... |
Sedgewick and Flajolet have done extensive work in [analytic combinatorics][1], which allows recurrences to be solved asymptotically using a combination of generating functions and complex analysis. Their work allows many recurrences to be solved automatically, and has been implemented in some computer algebra systems... |
As already answered by sdcvvc, $\mathrm P=\mathrm{PSPACE}$ can be written as a $\Sigma^0_2$-sentence. On the other hand, if it is equivalent to a $\Pi^0_2$-sentence (let alone $\Pi^0_1$), then this fact does not relativize, by the same argument as in http://mathoverflow.net/questions/57348. A combinatorial proof is giv... |
How to apply the pumping lemma to $\{0^m 1^n \mid 2n \leq m \leq 3n, m,n \geq 0 \}$? |
The sum divider game for $n$ starts with the set $M_0 = \{1,\dots,n\}$. Player A chooses a number $m_1$ from $M_0 \setminus \{1\}$ and B has to choose a divider $m_2$ of $m_1$ from $M_1 = M_0 \setminus \{m_1\}$. The players continue to choose a number $m_i$ from $M_{i-1} = M_{i-2} \setminus \{m_{i-1}\}$ alternatingly, ... |
null |
I am facing a problem with processing some frontal facial images.
I need to adjust the centers of the eyes (irises) to be at certain specific pixels in the image. In other words, i need to transform the image until the centers of the eyes are at specific pixels.
Can anyone help me with this problem, an algorithm,... |
How center the eyes of human face at specific pixels? |
|image-processing|computer-vision| |
Sometimes it's easy to identify the time complexity of an algorithm my examining it carefully. Algorithms with 2 nested loops of N are obviously N^2. Algorithms that explore all the possible combinations of N groups of 2 values are obviously 2^N.
However I don't know how to "spot" an algorithm with O(N log N) comple... |
What are the characteristics of an O(n log n) time complexity algorithm? |
|algorithms|time-complexity| |
|algorithms|time-complexity|algorithm-analysis| |
A complexity of $O(n\log n)$ arises from divide and conquer algorithms which divide their input into $k$ pieces of roughly equal size in time $O(n)$, operate on these pieces recursively, and then combine them in time $O(n)$. If you only operate on some of the pieces, the running time drops to $O(n)$. |
Typically, Divide-and-conquer algorithms will yield O(N log N) complexity. |
Those are typically algorithms of the "divide and conquer" variety, where the cost of dividing and combining subsolutions isn't "too large". Take a look at [this FAQ](http://cs.stackexchange.com/questions/2789/solving-or-approximating-recurrence-relations-for-sequences-of-numbers/2823#2823) to see what kinds of recurre... |
I currently have a system that has `{f(a) = b, f(f(x)) = x}` (part of an [exam question][1] - look at page 5 - exercise 1).
To start off with proving non-confluency, I am thinking along these lines:
f(f(x)) and f(a) can be unified by using {a -> f(x)}.
Then we can rewrite:
f(f(x)) = x ... |
Proving non-confluency and adding an equation to make it confluent and terminating |
|logic|proof-techniques|semantics|term-rewriting| |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.