instruction stringlengths 35 29.1k |
|---|
I've asked a similar question on cstheory.SE.
According to this answer on Stackoverflow there is an algorithm that on a non-lazy pure functional programming language has an $\Omega(n \log n)$ complexity, while the same algorithm in imperative programming is $\Omega(n)$. Adding lazyness to the FP language would make the... |
There are devices that do not allow users to load any application they want on it, only run a limited class of applications approved by the device vendor.
Take an iPhone as an example where new applications are loaded (solely) from app-store and programs that would allow execution of arbitrary code by user (without per... |
I have a problem in my mind, I think it is a NPC problem but I don't know how to prove it.
Here is the problem:
There are k islands in a very big lake, and there are n fan-shaped pontoons. Those pontoons are in the same size but have different initial directions and are in different original positions in the lake. The... |
I was reading Linux Kernel Development by Robert Love, where I came across this
Linux takes an interesting approach to thread support: It does not
differentiate between threads and normal processes.To the kernel, all
processes are the same— some just happen to share resources.
I do not know much about OSs (aspire... |
Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hatred and violence. The goal of this question is to find an objective way to filter ou... |
I really wonder how torrent downloads can be resumed at later point of time.
If such a technology exists, then why is it not possible in browsers?
It is often not possible to pause a browser download so that it can be resumed at a later point of time. Often, the download will start again from the beginning. But in the ... |
Context: I'm working on this problem:
There are two stacks here:
A: 1,2,3,4 <- Stack Top
B: 5,6,7,8
A and B will pop out to other two stacks: C and D. For example:
pop(A),push(C),pop(B),push(D).
If an item have been popped out , it must be pushed to C or D immediately.
The goal is to enumerate all possible stac... |
Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An anagramming of two strings is a bijective mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$.
There might be more than one anagramming for the same pair of strings. For example, If $a=$`abcab` and $b=$... |
I have the following problem:
We want to implement a filtering strategy in e-mail servers to reduce the number of spam messages. Each server will have a buffer, and before sending an e-mail, it checks whether there is a duplicate of the same message in its own buffer and contacts k distinct neighboring servers at rand... |
Most tutorials on Lambda Calculus provide example where Positive Integers and Booleans can be represented by Functions. What about -1 and i?
|
I need an algorithm to calculate the number of ways of expressing a number N as sum of numbers inside the interval [a, b]
|
I was reading something about the concept of walks in a graph b/w a start vertex and a terminating vertex in a graph and then suddenly a problem struck me, is there any algorithm or a method that can be used to enumerate all the distinct walks from a start vertex to a terminal vertex in a graph, if so can you all point... |
COQ is an interactive theorem prover that uses the calculus of inductive constructions, i.e. it relies heavily on inductive types. Using those, discrete structures like natural numbers, rational numbers, graphs, grammars, semantics etc. are very concisely represented.
However, since I grew to like the proof assistant, ... |
We want to solve a minimal-cost-flow problem with a generic negative-cycle cancelling algorithm. That is, we start with a random valid flow, and then we do not pick any "good" negative cycles such as minimal average cost cycles, but use Bellman-Ford to discover a minimal cycle and augment along the discovered cycle. Le... |
The slides from my course in software architecture hints that these are seperate terms, but I can't seem to find the difference. Aren't all of them just translating interfaces?
|
Given a parsing expression grammar (PEG) grammar and the name of the start production, I would like to label each node with the set of characters that can follow it. I would be happy with a good approximation that is conservative -- if a character can follow a node then it must appear in the follower set.
The grammar ... |
Let $C$ be a non-trivial set of recursively enumerable languages ($\emptyset \subsetneq C \subsetneq \mathrm{RE}$) and let $L$ be the set of encodings of Turing machines that recognize some language in $C$: $$L=\{\langle M \rangle \mid L(M) \in C \}$$
Suppose that $\langle M_{loopy}\rangle \in L$, where $M_{loopy}$ is ... |
Let $f$ and $g$ be two functions and $p$ a number. Consider the following program:
Recurs(v,p) :
find s < v such that f(s,v) < v/2 and g(s,v-s) < p
if no such s exists then
return v
else if s <= v/4 then
return v-s U Recurs(s,p)
else if s > v/4 then
return Recurs(s,p) U Recurs(v-s,p)
end
Can the... |
Possible Duplicate:
How to use greedy algorithm to solve this?
You are given $n$ integers $a_1, \ldots, a_n$ all between $0$ and $l$. Under each integer $a_i$ you should write an integer $b_i$ between $0$ and $l$ with the requirement that the $b_i$'s form a non-decreasing sequence (i.e. $b_i \le b_{i+1}$ for all $i$... |
I first asked this question at cstheory, but they suggested to ask my question here, so here it goes ...
I'm working on my masters thesis and I need to have theoretical value of the (average) speed gain that a quadcore processor brings compared to a singlecore processor, when they both use the same frequency. So for ex... |
In short: how are type systems categorised in academic contexts; particularly, where can I find reputable sources that make the distinctions between different sorts of type system clear?
In a sense the difficulty with this question is not that I can't find an answer, but rather that I can find too many, and none stand ... |
I am interested in the complexity of the restricted version of the vertex cover problem below:
Instance: A bipartite graph $G =(L, R, E)$ and an integer $K$.
Question: Is there $S \subset L$, $|S| \leq K$ and every vertex in $R$ has a neighbor in $S$ $( S$ is vertex cover for $R)$
Vertex cover is $\mathsf{P}$ if $S \... |
I look for information about grammars which can be described by a non-linear equation such as a quadratic equation:
$\qquad \displaystyle G \to G G a \mid b$
or
$\qquad \displaystyle G \to G G \mid y G z \mid z G y \mid \varepsilon$
While there is lots of material about linear grammars, their connection with regular la... |
Let
$A = \mathrm{R}$ be the set of all languages that are recursive,
$B = \mathrm{RE} \setminus \mathrm{R}$ be the set of all languages that are recursively enumerable but not recursive and
$C = \overline{\mathrm{RE}}$ be the set of all languages that are not recursively enumerable.
It is clear that for example $\ma... |
I was trying to write some simple code for a "flow layout" manager and what I came up with initially was something like the following (semi-pseudocode):
int rowHeight = 0;
RECT rect = parent.getClientRect();
POINT pos = rect.position; // Start at top-left corner, row by row
foreach (Window child in parent.children)
{... |
Turing machines have a formal symbol alphabet, state and transition-rules based description of how a computation is done.
The Actor Model is sometimes mentioned as a more powerful computational-model than Turing machines (not in what it can compute, but in other aspects).
Is The Actor Model a full fledged Turning... |
I am aware that for a problem to be considered NP-Hard, any problem in NP must be reduceable to your problem (problem which you are trying to prove is NP-Hard).
Let's assume that you have proven that a problem Y is NP-Hard, and you have a problem X which you know is in NP, and you would like to solve.
To solve X, which... |
I'm looking for some standard terminology, metrics and/or applications of the consideration of density and sequentiality of algorithms.
When we measure algorithms we tend to give the big-Oh notation such as $O(n)$ and usually we are measuring time complexity. Somewhat less frequently, though still often, we'll also mea... |
Here is the document: More Undecidable Problems
For a given property $P$ of languages, define $L_P$ as the set of all Turing machines (resp. their encodings) that accept languages with $P$, that is
$\qquad \displaystyle L_{p} = \{ ⟨M⟩ \mid \mathcal{L}(M) \text{ has property } P \}$
If $P$ is a trivial property, that is... |
My problem is how can I prove that a grammar is unambiguous?
I have the following grammar:
$$S
→ statement
∣ \mbox{if } expression \mbox{ then } S
∣ \mbox{if } expression \mbox{ then } S \mbox{ else } S$$
and make this to an unambiguous grammar, I think its correct:
$ S → S_1 ∣ S_2 $
$S_1
→ \mbox{if } expression \mbox... |
In the following grammar that is used for math expressions(and other grammars) how do I know where should I place action symbols(@add, @mul, @pushID)? Is there a algorithm for it?
E -> TE`
E'-> +T @add E'|ϵ
T -> FT`
T'-> xF @mul T'|ϵ
F -> (E)|@pushID id
For example why @add is between +T and E' and not after E'?
I se... |
I’m working on a compiler for a concatenative language and would like to add type inference support. I understand Hindley–Milner, but I’ve been learning the type theory as I go, so I’m unsure of how to adapt it. Is the following system sound and decidably inferable?
A term is a literal, a composition of terms, a quotat... |
The Expression Problem, populated by Philip Wadler, is a often used to standard problem to evaluate programming languages.
I think it is a very clear and popular example and I wonder if there are any similar standard problems that are possibly also as widely used and as clear.
So, are there any similar standard proble... |
Generic sorting algorithms generally take a set of data to sort and a comparator function which can compare two individual elements. If the comparator is an order relation¹, then the output of the algorithm is a sorted list/array.
I am wondering though which sort algorithms would actually work with a comparator that is... |
In the context of our investigation of heap automata, I would like to prove that a particular variant can not accept non-context-sensitive languages. As we have no equivalent grammar model, I need a proof that uses only automata; therefore, I have to show that heap automata can be simulated by LBAs (or an equivalent mo... |
It seems to me that the per-record timeline consistency as defined by Cooper et al. in "PNUTS: Yahoo!’s Hosted Data Serving Platform" mimics the (older?) definition of monotonic writes. From the paper:
per-record timeline consistency: all replicas of a given record apply
all updates to the record in the same order.
... |
Maybe I am missing something obvious, but can it be that P = co-NP $\subsetneq$ NP or vice versa? My feeling is that there must be some theorem that rules out this possibility.
|
Is the following statement always true:
if there is a mixed-strategy Nash equilibria then it is unique.
I know that there can be several pure strategy Nash equilibrias.
|
Suppose there are two databases, $D_1$ and $D_2$. Let's further assume $D_1$ is always up and $D_2$ can be down sometimes. When it goes up again, it has to restart.
$D_1$ is filled by say a dozen other systems with event messages. Those messages have IDs and might be updated or deleted. $D_2$ needs to be in sync with... |
Equipartition Problem:
Instance: $2n$ positive integers $x_1,\dots,x_{2n}$ such that their sum is even. Let $B$ denote half their sum, so that $\sum x_{i} = 2B$.
Query: Is there a subset $I \subseteq [2n]$ of size $|I| = n$ such that $\sum_{i \in I} x_{i} = B$?
Can the partition problem - same as the above but without ... |
Is it theoretically possible to specify a programming language for which no implementation could exist? A programming language is a way of defining functions. An implementation means a method to execute a given program in that language on a given input to the output of the function corresponding to the program on that ... |
I want to determine which parts of an audio file contain speech respectively music.
I hope someone has a made something like this or can tell me where to start. Can you please suggest some method or tutorial for doing the same?
|
It is proven that neural networks with rational weights has the computational power of the Universal Turing Machine Turing computability with Neural Nets. From what I get, it seems that using real-valued weights yields even more computational power, though I'm not certain of this one.
However, is there any correlation ... |
This statement of the pumping lemma from Wikipedia.
Let $L$ be a regular language. Then there exists an integer $p \ge 1$ (depending only on $L$) such that every string $w$ in $L$ of length at least $p$ ($p$ is called the "pumping length") can be written as $w = x y z$ (i.e., $w$ can be divided into three substrings)... |
Are there any problems in $\mathsf{P}$ that have randomized algorithms beating lower bounds on deterministic algorithms? More concretely, do we know any $k$ for which $\mathsf{DTIME}(n^k) \subsetneq \mathsf{PTIME}(n^k)$? Here $\mathsf{PTIME}(f(n))$ means the set of languages decidable by a randomized TM with constant-b... |
Is there any scientific work about deep copying? So far I have only found source codes (Java, Python, ...). However, there are various approaches and nobody seems to evaluate them.
Reflection-based (Python)
Auto-generated shallow-copy-based (Java)
Compiler-generated polymorphic deep copy (anybody?)
The last one seems... |
Before reading The Art of Computer Programming (TAOCP), I have not considered these questions deeply. I would use pseudo code to describe algorithms, understand them and estimate the running time only about orders of growth. The TAOCP thoroughly changes my mind.
TAOCP uses English mixed with steps and goto to describe ... |
In Logic In Computer Science (2nd Edition - Michael Huth and Mark Ryan), exercise 2.4.12.k is the following:
For each of the formulas of predicate logic below, either find a model which
does not satisfy it, or prove it is valid.
This one is difficult:
(∀x ∃y (P(x) → Q(y))) → (∃y ∀x (P(x) → Q(y)))
Not only am I ... |
I was trying to come up with a system that would evaluate bylaws for an organization as to determine their underlying logic.
I think a first-order predicate system would work for representing the rules, which could be translated from the text via part-of-speech tagging and other NLP techniques.
Is there a systematic ... |
As the title says, has anyone found a polynomial time algorithm for checking whether two graphs having a Hamiltonian cycle are isomorphic? Is this problem NP-complete?
|
If we have an algorithm that need to run $n=2$ operations and then halt, I think we could say the problem it solves, is tractable, but if $n=10^{120}$ althought It could be theoretically solvable it seems to be intractable, and what about a problem that needs $n=10^{1000}$, or $n=10^{10^{1000}}$ operations, that's seem... |
Given a language $ L= \{a^n b^n c^n\}$, how can I say directly, without looking at production rules, that this language is not regular?
I could use pumping lemma but some guys are saying just looking at the grammar that this is not regular one. How is it possible?
|
A graph is 2∀-connected if it remains connected even if any single edge is removed. Let G = (V, E) be a connected undirected graph. Develop an algorithm as fast as possible to check 2∀-connectness of G.
I know the basic idea is to build a DFS searching tree and then check each edge is not on a circle with DFS. Any help... |
In the book "Computational Geometry: Algorithms and Applications" by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of illegal edges -- edges that may not appear in a valid Delaunay triangulation and have to be replaced by some othe... |
Are there any good Discrete mathematics learning web resources with problem sets?
|
Introduction
Step One
I wrote a standard backpropegating neural network, and to test it, I decided to have it map XOR.
It is a 2-2-1 network (with tanh activation function)
X1 M1
O1
X2 M2
B1 B2
For testing purposes, I manually set up the top middle neuron (M1) to be an AND gate and the lower neuron (M2) to... |
I have seen this function in past year exam paper.
public static void run(int n){
for(int i = 1 ; i * i < n ; i++){
for(int j = i ; j * j < n ; j++){
for(int k = j ; k * k < n ; k++){
}
}
}
}
After give some example, I guess it is a function that with time complexity in... |
I'm learning Data Structures and Algorithms now, I have a practical question that asked to write a function with O(log3n), which means log(n)*log(n)*log(n).
public void run(int n) {
for (int i = 1; i < n; i *= 2) {
for (int j = 1; j < n; j *= 2) {
for (int k = 1; k < n; k *= 2) {
... |
Given two sets $A$ and $B$ each containing $n$ disjoint points
in the plane, compute the shortest distance between a point in $A$ and a point in $B$, i.e., $\min \space \{\mbox{ } \text{dist}(p, q) \mbox{ } | \mbox{ } p \in A \land q \in B \space \} $.
I am not sure if I am right, but this problem very similar to p... |
Wikipedia defines side-channel attacks as:
any attack based on information gained from the physical implementation of a cryptosystem
Usually in side channel attacks the implementations leak information (e.g., timing attack: the implementation leaks the time it takes to complete a task, etc.)
Are tampering-attacks als... |
I am guessing that this is correct for 3-EXP, 4-EXP etc...
Basically I should find a problem in 2-EXP that is not in EXP.
Any examples ?
|
Take a semi-decidable problem and an algorithm that finds the positive answer in finite time. The run-time of the algorithm, restricted to inputs with a positive answer, cannot be bounded by a computable function. (Otherwise we’d know how long to wait for a positive answer. If the algorithm runs longer than that we kno... |
So, in lectures about Rice's Theorem, reduction is usually used to proved the theorem. Reduction usually consists a construction of $M'$, using a TM $M$ which is in the form $\langle M,w \rangle$ to be simulated first, an input $x$ to be simulated if $M$ accepts. $M'$ accepts if x is accepted.
I really want a concret... |
In type theory judgements are often presented with the following syntax:
My question is what is that symbol in the middle called? All the papers I've found seem to use an image rather than a unicode character so I can't look it up. I've also not found any type-theory reference which says what that symbol is (they expl... |
I am reading "Efficient Cryptographic Schemes Provably as Secure as Subset Sum" by R. Impagliazzo and M. Naor (paper) and came across the following statement in the proof of Theorem 3.1 (pages 10-11):
Let $\ l(n) = (1-c)n \ $ for $ \ c > 0 \ $ ...
Given $a_1, a_2, \cdots, a_n \in \{0,1\}^{l(n)}$ and a target sum $T$... |
I have one puzzle whose answer I have boiled down to finding the total number and which type of permutation they are.
For example if the string is of length ten as $w = aabbbaabba$, the total number of permutations will be
$\qquad \displaystyle \frac{|w|}{|w|_a! \cdot |w|_b!} = \frac{10!}{5!\cdot 5!}$
Now had the stri... |
Possible Duplicate:
Restricted version of vertex cover
Suppose we have a $(A,B,E)$ bipartite graph and a positive integer k. Suppose that k is smaller than $|A|$ and we want to find one of those k element subsets of $A$ which covers the most points from $B$. I can only come up wirh exponential algorithms. Is this in... |
How can I prove that the cover time for a directed graph $G$ can be exponential in the size of $G$?
The cover time is the expected length of a random walk that visits all vertices.
|
For a given planar graph $G(V,E)$ embedded in the plane, defined by a set of line segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for the planar subdivision, describe an algorithm, prove it's correctness an... |
I have been investigating parallel algorithms to compute certain two-dimensional dynamic programming recursions (on natural parameters); see also here. Under certain assumptions, cases one and two can actually be computed in parallel -- and very well. However, if you assume that communicating array entries from one thr... |
Given a set $S$ of points $p_1,..,p_2$ give the most efficient algorithm for determining if any 3 points of the set are collinear.
The problem is I started with general definition but I cannot continue to actually solving the problem.
What can we say about collinear points in general, 3 points $a,b,c$ are collinear i... |
Apologies for another Markov Chain question but this one is best given its own question to avoid confusion. I am using a Markov Chain to get the 10 best search results from the union of 3 different search engines. The top 10 results are taken from each engine to form a set of 30 results.
The chain starts at State x, a ... |
I've been given the following problem:
Given a data structure $M$ that is based on comparisons and supports the following methods on a group of numbers $S$:
$\text{Insert}(x)$ – add $x$ to $S$
$\text{Extract_min}()$ – remove the minimal element in $S$ and return it
We can implement with a heap the above methods in $... |
I am using a digital computer to write this message. Such a machine has a property which, if you think about it, is actually quite remarkable: It is one machine which, if programmed appropriately, can perform any possible computation.
Of course, calculating machines of one kind or another go back to antiquity. People h... |
Here is a well-known problem.
Given an array $A[1\dots n]$ of positive integers, output the smallest positive integer not in the array.
The problem can be solved in $O(n)$ space and time: read the array, keep track in $O(n)$ space whether $1,2,\dots,n+1$ occured, scan for smallest element.
I noticed you can trade space... |
First of all we must read a word, and a desired size.
Then we need to find the longest palindrome created by characters in this word used in order.
For example for size = 7 and word = "abcababac" the answer is 7 ("abababa").
Postscript: the size of the word is smaller than 3000.
|
Recently I sort of stumbled on a problem of finding an efficient topology given a weighted directed graph. Consider the following scenario:
Node 1 is connected to 2,3,4 at 50 Mbps. Node 1 has 100 Mbps network card.
Node 3 is connected to 5 at 50 Mbps. Node 3 has 100 Mbps card.
Node 4 is connected to Node 3 at 40 Mbps.... |
Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x\mid a\leq x, x\leq b\}$, it is called a integer interval.
What is a fast algorithm to find
$\{ k\oplus x\mid x\in [a..b]\}$ as a union of set of integer intervals.
One can prove that $[a+k..b-k]\subseteq \{ k\oplus x\mid x\in [a..b]\}$ by s... |
Possible Duplicate:
Are there minimum criteria for a programming language being Turing complete?
I overheard a conversation on the topic and the conclusion that one gent came to was that in order to be Turing complete, given one has infinite storage, all one needs is a conditional control structure and a jump instru... |
Most books explain the reason the algorithm doesn't work with negative edges as nodes are deleted from the priority queue after the node is arrived at since the algorithm assumes the shortest distance has been found. However since negative edges can reduce the distance, a future shorter distance might be found; but sin... |
This is an example in my lecture notes.
Is this function with time complexity $O(n \log n)$?.
Because the worst case is the funtion goes into else branch, and 2 nested loops with time complexity of $\log n$ and $n$, so it is $O(n \log n)$. Am I right?
int j = 3;
int k = j * n / 345;
if(k > 100){
System.out.println(... |
If $L_1$ is NP-hard, $L_1 \times L_2$ is NP-hard for every $L_2 \neq \emptyset$, where
$\qquad \displaystyle L_1 \times L_2 = \{(w_1,w_2) \mid w_1 \in L_1, w_2 \in L_2\}$
Is it true or false and why?
I can't prove it but I also don't find counter example.
|
In Cormen et. al., Introduction to Algorithms (3rd ed.), I don't get a line in the proof of Lemma 26.1 which states that the augmented flow $f\uparrow f'$ is a flow in $G$ and is s.t. $|f\uparrow f'| =|f|+|f'|$ (this is pp. 717-718).
My confusion: When arguing flow-conservation they use the definition of $f\uparrow f'... |
I've finished most of the material in Cormen's Intro to Algorithms book and I am looking for an algorithms book that covers material beyond Corman's book. Are there any recommendations?
NOTE: I asked this on stackoverflow but wasn't all too happy with the answer.
NOTE: Looking at most of the comments I think ideally I... |
Suppose we have a directed graph $G=(V,E)$ and two nodes $A$ and $B$.
I would like to know if there are already algorithms for calculating the following decision problem:
Are there at least two paths between $A$ and $B$ of the same length?
How about the complexity? Can I solve it in polynomial time?
I would like to... |
I cannot seem to find an answer to this question with Google, so I am going to ask here: is it required for a good neighbourhood function that it in principle (i. e. by recursively considering all neighbours of a certain solution - which is not practical) can reach all possible solutions?
My question is whether there ... |
In my class we used a Pushdown Automata to Context Free Grammar conversion algorithm that produces a lot extraneous states.
For example, for two transitions, I am getting the following productions
$$\begin{gather*}
\delta(q_0,1,Z) = (q_0,XZ) \\
{}[q_0,Z,q_0] \to 1[q_0,X,q_0][q_0,Z,q_0] \\
{}[q_0,Z,q_0] \to 1[q_0... |
Here is the question: suppose we are given x cents, the amount we want to pay, and a 6-tuple (p, n, d, q, l, t) that represents respectively the number of pennies, nickels, dimes, quarters, loonies and toonies you have. Assume that you have enough coins to pay x cents. You do not have to pay exactly x cents; you can pa... |
Could an artificial neural network algorithm be expressed in terms of map-reduce operations? I am also interested more generally in methods of parallelization as applied to ANNs and their application to cloud computing.
I would think one approach would involve running a full ANN on each node and somehow integrating th... |
I have a directed weighted graph $G = (V, E, W)$. There is always an edge from a vertex $i$ to another one $j$, the weight $w(i,j)$ could be positive infinity, and there does not exist any negative cycle.
An execution of some algorithms will find the lengths (summed weights) of the shortest paths between all pairs of ... |
I'm writing a small function to alter a graph in a certain way and was wondering if there is a formal name for the operation. The operation takes two distinct edges, injects a new node between the existing nodes of each edge and then adds an edge between the two new nodes. For example:
add new nodes a and b to the gr... |
Given two strings, $r$ and $s$, where $n = |r|$, $m = |s|$ and $m \ll n$, find the minimum edit distance between $s$ for each beginning position in $r$ efficiently.
That is, for each suffix of $r$ beginning at position $k$, $r_k$, find the Levenshtein distance of $r_k$ and $s$ for each $k \in [0, |r|-1]$. In other wor... |
There's a question on SO asking why in Java the right type doesn't get picked in a concrete case. I know that Java can't do it in such "complicated" cases, but I'm asking myself WHY?
The (for simplicity slightly modified) line failing to compile is
Map<String, Number> m = ImmutableMap.builder().build();
and the method... |
I have implemented a topological sort based on the Wikipedia article which I'm using for dependency resolution, but it returns a linear list. What kind of algorithm can I use to find the independent paths?
|
I am looking for an algorithm, which given a graph $G$ and a natural number $t$, determines if $G$ is $t$-transitive.
I am also interested in knowing if this problem is in P, NP, NPC or some other interesting facts about its complexity class.
|
I have to proof that if $L_1 \subset L_2$ and $L_1$ is not regular then $L_2$ it not regular. This is my proof. Is it valid?
Since $L_1$ is not regular, there does not exists a finite automata $M_1$ such that $L_1$ is the language of $M_1$. Pick $x\in L_1$. So $x \in L_2$ and suppose that $L_2$ is regular. Then there ... |
I have a problem with the proof for constructing a GNBA (generalized nondeterministic Büchi automaton) for a LTL formula:
Theorem: For any LTL formula $\varphi$ there exists a GNBA $G_{\varphi}$ over alphabet $2^{AP}$ such that:
$\operatorname{Word}(\varphi)=L_{\omega}(G_{\varphi})$.
$G_{\varphi}$ can be costructed i... |
I know the answer without nesting limit is the Catalan number. My question is, specifically, is there a recurrence relation that gives the number of expression containing $n$ pairs of matching brackets such that no more than $l$ open brackets are not closed at any given point?
For instance, for $n=3$ and $l=2$ the answ... |
So I have a problem understanding how the worst-fit protocol for memory allocation reacts to contiguous blocks of empty memory. None of the examples I have found address this possibility.
For example, say you have the following blocks (where 'O' stands for occupied block and 'E' stands for empty block) and are to allo... |
Let $L_1$ be regular, $L_1 \cap L_2$ regular, $L_2$ not regular. Show that $L_1 \cup L_2$ is not regular or give a counterexample.
I tried this: Look at $L_1 \setminus (L_2 \cap L_1)$. This one is regular. I can construct a finite automaton for this: $L_1$ is regular, $L_2 \cap L_1$ is regular, so remove all the path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.