instruction stringlengths 0 29.8k β |
|---|
Let $M$ be a $(0, 1)$ matrix. We say two entries are neighbors if they are adjacent horizontal or vertically, and both entries are $1$'s. One wants to find minimum number of $1$'s to add, so every $1$ can reach another one through a sequence of neighbors.
Example:
100
000
001
Here we need 3 $1$'... |
null |
Looking for a list of informed search algorithms, also known as heuristic search algorithms.
I'm aware of:
1.best-first search
- Greedy best-first
- A *
Are there more best-first algorithm or other informed searches that are not best-first? |
If you model your problem with graphs, Your problem is [Steiner Tree problem][1]:
See [here][2] for simplest possible definition.
> Given a weighted graph in which a subset of vertices are identified as
> terminals, find a minimum-weight connected subgraph that includes all
> the terminals.
If you have a pro... |
If you model your problem with graphs, Your problem is at least as hard as [Steiner Tree problem][1]:
See [here][2] for simplest possible definition.
> Given a weighted graph in which a subset of vertices are identified as
> terminals, find a minimum-weight connected subgraph that includes all
> the terminals.
... |
The question's title suggests that some basic user interface inconsistencies may interest you:
Unix commands don't follow any particular syntax for specifying options and flags. For example, most commands use single letters preceded by '-' as flag: `cat -n some_file`, but exceptions like `tar tf some_file.tar` and `... |
IIRC my teacher said the inability to use `char *` variables in `switch` statements in C is a matter of inconsistency, but for me that was generality (completeness) issue. I think it's better to use "consistency" just in *your* algorithms or software design not in programming language itself (at least not in languages ... |
Would it be useful to propose that a universal analog system could be modelled by an infinite neural net i.e. Any other analog system input/output values can be replicated matched neural network for a given operation, and operations can be chained as required?
While I did formulate this thought on my own, a subseque... |
|education|reference-request|security|access-control| |
If you model your problem with graphs, Your problem is at least as hard as [Steiner Tree problem][1]:
See [here][2] for simplest possible definition.
> Given a weighted graph in which a subset of vertices are identified as
> terminals, find a minimum-weight connected subgraph that includes all
> the terminals.
... |
I will expand on my comment on the other question and propose a target function that ensures that no very small windows occur and that windows are not unnecessarily far away from screen edges. Let $\mathcal{W} = \{1,\dots,n\}$ a set of windows and $T = \mathcal{W} \to \mathbb{N}^4$ a tiling; if $T(W) = (x,y,w,h)$ windo... |
|algorithms|reference-request|artificial-intelligence|search-algorithms| |
NP-completeness of a spanning tree problem |
How to solve recurrences using the master theorem |
The theory of lattices, partially ordered sets all subsets of which have suprema and infima inside the set. |
|algorithm-analysis|asymptotics|recurrence-relation| |
This is the recursive formula for which I'm trying to find an asymptotic closed form by the [master theorem](http://en.wikipedia.org/wiki/Master_theorem):
$$T(n)=9T(n/27)+(n \cdot \lg(n))^{1/2}$$
I started with $a=9,b=27$ and $f(n)=(n\cdot \lg n)^{1/2}$ for using the master theorem by $n^{\log_b(a)}$, and if so $n... |
Solve a recurrence using the master theorem |
|algorithms|graphs|matrices| |
Let $M$ be a $(0, 1)$ matrix. We say two entries are neighbors if they are adjacent horizontal or vertically, and both entries are $1$'s. One wants to find minimum number of $1$'s to add, so every $1$ can reach another one through a sequence of neighbors.
Example:
100
000
001
Here we need 3 $1$'... |
I'm looking for a list of informed search algorithms, also known as heuristic search algorithms.
I'm aware of:
1. [best-first search](http://en.wikipedia.org/wiki/Best-first_search)
- Greedy best-first search
- [A* search](http://en.wikipedia.org/wiki/A*_search_algorithm)
Are there more best-first alg... |
Survey of informed search algorithms? |
null |
|algorithms|arrays|constraint-programming| |
Your problem is [EXPTIME-Compelete][1], assume input is as below:
$$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$ i... |
|algorithms|graph-theory|sequences| |
Your problem is [EXPTIME-Compelete][1], assume that input is as below:
$$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 ... |
Logic gates are an abstract device which can be implemented with electromagnetic relays, vacuum tubes, or transistors. These implemenations have been successful in computing in part because of various properties of chainability, durability, and size beyond their basic binary stability. They also work well because ele... |
I want to count the number of strings $s$ over a finite alphabet $A$, that contain no repeats, and by that I mean for any substring $t$ of $s$, $1< |t| < |s|$, there is no disjoint copy of $t$ in $s$. For exapmle, let $A=\{a,b\}$. Then $aaa$ *is* one of the strings I want to count, since for the substring $aa$, there... |
What is a formula for the number of strings with no repeats? |
|combinatorics|strings| |
I want to count the number of strings $s$ over a finite alphabet $A$, that contain no repeats, and by that I mean for any substring $t$ of $s$, $1< |t| < |s|$, there is no disjoint copy of $t$ in $s$. For exapmle, let $A=\{a,b\}$. Then $aaa$ *is* one of the strings I want to count, since for the substring $aa$, there... |
null |
I want to count the number of strings $s$ over a finite alphabet $A$, that contain no repeats, and by that I mean for any substring $t$ of $s$, $1< |t| < |s|$, there is no disjoint copy of $t$ in $s$. For exapmle, let $A=\{a,b\}$. Then $aaa$ *is* one of the strings I want to count, since for the substring $aa$, there... |
If you model your problem with graphs, Your problem is like [Steiner Tree problem][1]:
See [here][2] for simplest possible definition.
> Given a weighted graph in which a subset of vertices are identified as
> terminals, find a minimum-weight connected subgraph that includes all
> the terminals.
As you can s... |
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... |
Find-min in $O(1)$ with expected update time of $O(\sqrt{log\text{ }log\text{ }n})$
See the 2007 paper: [Equivalence between priority queues and sorting][1] by Mikkel Thorup.
Note: He refers to the 2002 article by Han & Thorup: [Integer Sorting in $O(n\text{ }\sqrt{log\text{ }log\text{ }n})$ Expected Time and Lin... |
If you model your problem with graphs, Your problem is like [Steiner Tree problem][1]:
See [here][2] for simplest possible definition.
> Given a weighted graph in which a subset of vertices are identified as
> terminals, find a minimum-weight connected subgraph that includes all
> the terminals.
As you can s... |
So, I encoutered this problem in examination:
>Consider the following marginal contribution net:
>a ^ b β> 5
>b β> 2
>c β> 4
>b ^ Β¬c β> β2
>Let be the characteristic function defined by these rules. Give the values of the
following:
>i) (β
)
>ii) ({a})
>iii) ({b})
>v) ({a, b})
>vi) ({... |
Solving problems related to Marginal Contribution Nets |
|artificial-intelligence| |
I got the following answer:
1. $(\emptyset)=0$
2. $(\{a\}) = 0$
3. $(\{b\}) = 2-2 = 0$
3. $(\{a,b\}) = 2+5-2 = 5$
4. $(\{a,b,c\}) = 5+2+4 = 0$
Consider a set $A\subseteq \{a,b,c\}$. Define a map $\phi_A:\{a,b,c\}\to\{\text{True},\text{False}\}$ as follows:
$$\phi_A(x) = \left\{ \begin{array}{l@{~~}l} \... |
So, I encoutered this problem in examination:
>Consider the following marginal contribution net:
> $\{a \wedge b\} \to 5$
> $\{b\} \to 2$
> $\{c\} \to 4$
> $\{b \wedge \neg c\} β> β2$
>Let $v$ be the characteristic function defined by these rules. Give the values of the
following:
>i) $v(\emptyse... |
I got the following answer:
1. $v(\emptyset)=0$
2. $v(\{a\}) = 0$
3. $v(\{b\}) = 2-2 = 0$
3. $v(\{a,b\}) = 5+2-2 = 5$
4. $v(\{a,b,c\}) = 5+2+4 = 0$
Here's a general approach to doing this calculation.
Consider a set $A\subseteq \{a,b,c\}$. Define a map $I_A:\{a,b,c\}\to\{\text{True},\text{False}\}$ as... |
So, I encoutered this problem in examination:
>Consider the following marginal contribution net:
> $\{a \wedge b\} \to 5$
> $\{b\} \to 2$
> $\{c\} \to 4$
> $\{b \wedge \neg c\} \to β2$
>Let $v$ be the characteristic function defined by these rules. Give the values of the
following:
>i) $v(\emptys... |
I got the following answer:
1. $v(\emptyset)=0$
2. $v(\{a\}) = 0$
3. $v(\{b\}) = 2-2 = 0$
3. $v(\{a,b\}) = 5+2-2 = 5$
4. $v(\{a,b,c\}) = 5+2+4 = 0$
Here's a general approach to doing this calculation.
Consider a set $A\subseteq \{a,b,c\}$. Define a map $I_A:\{a,b,c\}\to\{\text{True},\text{False}\}$ as... |
null |
null |
I got the following answer:
1. $v(\emptyset)=0$
2. $v(\{a\}) = 0$
3. $v(\{b\}) = 2-2 = 0$
3. $v(\{a,b\}) = 5+2-2 = 5$
4. $v(\{a,b,c\}) = 5+2+4 = 11$
Here's a general approach to doing this calculation.
Consider a set $A\subseteq \{a,b,c\}$. Define a map $I_A:\{a,b,c\}\to\{\text{True},\text{False}\}$ a... |
Here is the lattice, with higher-integrity values at the top.
$$
\begin{array}{ccc}
& (Clean, DataEntry) \\
(Dirty, DataEntry) && (Clean,Website) \\
& (Dirty,Website)
\end{array}
$$
The two middle elements are incomparable.
|
Here is the lattice, with higher-integrity values at the top.
$$
\begin{array}{ccc}
& (Clean, DataEntry) \\
(Dirty, DataEntry) && (Clean,Website) \\
& (Dirty,Website)
\end{array}
$$
The two middle elements are incomparable.
The paper [Lattice-based Access Control Models][1] by Ravi Sandhu gives a go... |
The way to view the lattice is by taking the two pieces one at a time. Firstly, you have the lattice:
$$
\begin{array}{c}
Clean \\
| \\
Dirty
\end{array}
$$
to capture that _Clean_ data has higher integrity than _Dirty_ data.
Similarly,
$$
\begin{array}{c}
DataEntry \\
| \\
Website
\end{array}
$$
ca... |
null |
* Insert: $\mathcal{O}(\log n)$
* Get-Min: $\mathcal{O}(1)$
* Extract-Min: $\mathcal{O}(1)$
Simple implementations of a priority queue (e.g. any balanced BST) can achieve these (amortized) running times by simply charging the cost of Extract-Min to insert, and maintaining a pointer to the minimum element. For exam... |
* Insert: $\mathcal{O}(\log n)$
* Get-Min: $\mathcal{O}(1)$
* Extract-Min: $\mathcal{O}(1)$
Simple implementations of a priority queue (e.g. any balanced BST, or the standard binary min-heap) can achieve these (amortized) running times by simply charging the cost of Extract-Min to insert, and maintaining a pointer... |
* Insert: $\mathcal{O}(\log n)$
* Get-Min: $\mathcal{O}(1)$
* Extract-Min: $\mathcal{O}(1)$
<h3>Amortized Time</h3>
Simple implementations of a priority queue (e.g. any balanced BST, or the standard binary min-heap) can achieve these (amortized) running times by simply charging the cost of Extract-Min to insert... |
Look at the accepted answer for this question on MathOverflow, [What techniques exist to show that a problem is not NP-complete?][1]. It answers the case when X=NP.
[1]: http://mathoverflow.net/questions/9221/what-techniques-exist-to-show-that-a-problem-is-not-np-complete |
Actually proving $X$ is not $PSPACE$-complete (under, say, polynomial-time reductions) would be extremely hard to do.
If $P=PSPACE$, then all non-trivial (i.e., not $\varnothing$ and not $\Sigma^{\star}$) and infinite problems in $PSPACE$ are $PSPACE$-complete under polynomial-time reductions. Since the existential... |
null |
L is a regular language over the alphabet $\sum = \{a,b\}$ The left qutient of L regarding $w \in \sum^*$ is the language
$$w^{-1} L := {v: wv \in L}$$
How can I prove taht $w^{-1}$ L is regular? |
regular inverse homomorphism |
|untagged| |
L is a regular language over the alphabet $\sum = \{a,b\}$. The left quotient of L regarding $w \in \sum^*$ is the language
$$w^{-1} L := \{v: wv \in L\}$$
How can I prove that $w^{-1}$ L is regular? |
L is a regular language over the alphabet $\sum = \{a,b\}$. The left quotient of L regarding $w \in \sum^*$ is the language
$$w^{-1} L := \{v: wv \in L\}$$
How can I prove that $w^{-1}$ L is regular? |
|formal-languages|regular-languages| |
Assume $M$ is a deterministic finite state machine accepting $L$. Feed the word $w$ into $M$, which will land you in some state $q$. Construct a new machine $M'$ which is the same as $M$ but has start state $q$. I claim that $M'$ accepts $w^{-1}L$.
_Now prove it._ |
Here is a partial answer:
If you remove the constraint $ i \lt k$ on each triple then your problem becomes the Non-Betweeness problem which is $NP$-complete and there are no known efficient algorithms for such problems. But with $i \lt k$ constraint, it forces some nice structure which can be utilized to find a poly... |
Here is a partial answer:
If you remove the constraint $ i \lt k$ on each triple then your problem becomes the Non-Betweeness problem which is $NP$-complete and there are no known efficient algorithms for such problems. But with $i \lt k$ constraint, it may force some nice structure which can be exploited to find a ... |
How to prove regular languages are closed under left quotient? |
|formal-languages|regular-languages|closure| |
So I thought this (though somewhat basic) question belonged here:
Say I have a graph of size 100 nodes arrayed in a 10x10 pattern (think chessboard). The graph is undirected, and unweighted. Moving through the graph involves moving three spaces forward and one space to either right or left (similar to how a chess kn... |
Shortest Path on an Undirected Graph? |
|graphs|search-algorithms|shortest-path| |
If the edges in the graph only represent valid moves between certain positions, using Dijkstra's would work just fine. However as the graph is unweighted (and as you noted) it would be overkill. A simple breadth-first-search will give the optimal answer. |
If the edges in the graph only represent valid moves between certain positions, using Dijkstra's would work just fine. However as the graph is unweighted it would be overkill. A simple breadth-first-search will give the optimal answer. |
If L is regular - How can I prove that L' is regular, too?
$L' := \{w \in L: u \in \sum^* \; and \; v \in \sum^+ with \; uv = w \; is \; u \notin \}$
can I draw a nondeterministic finite automata to prove this? |
regular-language prove with a NFA |
|automata|regular-languages| |
So, I'm trying to conceptualize something:
Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats:
1)movements on the graph are regulated by a circular cycle of length 48, in such a manner that:
> cycle{
>
> ... |
Modified Djikstra's algorithm |
|algorithms|shortest-path| |
Yes, if you can come up with any of the following
* [deterministic finite automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton) (DFA)
* [nondeterministic finite automaton](https://en.wikipedia.org/wiki/Finite_automaton) (NFA)
* [regular expression](https://en.wikipedia.org/wiki/Regular_expre... |
|formal-languages|combinatorics|strings|word-combinatorics| |
So, I'm trying to conceptualize something:
Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats:
1. movements on the graph are regulated by a circular cycle of length 48, in such a manner that:
> cycle{
>
> ... |
|algorithms|graphs|shortest-path| |
|algorithms|arrays| |
Yes, if you can come up with any of the following
* [deterministic finite automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton) (DFA)
* [nondeterministic finite automaton](https://en.wikipedia.org/wiki/Finite_automaton) (NFA)
* [regular expression](https://en.wikipedia.org/wiki/Regular_expre... |
|formal-languages|regular-languages|closure-properties| |
|algorithms|graphs|search-algorithms|shortest-path| |
|formal-languages|automata|regular-languages| |
If L is regular - How can I prove that L' is regular, too?
$\qquad \displaystyle L' := \{w \in L: uv = w \text{ for } u \in \Sigma^* \setminus L \text{ and } v \in \Sigma^+ \}$
Can I draw a nondeterministic finite automata to prove this? |
|formal-languages|automata|regular-languages|proof-techniques| |
Proof a language regular by giving an NFA? |
Yes, if you can come up with any of the following
* [deterministic finite automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton) (DFA)
* [nondeterministic finite automaton](https://en.wikipedia.org/wiki/Finite_automaton) (NFA)
* [regular expression](https://en.wikipedia.org/wiki/Regular_expre... |
> Let .5<Ξ±<1 be some constant. Suppose you are looking for the median
> element in an array using RANDOMIZED SELECT (as explained in
> lectures). What is the probability that after the first iteration the
> size of the subarray in which the element you are looking for lies is
> β€Ξ± times the size of the original arr... |
Randomized Selection |
|algorithm-analysis| |
I am studying different approaches for the definition of computation with continuous dynamical systems. I have been trying to find a nice introduction to the theory of ["State transition systems"](http://en.wikipedia.org/wiki/State_transition_system) but failed to do so.
Does anybody knows a modern introduction to t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.