instruction stringlengths 0 29.8k ⌀ |
|---|
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.).
I've formalized the p... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Has a Multitape Machine like this been Studied? |
|turing-machines|computability| |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t... |
>Find an asymptotic tight upper bound for the following recursion relation: $$T(n)=5T(\frac{n}{5})+\log^2(n)$$
I tried to solve it by applying iteration:
$$T(n)=5T(\frac{n}{5})+\log^2(n)=5(5T(\frac{n}{5^2})+\log^2(\frac{n}{5}))=\ldots=5^kT(\frac{n}{5^k})+\sum_{i=0}^{k-1}5^i\log^2(\frac{n}{5^i})$$ Now letting $5^k... |
Finding asymptotically tight upper bound of a recursion relation |
|computability|asymptotics|runtime-analysis|recursion|upper-bound| |
Your upper bound is not tight. Let $n=5^k$, as in you question. You can upper bound your summation by
$$
\sum_{i=1}^{k} 5^i \cdot \log^2 5^{k-i} \le
6 \sum_{i=1}^{k} 5^i (k-i)^2 =
6 \cdot 5^{k} \sum_{i=0}^{k-1} \frac{i^2}{5^i} = 5^k \cdot O(1),
$$
where the last equality follows from the fact that the serie... |
null |
Given, $$T(n)=5T(\frac{n}{5})+\log^2(n)$$ compare with $$T(n)=aT(\frac{n}{b})+n^k\log^p(n)$$(By master theorem) where $a\geq1,b>1,k\geq 0$ and $p \in \mathbb{R}.$
Since $a> b^k$, $T(n) =\theta(n^{\log_{b}a})$ which is $\theta(n).$ |
Given, $$T(n)=5T(\frac{n}{5})+\log^2(n)$$ compare with $$T(n)=aT(\frac{n}{b})+n^k\log^p(n)$$(By master theorem) where $a\geq1,b>1,k\geq 0$ and $p \in \mathbb{R}.$
Since $a> b^k$, $T(n) =\Theta(n^{\log_{b}a})$ which is $\Theta(n).$ |
As an example to the answer from Gilles, here is an "iterative" algorithm for the Ackermann function (using the common [Ackermann-Péter version mentioned by Wikipedia](https://en.wikipedia.org/wiki/Ackermann_function) $a(n,m)$).
We need a stack $s$ of integers.
Such a stack has two modifying operations, $\Declar... |
The problem is known as [Multi-set Multi-cover problem](https://www.sciencedirect.com/science/article/pii/S0304397510001118). Since you are choosing a $P_i$ at most once, you can use the dynamic programming based algorithm given in [Section 5 of the paper](https://www.sciencedirect.com/science/article/pii/S030439751000... |
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even.Is this a correct transformation of the graph so you can then procee... |
Minimum cost flow, antiparallel-double edges |
|network-flow| |
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even(if cost is 9 for example you break it in 5 and 4).Is this a correct ... |
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor... |
Distribution of $k$-matchings in a random graph |
|graphs|probability-theory|matching|random-graphs|chernoff-bounds| |
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even(if cost is 9 for example you break it in 5 and 4).Is this a correct ... |
Minimum cost flow, handling antiparallel-double edges |
We assume that the logic gates are bounded to having two inputs (as opposed to unbounded fan-in gates, with which addition can be done in constant depth by implementing the Conjunctive Normal Form for each bit in the result of the addition). We also assume the standard binary encoding of numbers.
Note that the most... |
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even(if cost is 9 for example you break it in 5 and 4). Is this a correct... |
How to find all edge-disjoint paths of equal length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices?
This type of question has a lot of variations when some additional assumptions are added. Most of them involve adding a source and terminal vertex. However, I haven't seen any prope... |
How to find all edge-disjoint paths of length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? |
|graphs|graph-traversal|weighted-graphs|eulerian-paths| |
|algorithms|dynamic-programming|constraint-satisfaction|set-cover| |
null |
If P=NP then we have W[1]=FPT. Would it just imply $k$-sum conjecture fails for some large $k$ or $k$ can be as small as $3$? |
3 sum conjecture if P=NP |
|parameterized-complexity| |
|algorithms|graphs|optimization|approximation|clustering| |
null |
null |
null |
How to find and return the maximum number of edge-disjoint paths of equal length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? (I'd like the output to be the paths themselves, and of course trivially the number of paths too).
This type of question has a lot of variations when som... |
How to find maximum number of edge-disjoint paths of length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? |
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor... |
There is no precise answer to this question. For a given $n$, the running time of Quicksort follows a statistical distribution with nonzero probabilities in $[\Theta(n\log n),\Theta(n^2)]$, but the exact distribution depends on the distribution of the input.
In the case of equiprobable permutations of the input numb... |
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor... |
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor... |
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor... |
I have formulated the below optimization problem.
\begin{align}\nonumber
\hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!\\
\text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\
& \sum_{j} d_j p_{ij} \leq b_i w_{i} , \forall(i) \in \mathcal{I}\\
& p... |
I came across this language, where M denotes a Turing Machine:
[PALINDROMES](https://www.csie.ntu.edu.tw/~lyuu/complexity/2017/20171024s.pdf) := {M | M accepts strings which are palindromes.} It is proven to undecidable.
And, I know one can construct a Turing Machine that decides for strings, if they are palindr... |
TMs can decide whether or not a string is a Palindrome, yet, the language called PALINDROMES is undecidable - why? |
|turing-machines|computability|undecidability|decidability| |
Yes, you are right, you are confusing the two languages.
You know that, via "gödelization", you can associate to every Turing machine $M$ a number $\lceil M \rceil$ in bijective way (this can be done in multiple way, but you can fix one of this way, for example using a binary alphabet and fixing the rules coherently... |
I came across this language, where M denotes a Turing Machine:
[PALINDROMES](https://www.csie.ntu.edu.tw/~lyuu/complexity/2017/20171024s.pdf) $:= \{M \mid M \text{ accepts strings which are palindromes}\}.$ It is proven to undecidable.
And, I know one can construct a Turing Machine that decides for strings, if t... |
null |
If you were to define an altered AVL tree where the balance factor (the difference between the height of the left and right subtree) of a node must be less than or equal to the depth of the node (in absolute value), would it be balanced (h is in O(log n))? How would you prove so?
|
AVL tree with balance factor equal to depth |
|data-structures|trees|avl-trees| |
Trees you are asking for do not exist in general. Consider a tree with two nodes. Regardless of how you arrange them, one must be the root. Then absolute value of the balance factor of the root is $1$ but the root's depth is $0$. |
Schaefer's dichotomy theorem ensures than when a constraint satisfiability problem satisfies certain conditions, the problem is either in $\mathsf P$ or is $\mathsf{NP}$-hard.
Suppose the following problem:
> Given a monotone CNF $f(X)$ and a 2-CNF $g(X)$ such that $|g(X)|\le c\cdot \log^k |f(x)|$ (where $|f|$ st... |
Schaefer's dichotomy theorem and limits on the amount of clauses |
|complexity-theory|time-complexity|satisfiability|decision-problem| |
Schaefer's dichotomy theorem ensures than when a constraint satisfiability problem satisfies certain conditions, the problem is either in $\mathsf P$ or is $\mathsf{NP}$-hard.
Suppose the following problem:
> Given a monotone CNF $f(X)$ and a 2-CNF $g(X)$ such that $|g(X)|\le c\cdot \log^k |f(x)|$ (where $|f|$ st... |
Schaefer's dichotomy theorem and limits on the formula length |
Schaefer's dichotomy theorem ensures than when a constraint satisfiability problem satisfies certain conditions, the problem is either in $\mathsf P$ or is $\mathsf{NP}$-hard.
Suppose the following problem:
> Given a monotone CNF $f(X)$ and a 2-CNF $g(X)$ such that $|g(X)|\le \log_c^k |f(x)|$ (where $|f|$ stands ... |
Let the set of client locations is $C = \{c_1,c_2,c_3\}$ and the set of feasible facility locations is $F = \{f_1,\dotsc,f_6\}$. Let $k = 5$. Let the distance function be defined by $3 \times 6$ matrix $D$ such that $D[i,j]$ denotes the distance of client $i$ to facility $j$:
\begin{bmatrix}
1 & 1 & 2 & 1 & 3 & 3\\... |
It is normally assumed that the space for input *and* output is already allocated and does not count in the estimation of the complexity. So you won't allocate an extra array.
This is logical, as you need the input and output storage anyway. What matters is additional resources that an algorithm would require. |
How to find and return the maximum number of edge-disjoint trails of equal length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? (I'd like the output to be the paths themselves, and of course trivially the number of trails too).
This type of question has a lot of variations when s... |
How to find maximum number of edge-disjoint trails of length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? |
This is not a complete answer, but some ideas about it.
For convenience purposes, I will use the convention I talked about in the comments:
- the depth of a node $x$ is the number of **nodes** between the root of the tree and the node $x$. That means that the depth of the root is $1$ (and not $0$);
- the heig... |
This is not a complete answer, but some ideas about it.
For convenience purposes, I will use the convention I talked about in the comments:
- the depth of a node $x$ is the number of **nodes** between the root of the tree and the node $x$. That means that the depth of the root is $1$ (and not $0$);
- the heig... |
It is normally assumed that the space for input *and* output is already allocated and neither do count in the estimation of the complexity. So you won't allocate an extra array.
This is logical, as you need the input and output storage anyway. What matters is additional resources that an algorithm would require. |
How to find and return the maximum number of edge-disjoint trails of equal length $k$ of a directed multi-graph $G=(V,E)$ between arbitrary start and end vertices? The start and end vertices may be different for each trail, although they need not be different. (I'd like the output to be the paths themselves, and of c... |
How to construct DPDA for the following language $L=\{a,b\}^* / a^nb^n / b^na^n $
I have no idea how to start.
$L_1 = \{a,b\} / a^nb^n =\{a^i b^j \ | \ i>j\} \cup \{a^i b^j\ \ | \ i<j\}\cup (a+b)^* b (a+b)^* a (a+b)^*$.
But what next?
|
DPDA for language $L=\{a,b\}^* / a^nb^n / b^na^n$ |
|pushdown-automata| |
null |
How to construct DPDA for the following language $L=\{a,b\}^* / a^nb^n / b^na^n $
I have no idea how to start.
$L_1 = \{a,b\}^* / a^nb^n =\{a^i b^j \ | \ i>j\} \cup \{a^i b^j\ \ | \ i<j\}\cup (a+b)^* b (a+b)^* a (a+b)^*$.
But what next?
|
I'm studying recursion and a i have a doubt about the running time complexity of the binary search. I didnt understand this passage in my book :
Initially, the number of candidates is n; after the first call in a binary search, it is at
most n/2; after the second call, it is at most n/4; and so on.
What... |
Binary search calculating complexity big o |
|algorithms|recursion|big-o-notation| |
It is normally assumed that the space for input *and* output is already allocated and neither do count in the estimation of the complexity. So you won't allocate an extra array.
This is logical, as you need the input and output storage anyway. What matters is additional resources that an algorithm would require.
... |
Strictly speaking, $n$ reduces to at most $\left\lceil\frac n2\right\rceil$, which is $\frac n2$ or $\frac{n+1}2$, depending on the parity of $n$. So you are right. But this can only change the total number of subdivisions by one unit, so it remains essentially $O(\log(n))$.
E.g.
$$31\to15\to7\to3\to1$$ vs. $$31\to... |
Strictly speaking, $n$ reduces to at most $\left\lceil\frac n2\right\rceil$, which is $\frac n2$ or $\frac{n+1}2$, depending on the parity of $n$. So you are right. But this can only change the total number of subdivisions by one unit, so it remains essentially $O(\log(n))$.
E.g.
$$27\to13\to6\to3\to1$$ vs. $$27\to... |
Strictly speaking, $n$ reduces to at most $\left\lceil\frac n2\right\rceil$, which is $\frac n2$ or $\frac{n+1}2$, depending on the parity of $n$. So you are right. But this can only change the total number of subdivisions by one unit, so it remains essentially $O(\log(n))$.
E.g.
$$27\to13\to6\to3\to1$$ vs. $$27\to... |
A linear equation $Ax=b$ can be solved by reducing the matrix $A$ to upper triangular form by using [Gaussian elimination][1] or [LU decomposition][2]. If $A$ is symmetric and positive definite one can use [Cholesky decomposition][3] which is more efficient than LU decomposition. If the entries of $A$ are all integers ... |
null |
This is not a complete solution. But the following reduction simplifies it.
The problem can be reduced to finding maximum number of edge disjoint paths of length $k$ between two vertices $s$ and $t$ in a directed graph. I am assuming that the given graph is unweighted since it is not specified in the question. Howe... |
This is not a complete solution. But the following reduction simplifies it.
The problem can be reduced to finding maximum number of edge disjoint paths of length $k$ between two vertices $s$ and $t$ in a directed graph. I am assuming that the given graph is unweighted since it is not specified in the question. Howe... |
How to construct DPDA for the following language $L=\{a,b\}^* / a^nb^n / b^na^n $
/ - is difference. Language $\{a,b\}^*/ a^nb^n$ is language $\{a,b\}^*$ without language $a^nb^n$
$L_1 = \{a,b\}^* / a^nb^n =\{a^i b^j \ | \ i>j\} \cup \{a^i b^j\ \ | \ i<j\}\cup (a+b)^* b (a+b)^* a (a+b)^*$.
At this step I g... |
null |
A central insight of Dijkstra's shortest path algorithm is that every subpath of the shortest path is also the shortest path of the subgraph. But is that also true for the longest path? In particular, I want to find the longest path of a DAG, and I don't know if it's completely different. My problem is to find the long... |
Shortest path algorithm for longest path problem? |
|graphs| |
null |
I was wondering whether the size of the minimal cut in a directed graph (digraph) is conserved under an operation of transposition.
This may be trivial as I haven't been able to find anything here or on Google when searching for different variants of the query "directed graph transpose minimal cut preservation\cons... |
Does digraph transposition conserves minimal cut size? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.