instruction stringlengths 0 29.8k ⌀ |
|---|
This is a puzzle about measuring network latency that I created. I believe the solution is that it's impossible, but friends disagree. I'm looking for convincing explanations either way. (Though it is posed as a puzzle I think it fits on this web site because of its applicability to the design and experience of communi... |
Measuring one way network latency |
|computer-networks|protocols| |
The $\mathcal{O}(\log n)$ complexity is usually connected with subdivision. When using lists as an example, imagine a list whose elements are sorted. You can search in this list in $\mathcal{O}(\log n)$ time - you do not actually need to look at each element because of the sorted nature of the list.
If you look at ... |
In terms of (balanced) trees (say, binary tree, so all $\log$'s are base 2):
- $O(1)$ is getting the root of the tree
- $O(\log n)$ is a walk from root to leaf
- $O(n)$ is traversing all nodes of the tree |
Yes, $\log(n)$ is between $1$ and $n$, but it is closer to $1$ than $n$. What is $\log(n)$? The log function is the inverse function of exponentation. Let me start with exponentation and you should get a better idea of what logarithm is.
Consider two numbers, $100$ and $2^{100}$. $2^{100}$ is $2$ multiplied with its... |
Apply the [master theorem](http://en.wikipedia.org/wiki/Master_theorem).
The first algorithm takes $O(N^2)$ time because your underlying recurrence is
\\[ T(N) = 2T(N/2) + N^2 \\]
The second algorithm takes $N\log^2N$ time as you mention. If your work per node is as indicated (and is tight) then this bound i... |
About including λ-calculus in the standard complexity model, here is the abstract from some (very) fresh research on the subject. It gives an answer to this question for some restricted form of β-reduction. Basically, complexity in the standard cost model is similar to counting β-reduction steps *when restricted to hea... |
Suppose I have two strings. Call them $A$ and $B$. Neither string has any repeated characters.
How can I find the shortest sequence of insert, move, and delete operation that turns $A$ into $B$, where:
- `insert(char, offset)` inserts `char` at the given `offset` in the string
- `move(from_offset, to_offset)` ... |
|algorithms|combinatorics| |
You have one coin. You may flip it as many times as you want.
You want to generate a random number $r$ such that $a \leq r < b$ where $r,a,b\in \mathbb{Z}^+$.
Distribution of the numbers should be uniform.
It is easy if $b -a = 2^n$:
r = a + binary2dec(flip n times write 0 for heads and 1 for tails) ... |
No, you can't measure the asymmetry. Consider these two communication diagrams, the first with a negative clock offset and equal delays and the second with no clock offset and entirely asymmetric delays (but the same round trip time).
![communication diagram][1]
The important thing to notice is that, from the per... |
**Inability to measure asymmetry**
No, you can't measure the asymmetry. Consider these two communication diagrams, the first with a negative clock offset and equal delays and the second with no clock offset and entirely asymmetric delays (but the same round trip time).
![communication diagram][1]
The important... |
Sudoku is a puzzle that requires filling a grid (with 9 rows and 9 columns) that is subdivided in 9 sub-grids (with 3 rows and 3 columns) in a way that each column, row and sub-grid contains every digit from 1 to 9. |
null |
**Inability to measure asymmetry**
No, you can't measure the asymmetry. Consider these two communication diagrams, the first with a negative clock offset and equal delays and the second with no clock offset and entirely asymmetric delays (but the same round trip time).
![communication diagram][1]
The important... |
Here are a few papers that talk about the cache implications of generational garbage collectors:
[Caching Considerations for Generational Garbage Collection][1]<br/>
[The Effect of Garbage Collection on Cache Performance][2]
From what I can gather, the primary issue is that garbage collected systems trade off sp... |
Some decades ago, people thought that genetic and evolutionary algorithms were swiss-army-knives, fueled by spectacular early results. Statements like the [building block hypothesis](https://en.wikipedia.org/wiki/Building_block_hypothesis#The_building_block_hypothesis) were made in an effort to prove that they were in ... |
Sudoku is a puzzle that requires filling a 3x3 grid of 3x3 sub-grids in a way that each column, row and sub-grid contains every digit from 1 to 9. |
null |
Just two pointers:
1. If you want to actually combine the ideas of priority queues and binary search trees, think about combining heap and BST in one structure.
2. There is the concept of [self-organising lists](https://en.wikipedia.org/wiki/Self-organizing_list). The idea is to move recently accessed element to... |
Creating a Self Ordering Binary Tree |
|computer-networks|protocols| |
[Johne Percival Hackworth](http://cs.stackexchange.com/a/551/98):
> While there is nothing wrong with visual programming, it may be the case that it's simply not a good approach for most tasks.
Perhaps, the visual programming languages to date have just been too immature? The notion that advanced visualizations ... |
[Bob Warfield][1] wrote a blog post ([A Picture of the MultiCore Crisis)][2] that has the [kind of graph][3] you're looking for.
[1]: http://www.smoothspan.com/management.html
[2]: http://smoothspan.wordpress.com/2007/09/06/a-picture-of-the-multicore-crisis/
[3]: http://smoothspan.files.wordpress.com/2007/... |
Here are a few papers that talk about the cache implications of generational garbage collectors:
[Caching Considerations for Generational Garbage Collection][1]<br/>
[The Effect of Garbage Collection on Cache Performance][2]
From what I can gather, the primary issue is that garbage collected systems trade off sp... |
|computer-architecture|empirical-research| |
As far as I know, the main models of computability are λ-calculus, Turing machines and [recursive functions][1]. I am not aware of the situation regarding complexity in recursive functions, they may or may not be useless for complexity.
It may be seen as a fortunate coincidence that Turing machines, which are not so... |
Apply the [master theorem](http://en.wikipedia.org/wiki/Master_theorem).
The first algorithm takes $O(N^2)$ time because your underlying recurrence is
\\[ T(N) = 2T(N/2) + N^2 \\]
The second algorithm takes $N\log^2N$ time as you mention. If your work per node is as indicated (and is tight) then this bound i... |
Say I have a string $a \in \Sigma N^+$ and some CFG $G$ such that $x a y \in \mathcal{S}(G)$ where $x,y\in \Sigma N^*$ and $\mathcal{S}(G)$ are the sentential forms of $G$. In this case $\Sigma N$ is $(\Sigma \cup N)$, the set of terminals and non-terminals.
Given the CFG, I'd like to determine a set $C = \{ b \mid ... |
Given a string and a CFG, what characters can follow the string (in the sentential forms of the CFG)? |
To continue your theme, $O(\log n)$ is like guessing where **x** lies in the list and being told "higher" or "lower".
It's still based on the size of the list, but you only need to visit a fraction of the elements. |
Intuition for logarithmic complexity |
This is a follow up to my earlier questions on [coinduction][1] and [bisimulation][2].
Recalling, a [labelled transition system][1] is a triple $(S,\Lambda,\to)$, where $S$ is a set of states, $\Lambda$ is a set of labels, and $\to\subseteq S\times\Lambda\times S$ is a ternary relation., where $(p,\alpha,q)\in\to$ i... |
Late and Early Bisimulation |
|formal-methods|semantics|process-algebras| |
Given a [labelled transition system][1] $(S,\Lambda,\to)$, where $S$ is a set of states, $\Lambda$ is a set of labels, and $\to\subseteq S\times\Lambda\times S$ is a ternary relation. As usual, write $p \stackrel\alpha\rightarrow q$ for $(p,\alpha,q)\in\to$. The labelled transition $p\stackrel\alpha\to q$ denotes that ... |
How to improve the worst case scenario for a depth first search on an euler graph, starting at some point and ending at that same point.
I need to do the whole search but it ain't fast enough for large amounts of data, I've tried bidirectional but I can't really keep the result numericly ordered so I wonder if ther... |
euler depth first search algorithm |
|algorithms| |
Assume I have two formulae $\Phi$ and $\Psi$ (over the same set of atomic propositions $AP$) in [CTL][1]. We have that $\Phi \equiv \Psi$ iff $Sat_{TS}(\Phi) = Sat_{TS}(\Psi)$ for all transition systems $TS$ over $AP$.
Given that there are infinitely many transition systems, it's impossible to check them all. I thou... |
How can I decide whether two CTL formulas are equivalent? |
|logic|model-checking| |
How to improve the worst case scenario for a depth first search on an euler graph, starting at some point and ending at that same point?
I need to do the whole search but it is not fast enough for large amounts of data. I have tried [bidirectional search](https://en.wikipedia.org/wiki/Bidirectional_search) but I can... |
Improve worst case time of depth first search on euler graphs |
|algorithms|graphs| |
Assume I have two formulae $\Phi$ and $\Psi$ (over the same set of atomic propositions $AP$) in [CTL][1]. We have that $\Phi \equiv \Psi$ iff $Sat_{TS}(\Phi) = Sat_{TS}(\Psi)$ for all transition systems $TS$ over $AP$.
Given that there are infinitely many transition systems, it's impossible to check them all. I thou... |
How can I decide whether two CTL formulae are equivalent? |
This is a follow up to my earlier questions on [coinduction][1] and [bisimulation][2].
Recalling, a [labelled transition system][1] is a triple $(S,\Lambda,\to)$, where $S$ is a set of states, $\Lambda$ is a set of labels, and $\to\subseteq S\times\Lambda\times S$ is a ternary relation., where $(p,\alpha,q)\in\to$ i... |
To continue your theme, $O(\log n)$ is like repeatedly guessing where **x** lies in the list and being told "higher" or "lower" (in terms of index).
It's still based on the size of the list, but you only need to visit a fraction of the elements. |
Assume I have two formulae $\Phi$ and $\Psi$ (over the same set of atomic propositions $AP$) in [CTL][1]. We have that $\Phi \equiv \Psi$ iff $Sat_{TS}(\Phi) = Sat_{TS}(\Psi)$ for all transition systems $TS$ over $AP$.
Given that there are infinitely many transition systems, it's impossible to check them all. I thou... |
Let $\Sigma$ be the set of terminal and $N$ the set of non-terminal symbols of some context-free grammar $G$.
Say I have a string $a \in (\Sigma \cup N)^+$ such that $x a y \in \mathcal{S}(G)$ where $x,y\in (\Sigma \cup N)^*$ and $\mathcal{S}(G)$ are the sentential forms of $G$.
Given $G$, I'd like to determine a... |
This is a follow up to my earlier questions on [coinduction][1] and [bisimulation][2].
A relation $R \subseteq S \times S$ on the states of an LTS is a _bisimulation_ iff $\forall (p,q)\in R,$
$$
\begin{array}{l}
\text{ if } p \stackrel\alpha\rightarrow p'
\text{ then } \exists q', \;
q \stackrel\... |
I was given the question
> Where does the following language fit in the chomsky hierarchy?
>
> nonnegative solutions <x,y> to the diophantine equation 3x-y=1
I understand languages like "L={0^n1^n|n>=1}" but this langauge confuses me, what do the words in thet language look like? How could I represent it usin... |
Where in the chomsky hierarchy does this language fit? |
|formal-languages| |
I have the following language
![enter image description here][1]
I am trying to determine which chomsky language class it fits into. I can see how it could be made using a context-sensitive grammar so I know it is atleast context-sensitive. It seems like it wouldn't be possible to make with a context-free grammar... |
How can I prove this language is not context-free? |
|formal-languages|formal-grammars|context-free| |
I was given the question
> Where does the following language fit in the Chomsky hierarchy?
>
> Nonnegative solutions $(x,y)$ to the diophantine equation $3x-y=1$.
I understand languages like $L = \{ 0^n1^n \mid n \ge 1\}$, but this language confuses me. What do the words in the language look like? How could I... |
Where in the Chomsky hierarchy does this language fit? |
The first thing you'll want to do is look at the phrase itself, and ignore all the references to languages for a moment.
So, what are the non-negative solutions to the diophantine equation $3x-y=1$? If we fix some $x$, then $y = 3x-1$. This means that the set of solutions is $\{ (x, 3x-1)\ |\ x > 0 \}$ (note that $x... |
I was given the question
> Where does the following language fit in the Chomsky hierarchy?
>
> Nonnegative solutions (x,y) to the diophantine equation $3x-y=1$.
I understand languages like $L = \{ 0^n1^n \mid n \ge 1\}$, but this language confuses me. What do the words in the language look like? How could I r... |
The problem statement is indeed incomplete, but when you see this, you can safely assume that “*representing integers in decimal notation*” or “*representing integers in binary notation*” was meant.
----
So here, if we assume binary notation, the alphabet is contains 5 characters: `0`, `1`, `(`, `)` and `,`. If w... |
You can force the pumping to be in some places, using [Ogden's lemma][1], for example by marking all the 0's.
Suppose it is context free, then Ogden's lemma gives you a $p>0$, you give it $w=0^p1^p2^p$ which is in the language, and you "mark" all the 0's. Then any factorisation $w=uxyzv$ must be such that there is a... |
null |
|formal-languages|formal-grammars|homework|context-free| |
|formal-languages|homework| |
|formal-languages| |
|formal-languages|formal-grammars|context-free| |
Late and early only make sense when building the LTS. The notion of bisimulation stays the same.
However there are several notion of *bisimilarities* in the π-calculus for example. These are related to how new names are handled. It happens in the π-calculus because it is a *name-passing* process calculus. There is n... |
A directed graph is said to be *unipathic* if for any two vertices $u$ and $v$ in
the graph $G$, there is at most one simple path from $u$ to $v$.
Suppose I am given a unipathic graph $G$ such that each edge has a positive or negative weight, but contains no negative weight cycles.
From this I want to find a $O... |
Unipathic Graph Problem |
|algorithms|graphs| |
Since others have already given good answers for this question, I will just quote Alan Perlis.
> Beware of the turing tar pit, in which everything is possible but
> nothing of interest is easy.
Also,
http://weblog.raganwald.com/2004/10/beware-of-turing-tar-pit.html, is a good read. |
[Note this is a question related to study in a CS course at a university, it is NOT homework and can be found here under Fall 2011 exam2: http://www.cs.ucf.edu/~dmarino/ucf/transparency/cot4210/exam/ ]
Here are the two questions I'm looking at from a past exam. They seem to be related, the first:
>Let $FINITE_{C... |
Question on Turing Machine Decidablity on Two Finite Languages |
|undecidability|regular-languages|context-free|turing-machines| |
The 5th edition of _Computer Architecture, A Quantitative Approach_ has several related graphs.
The clock rate graphs is divided in 3 parts, from a 5MHz Vax in 78 to a Sun SPARC at 16 MHz in 86 (15% per year), to an Intel Pentium 4 Xeon in 2003 at 3200 MHz(40% per year) to an Intel Nehalem Xeon in 2010 at 3330 MHz (... |
1. Convert G to [Chomsky Normal form][1]. This way, the only empty derivation would be the start symbol that does not appears anywhere else. Build a directed graph where each production is a node and each symbol inside a production is an edge targeting that symbol. If the graph has some cycle, the CFG is infinite, othe... |
If I understand correctly, the only way to have a numerically ordered eulerian path would be having a path looking like 1,2,3..,n,1. All nodes in the path must have degree 2 (since you can only get into the once), except perhaps for nodes with degree 0, that you can instead skip.
If this is the case, the algorithm w... |
The $\mathcal{O}(\log n)$ complexity is usually connected with subdivision. When using lists as an example, imagine a list whose elements are sorted. You can search in this list in $\mathcal{O}(\log n)$ time - you do not actually need to look at each element because of the sorted nature of the list.
If you look at ... |
1. Convert G to [Chomsky Normal form][1]. This way, the only empty derivation would be the start symbol that does not appears anywhere else. Build a directed graph where each production is a node and each symbol inside a production is an edge targeting that symbol. If the graph has some cycle, the CFG is infinite, othe... |
1. Convert G to [Chomsky Normal form][1]. This way, the only empty derivation would be the start symbol that does not appears anywhere else and thus if there is some production that may able to eventually generate itself, then the grammar is infinite. If no such production exists, each symbol will only be able to gener... |
1. Convert G to [Chomsky Normal form][1]. This way, the only empty derivation would be the start symbol that does not appears anywhere else and thus if there is some production that may able to eventually generate itself, then the grammar is infinite. If no such production exists, each symbol will only be able to gener... |
It seems to me that "$\Phi≡\Psi$" is equivalent to "Neither $(\Phi ∧ ¬\Psi)$ nor $(\Psi ∧ ¬\Phi)$ is satisfiable".
Therefore deciding equivalence is as difficult as deciding satisfiability, since "$\Phi$ satisfiable" is equivalent to "not ($¬\Phi≡\top$)".
In [this article][1] there is a mention of a an exponentia... |
[Note this is a question related to study in a CS course at a university, it is NOT homework and can be found here under Fall 2011 exam2: http://www.cs.ucf.edu/~dmarino/ucf/transparency/cot4210/exam/ ]
Here are the two questions I'm looking at from a past exam. They seem to be related, the first:
>Let $FINITE_{C... |
null |
You can force the pumping to be in some places, using [Ogden's lemma][1], for example by marking all the 0's.
Suppose it is context free, then Ogden's lemma gives you a $p>0$, you give it $w=0^p1^p2^p$ which is in the language, and you "mark" all the 0's. Then any factorisation $w=uxyzv$ must be such that there is a... |
null |
While discussing some intro level topics today, including the use of genetic algorithms; I was told that research has really slowed in this field. The reason given was that most people are focusing on machine learning and data mining. <br>
**Update:** Is this accurate? And if so advantages does ML/DM have when compare... |
null |
*Note this is a question related to study in a CS course at a university, it is NOT homework and can be found [here](http://www.cs.ucf.edu/~dmarino/ucf/transparency/cot4210/exam/) under Fall 2011 exam2.*
Here are the two questions I'm looking at from a past exam. They seem to be related, the first:
>Let
> $\... |
Decidablity of Languages of Grammars and Automata |
The pumping lemma should solve your problem regarding the third part of the word; note that when you split $z = uvwxy$, any combination of $uv^nwx^ny$ is also in the language, *including* when $n = 0$. Try that. |
While discussing some intro level topics today, including the use of genetic algorithms; I was told that research has really slowed in this field. The reason given was that most people are focusing on machine learning and data mining. <br>
**Update:** Is this accurate? And if so, what advantages does ML/DM have when c... |
1. Convert G to [Chomsky Normal form][1]. This way, the only empty derivation would be the start symbol that does not appears anywhere else and thus if there is some production that may able to eventually generate itself, then the grammar is infinite. If no such production exists, each symbol will only be able to gener... |
The pumping lemma should solve your problem regarding the third part of the word; note that when you split $z = uvwxy$, any combination of $uv^nwx^ny$ is also in the language, *including* when $n = 0$. Try that.
EDIT: As [jmad states][1], the Pumping Lemma is like a game:
> 1. The pumping lemma gives you a $p$
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.