instruction stringlengths 0 29.8k ⌀ |
|---|
A regular graph is one in which each vertex has the same number of neighbors, but in a star topology the central vertex is connected to more than one vertex. So, why is it referred to as a regular graph?
|
How is a star topology a regular graph? |
null |
I need some help with the following question:
One of the languages
$$L_1 = \{a^pb^{q+r}c^sd^{q+t}e^{p+r} \mid p, q, r, s \ge 0\ , s > t\}$$
$$L_2 = \{a^{p+q}b^rc^sd^{q+r}e^s \mid p, q, r, s \ge 0\}$$
is context-free and the other is not. Build a context-free grammar for the one that is. For the other one ... |
Pumping lemma problem |
|formal-languages|automata|context-free|pumping-lemma| |
If the grammar is ambiguous (at least one sentence has more than one parse tree), then the grammar is not in LL(1).
In general, you compute the LL(1) parse table and use it to answer the question. Your grammar is LL(1) if each cell in the table has at most 1 grammar rule. In other words, at least one table entry has... |
###Worst-case complexity
$\mathcal{O}(log\ M)$ insert, search, delete [see 'Lemma 3.1']
$\dagger\ \mathcal{O}(1)$ findMin, findMax, extractMin, extractMax, predecessor, successor
$2M + \mathcal{O}(log\ M)$ bits of ordinary memory and $m$ bits of Yggdrasdil memory [this second type of memory is defined in the p... |
The codomain of $F$ should be Turing machines (or machines in some other particular model of computation) not the complexity class itself. You can't identify the machines that decide sets in a complexity class with the sets in the complexity class because it is not a one-one correspondence. Moreover a complexity class ... |
You are actually wrong. I'll give you a hint for the grammar of $L_1$. Rewrite it as $a^p b^r b^q c^{s-t} c^t d^t d^q e^r e^p$. Although I have no idea how the case $s = 0, q = 0$ (thus $q+t < 0$) is supposed to work.
For $L_2$ there is an implicit comparison $r \leq q+r$. Take $p = q = 0$ so that the string is $b^r... |
With reference to an article here
http://en.wikipedia.org/wiki/Processor_register
it says
Address registers hold addresses and are used by instructions that indirectly
access primary memory.
Which addresses is the above link referring to?
|
categories of registers and and storage in them |
|untagged| |
The [Wikipedia article on processor registers](http://en.wikipedia.org/wiki/Processor_register) mentions:
> Address registers hold addresses and are used by instructions that indirectly access primary memory.
Which addresses does this sentence refer to?
|
|computer-architecture|memory-access| |
RAM addresses of course. For example, in x86 architecture an IP (instruction pointer) register holds the memory address of the next instruction that is going to be read and executed. This register cannot be accessed directly (it can be modified by jumps though). Also, in x86 an SP (stack pointer) register shows the top... |
null |
|computability|terminology|history| |
You have to first understand what is the problem here. A problem is usually a relation between inputs and outputs. The complexity is a measure of difficultly for algorithms to obtain input from the output. A single instance of a problem like the one you have are trivial, since there *exists* an algorithm that would out... |
You have to first understand what is the problem here. A problem is usually a relation between inputs and outputs. The complexity is a measure of difficultly for algorithms to obtain input from the output. A single instance of a problem like the one you have are trivial, since there *exists* an algorithm that would out... |
I'm attempting to use the MT19937 variant of the Mersenne Twister PRNG to accomplish something. Whether or not this something is feasible depends upon the answers to these two questions:
What is the greatest value of **m** for which the following statements hold true:
1 - For all seed values, the algorithm event... |
Will the Mersenne Twister PRNG eventually produce all integer sequences of a certain length? |
|algorithms|pseudo-random-generators| |
There are three typical ways to allocate memory for programs: static, stack and dynamic heap. However, when I look at the implementation of dynamic heap memory allocation from wikipedia [dynamic heap memory allocation from wikipedia ][1], what I found is fixed block allocation, etc. So why dynamic memory allocation is ... |
How Does Dynamic Heap Storage Have Something to Do with Heap? |
|programming-languages|compilers|operating-systems| |
A grammar (not a language!) is ambiguous if there is a word with two "essentially different" parses. Roman numerals are unambiguous - given a roman numeral, it has an unambiguous numerical value. The fact that this correspondence is not one-to-one is beside the point. |
An ambiguous Language is a formal Languages for which there exists a string that can have more than one meaning (several possible meanings or interpretations).
Multiple synthesis stricture for a string.
**[Question]**
Is Roman numbers are Example of An ambiguous Language?
Because there can be more then ... |
Roman Number is ambiguous language? |
|formal-languages| |
null |
###Worst-case complexity
**$\boldsymbol{\mathcal{O}(1)}$ insertion**
**$\boldsymbol{\mathcal{O}(log\ \textbf{min}\{w_x, q_x\})}$ get-min, extract-min, delete, and decrease of an element $\boldsymbol{x}$**
Where $w_x$ (respectively, $q_x$) is the number of elements that were accessed after (respectively, befor... |
**From [lecture][1] notes by Prof. Danny Sleator:**
Basic DFS algorithm: Each vertex has a binary field called
"visited(v)". Here's the algorithm in pseudo-code:
for all v in V do visited(v) = 0
for all v in V do if (visited(v)==0) DFS(v)
DFS(v) {
visited(v) = 1
... |
**From [lecture][1] notes by Prof. Danny Sleator:**
Basic DFS algorithm: Each vertex has a binary field called
"visited(v)". Here's the algorithm in pseudo-code:
for all v in V do visited(v) = 0
for all v in V do if (visited(v)==0) DFS(v)
DFS(v) {
visited(v) = 1
... |
|algorithms|graphs|correctness-proof| |
null |
|algorithms|graphs|correctness-proof| |
There are three typical ways to allocate memory for programs: static, stack and dynamic heap. However, when I look at the implementation of [dynamic heap memory allocation from wikipedia ][1], what I found is fixed block allocation, etc. So why is dynamic memory allocation called "heap" memory allocation? How does it h... |
|programming-languages|compilers|operating-systems|memory-management|memory-allocation| |
I'm currently studying the book "Introduction to Algorithms - Cormen". Although a proof of correctness for the BFS algorithm is given, there isn't one any for the DFS in the book. So I was courious about how it can be shown that DFS visits all the nodes.
I also googled for it. But it seems that every lecturer do some ... |
RAM addresses or addresses of I/O devices. For example, in x86 architecture an IP (instruction pointer) register holds the memory address of the next instruction that is going to be read and executed. This register cannot be accessed directly (it can be modified by jumps though). Also, in x86 an SP (stack pointer) regi... |
Heap memory and the heap data structure are two different and unrelated things. This really bothered me when I was learning about memory, especially since stack memory was actually a stack. The original use of the word heap in computer science referred to the data structure. However, in the 1970s some authors began to ... |
AJed puts things very nicely, and ajmartin has provided you with a proof too. I would like to add the following to your second question:
If you *really* understood the algorithm, then you should also understand these properties of the algorithm, and be able to *explain* them to others (such as how and why a shortest... |
null |
AJed puts things very nicely, and ajmartin has provided you with a proof too. I would like to add the following to your second question:
If you *really* understood the algorithm, then you should also understand these properties of the algorithm, and be able to *explain* them to others (such as how and why a shortest... |
AJed puts things very nicely, and ajmartin has provided you with a proof too. I would like to add the following to your second question:
If you *really* understood the algorithm, then you should also understand these properties of the algorithm, and be able to *explain* them to others (such as how and why a shortest... |
AJed puts things very nicely, and ajmartin has provided you with a proof too. I would like to add the following to your second question:
If you *really* understood the algorithm, then you should also understand these properties of the algorithm, and be able to *explain* them to others informally - say to friends or ... |
I am new to Computability Theory and find it is both amazing and confusing. Specifically, it is difficult for me to get through the undecidability of the well-known Halting Problem.
> **Halting function:** The Halt function takes an input a pair $<\alpha, x>$ and outputs 1 if and only if the TM $M_{\alpha}$ represe... |
Is the undecidable function $UC$ well-defined for proving the undecidability of Halting Problem? |
|computability|proof-techniques|undecidability|halting-problem| |
I was reading about decision problem. I understand that decision problem tell yes/no answer for an input. The decision is based on a decision procedure also called an algorithm.
The wikipedia says that
It is traditional to define the decision problem equivalently as: the set of inputs for which the problem ... |
Decision problem and algorithm |
|computability|turing-machines|undecidability|decision-problem| |
I was reading about decision problem. I understand that decision problem tell yes/no answer for an input. The decision is based on a decision procedure also called an algorithm.
The wikipedia says that
> It is traditional to define the decision problem equivalently as: the set of inputs for which the problem re... |
In the 1920's and 1930's people were trying to figure out what it means to "effectively compute a function" (remember, there were no general purpose computing machines around, and computing was something done by people).
Several definitions of "computable" were proposed, of which three are best known:
1. [The $\l... |
The function $UC$ is well-defined. Of course, the definition is not given by some sort of algorithm but by a formal statement. In particular, the value of $UC(\alpha)$ can be either 1, if some condition $X$ is satisfied, or 0 if condition $Y$ is satisfied. But since $X$ ($M_\alpha(\alpha)=1$) is the negation of $Y$ ($M... |
In classical logic it is possible to define a function which is not computable, and $UC$ is such a function. What probably confuses you is that you think that a function must always be given in a symbolic form, or as a set of instructions on how to compute it, or some such. But this is not necessary. Officially a funct... |
In classical logic it is possible to define a function which is not computable, and $UC$ is such a function. What probably confuses you is that you think that a function must always be given in a symbolic form, or as a set of instructions on how to compute it, or some such. But this is not necessary. Officially a funct... |
I am afraid your reasoning is not exactly right.
A grammar is LL(1) if we can predict the production used from the current nonterminal $A$ to be rewritten and the next terminal $a$ in the string. $\newcommand{\To}{\Rightarrow}$
Using $\To$ to denote *leftmost* derivation, if $S\To^* uAv \To uax$, we must have used ... |
In classical logic it is possible to define a function which is not computable, and $UC$ is such a function. What probably confuses you is that you think that a function must always be given in a symbolic form, or as a set of instructions on how to compute it, or some such. But this is not necessary. Officially a funct... |
In classical logic it is possible to define a function which is not computable, and $UC$ is such a function. What probably confuses you is that you think that a function must always be given in a symbolic form, or as a set of instructions on how to compute it, or some such. But this is not necessary. Officially a funct... |
Traditionally, in computability theory all problems are encoded in terms of numbers, or sometimes strings of bits $0$ and $1$. This is a very "low level" kind of thing, it is like programming directly in machine code. The reason for doing this is mostly historic. Gödel originally encode first-order logic in terms of nu... |
**Edit:** This answer is for $k<n$. Without bounding $k$ in terms of $n$ the expression is unbounded.
If $k=n-1$ then your expression becomes
$O\left ({{2(n-1)}\choose{n-1}}\right)$. Notice that by Stirling's formula for any $0<\alpha<1$
$${m \choose {\alpha m}}= \Theta(m^{-{1/2}} 2^{H(\alpha)m}),$$
where $H(q)=... |
I'm attempting to use the MT19937 variant of the Mersenne Twister PRNG to accomplish something. Whether or not this something is feasible depends upon the answers to these two questions:
What is the greatest value of **m** for which the following statements hold true:
1 - For all seed values, the algorithm event... |
I'm attempting to use the MT19937 variant of the Mersenne Twister PRNG to accomplish something. Whether or not this something is feasible depends upon the answers to these two questions:
What is the greatest value of **m** for which the following statements hold true:
1 - For all seed values, the algorithm event... |
summarizing the comments:
by the standard definition, a star is not a regular graph. |
null |
null |
I'm trying to practice myself with random algorithms.
Lets call a CNF formula over n variables s-formula if it is either unsatisable or it has at
least $\frac{2^n}{n^{10}}$ satisfying assignments.
I would like your help with show a randomized algorithm for checking the
satisfiability of s-formulas, that outputs... |
randomized algorithm for checking the satisfiability of s-formulas, that outputs the correct answer with probability at least $\frac{2}{3}$ |
summarizing the comments:
by the [standard definition](http://en.wikipedia.org/wiki/Regular_graph), a [star](http://en.wikipedia.org/wiki/Star_graph) is not a regular graph.
They might defined "regular" in a different way than common to apply to star topology. Specifically, in the paper the OP point out "regular"... |
How do you determine the Time Complexity of a Genetic Algorithm(in general)? If possible.
I have been thinking about this a lot, and all of the teaching I have had is related to determining the Time Complexity of problems that are much less stochastic in nature.
Regards |
GA Time Complexity |
|time-complexity| |
|time-complexity|evolutionary-computing| |
null |
**Edit:** In my case, $k$ may be greater than $n$ and they grow independently.
I have a recursive algorithm with time complexity equivalent to choosing k elements from n with repetition, and I was wondering whether I could get a more simplified big-O expression.
Specifically, I'd expect some explicit exponential... |
An article that claims to introduce it: [IELR(1): Practical LR(1) Parser Tables for
Non-LR(1) Grammars with Conflict Resolution][1] by Joel E. Denny and Brian A. Malloy, Clemson University, is freely available from Malloy's site.
What they are worth is something I can't answer. (Personally I don't understand the ne... |
The translation from Arabic numbers to Roman numbers is very straight forward and absolute not 'unambiguous'.
You can translate each Arabic digit to exact one Roman representation.
Arabic: 1 2 3 4 5 6 7 8 9
Roman: I II III IV V VI VII VIII IX
Arabic: 1... |
null |
An ambiguous Language is a formal Languages for which there exists a string that can have more than one meaning (several possible meanings or interpretations). Multiple synthesis structures for a string.
**[Question]**
Are Roman numbers an example of an ambiguous language?
Because there can be more then ... |
|formal-languages|formal-grammars| |
Genetic algorithms are a metaheuristic and as such there is no general analysis that applies to all genetic algorithms at once (without being super loose). In general, when you are search for information on the run-time of genetic algorithms, you will have more luck if you use the terms "convergence time", since that i... |
How do you determine the Time Complexity of a Genetic Algorithm(in general)? If possible.
I have been thinking about this a lot, and all of the teaching I have had is related to determining the Time Complexity of problems that are much less stochastic in nature. |
Time Complexity of Genetic Algorithms |
Have read in Compiler textbook that type inference is context sensitive. Can anyone explain why is it so? This means that we need context sensitive grammar in semantic analysis phase of a compiler with this feature? How is it done in popular programming languages like C?
|
Type inference in compiler is context sensitive? |
|formal-languages|programming-languages|context-free|compilers|context-sensitive| |
I agree with the previous answers, and I also add the following.
We usually dont care about the time complexity of a genetic algorithm. We usually care how good are the results in comparison to some benchmark, and about the convergence rate.
You can see however that genetic algorithms runs in iterations. Initial... |
null |
What would be a good book/resource that explains the basic idea behind those techniques, how to use (and maybe when to use them) and plenty of exercises with perhaps some worked examples (kind of like when for loops were introduced for the first time you were asked to use one to compute sums of odd numbers, even number... |
Good explanatory resource for algorithm techniques such as greedy, backtracking and recursive functions |
|algorithms| |
The context that is needed tells us the types of known variables. Suppose We want to infer the type of
if b or 2 = x then a else b
To make sense of this we need to
1. Check that the type of `b` is `bool`
2. That the type of `x` is numeric
3. That `a` and `b` have the same type.
All these things we loo... |
The context that is needed tells us the types of known variables. Suppose We want to infer the type of
if b or 2 = x then a else b
To make sense of this we need to
1. Check that the type of `b` is `bool`
2. That the type of `x` is numeric
3. That `a` and `b` have the same type.
To answer these three q... |
I wonder if there is a simple example of sets $A$ and $B$ such that $A$ is Turing-reductible to $B$ but not many-to-one reductible to $B$. |
Is there a simple example of sets such that $A \leq_T B$ but not $A \leq_m B$? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.