instruction stringlengths 0 29.8k ⌀ |
|---|
Say I have a weighted undirected complete graph `G = (V, E)`. Each edge `e = (u, v, w)` is assigned with a positive weight `w`. I want to calculate the minimum-weighted (d, h)-tree-decomposition. By (d, h)-tree-decomposition, I mean divide the vertices set V into k trees, such that the height of each tree is h, and eac... |
Approximate minimum-weighted tree decomposition on complete graphs |
|data-structures|approximation| |
|algorithms|data-structures|graphs|approximation| |
Say I have a weighted undirected complete graph $G = (V, E)$. Each edge $e = (u, v, w)$ is assigned with a positive weight $w$. I want to calculate the minimum-weighted $(d, h)$-tree-decomposition. By $(d, h)$-tree-decomposition, I mean to divide the vertices $V$ into $k$ trees, such that the height of each tree is $h$... |
A very simple approach for question 2 is the following. Sort the edges by capacity. Remove the edge with lowest capacity, and check if there is still a path from $s$ to $t$. If there is, move on the edge with the second lowest capacity, and so on.
At some point, we will disconnect $s$ from $t$ by removing an edge of... |
One of the repeating tasks CS practitioners and theorists face is gaining confidence in the correctness of their code.
There are two main approaches:
1. Proof: Devise a logical proof that part of a system has certain properties, possibly aided by preconditions, design-by-contract, code checkers.
2. Testing: Test... |
|algorithms|distributed-systems|clocks| |
One of the repeating tasks CS practitioners and theorists face is gaining confidence in the correctness of their code.
There are two main approaches:
1. Proof: Devise a logical proof that part of a system has certain properties, possibly aided by preconditions, design-by-contract, code checkers.
2. Testing: Test... |
null |
One of the repeating tasks CS practitioners and theorists face is gaining confidence in the correctness of their code.
There are two main approaches:
1. Proof: Devise a logical proof that part of a system has certain properties, possibly aided by preconditions, design-by-contract, code checkers.
2. Testing: Test... |
Normally in algorithms we are not care about comparison, addition, subtraction of numbers, we say they are O(1), for example by this way, comparison based sorting is $O(n\log n)$, but if numbers are big we can't do this in registers, and normally we should implement it with string,... but this causes to extra calculati... |
How we can assume comparison, addition, ... between numbers is $O(1)$ |
|complexity-theory|time-complexity| |
null |
I couldn't find any studies of this, but Kozen says in the introduction to "The Design and Analysis of Algorithms" that the $O(1)$ model "reflects experimental observation more accurately [than the log-cost model] for data of moderate size (since multiplication really does take one unit of time)." He also gives a refer... |
It just depends on the context. When dealing with [bit level complexity][1] of algorithms, we do not say that the addition of two $n$ bits numbers is $O(1)$, we say it is $O(n)$. Similarly for [multiplication][2] etc.
[1]: http://en.wikipedia.org/wiki/Bit_complexity
[2]: http://en.wikipedia.org/wiki/Integer_m... |
null |
Normally in algorithms we do not care about comparison, addition, subtraction of numbers, we say they are $O(1)$, for example by this way, comparison based sorting is $O(n\log n)$, but if numbers are big we can't do this in registers, and normally we should implement it with string,... but this causes extra calculation... |
null |
You are right, in general we cannot assume they are O(1).
Strictly speaking, if we want to sort an array with N different numbers using comparisons, then on the worst case, each comparison may involve $O(log N)$ comparisons on the bit level. And if our algorithm does $O (N log N)$ comparisons, then its total complex... |
As $L$ is regular, it is generated by a right-linear grammar for which all rules have the form $A \to aB$, $A \to a$ or $A \to \varepsilon$ (showing this is an easy exercise). So without loss of generality, we assume that $G=(N,T,\delta,S)$ with $\mathcal{L}(G)=L$ has this form.
Now we construct a new grammar that g... |
I have had problems accepting the complexity theoretic view of "efficiently solved by parallel algorithm" which is given by the class [NC](https://en.wikipedia.org/wiki/NC_%28complexity%29):
> NC is the class of problems that can be solved by a parallel algorithm in time $O(\log^cn)$ on $p(n) \in O(n^k)$ processors ... |
How to scale down parallel complexity results to constantly many cores? |
|complexity-theory|reference-request|parallel-computing| |
You are right, in general we cannot assume they are $O(1)$.
Strictly speaking, if we want to sort an array with N different numbers using comparisons, then on the worst case, each comparison may involve $O(\log N)$ comparisons on the bit level. And if our algorithm does $O (N \log N)$ comparisons, then its total com... |
I couldn't find any studies of this, but Kozen says in the introduction to "The Design and Analysis of Algorithms" that the $O(1)$ model "reflects experimental observation more accurately [than the log-cost model] for data of moderate size (since multiplication really does take one unit of time)." He also gives a refer... |
null |
null |
If you assume that the number of processors is bounded by a constant, then you are right that a problem being in NC does not mean much in practice. Since any algorithm on a PRAM with <i>k</i> processors and <i>t</i> parallel time can be simulated with a single-processor RAM in O(<i>kt</i>) time, the parallel time and ... |
You cannot show, for an arbitrary unrecognizable language $C$, that $\overline{A_{TM}} \leq_m C$. If $\overline{A_{TM}} \leq_m C$ then in particular the Turing degree of $C$ is greater than or equal to the Turing degree of $\overline{A_{TM}}$, because many-one reducibility implies Turing reducibility. The Turing degre... |
In practice, we don't usually prove just that a language is r.e. or not r.e.. If the language is r.e., we want to know whether it is recursive. If it is not r.e., we want to know what sort of Turing degree it has, not just that the Turing degree is not r.e..
For example, if $P$ is a problem with $P' \equiv_T 0'''$ ... |
The opetaror $A(L)= \{w|ww \in L\}$ is considered as not closed to texst free languages, still, after a lot of thinking, I can't find any CFL that A(L) wouldn't be CFL for it.
Does anyone have an idead for such language?
|
The operator $A(L)= \{w|ww \in L\}$ |
|formal-languages|context-free| |
There is a general fact that every noncomputable Turing degree contains infinitely many distinct $m$-degrees.
(This result follows at least from results of Jockusch, "Relationships between reducibilities", Trans. Amer. Math. Soc. 142 (1969), 229-237. It might have been known before that.) |
To answer the question as stated: algorithmists just do it, fairly often, by using the RAM model. For sorting, in many cases, people even analyze the simpler [comparison model][1].
To answer the implicit question about *why* they do it: I would say that this model has pretty good predictive power for certain types ... |
The operator $A(L)= \{w|ww \in L\}$ is considered as not closed on context free languages. Still, after a lot of thinking, I can't find any CFL for which A(L) wouldn't be CFL.
Does anyone have an idea for such a language?
|
Consider the operator $A(L)= \{w \mid ww \in L\}$. Apparently, the class of context free languages is not closed against $A$. Still, after a lot of thinking, I can't find any CFL for which $A(L)$ wouldn't be CFL.
Does anyone have an idea for such a language?
|
|formal-languages|context-free|closure-properties| |
Mapping Reductions to Complement of A$_{TM}$ |
You are right, in general we cannot assume they are $O(1)$.
Strictly speaking, if we want to sort an array with N numbers using comparisons, and the largest number is M, then on the worst case, each comparison may involve $O(\log M)$ comparisons on the bit level. And if our algorithm does $O (N \log N)$ comparisons,... |
I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$
where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accepts string } w\}$
which is great for proving undecidability. But say I want to prove unrecognizability ins... |
I agree wit you that $NC$ is not the best way to characterize efficient parallel algorithms.
Indeed, by definition NC also includes lots of problems which are not efficiently parallelizable. A common example is parallel binary search. The problem arises because parallel binary search has polylogarithmic time complex... |
null |
To answer the question as stated: algorithmists just do it, fairly often, by using the RAM model. For sorting, in many cases, people even analyze the simpler [comparison model][1], which I discuss a little more in the linked answer.
To answer the implicit question about *why* they do it: I would say that this model... |
So you said you tried $L = \{0^n 1^n 0^m 1^m \mid n,m\geq 0\}$, which I agree is context-free, but you say $A(L)$ is also context-free, which is not true. You can prove $A(L)$ is not context-free using the pumping lemma.
The repetition of the powers $m$ and $n$ in words in $L$ isn't actually significant, so more si... |
DELETED WHILE I READ THE QUESTION PROPERLY |
{"Voters":[{"Id":1214,"DisplayName":"Tara B"}]} |
I would say that we typically assume O(1) arithmetic operations because we're usually doing things in the context of 32-bit integers or 64-bit integers or IEEE 754 floating point numbers. O(1) is probably a pretty good approximation for that kind of arithmetic.
But in general, that's not true. In general you need ... |
{"Voters":[{"Id":1214,"DisplayName":"Tara B"}]} |
As an amplification of sdcvvc's hint: You can find a context-free language $L$ such that $A(L) = \{a^m b^m c^m \mid m\geq 0\}$, which as you probably know is not context-free. |
I agree wit you that $NC$ is not the best way to characterize efficient parallel algorithms.
Indeed, by definition NC also includes lots of problems which are not efficiently parallelizable. A common example is parallel binary search. The problem arises because parallel binary search has polylogarithmic time complex... |
You cannot show, for an arbitrary unrecognizable language $C$, that $\overline{A_{TM}} \leq_m C$. If $\overline{A_{TM}} \leq_m C$ then in particular the Turing degree of $C$ is greater than or equal to the Turing degree of $\overline{A_{TM}}$, because many-one reducibility implies Turing reducibility. The Turing degre... |
null |
I agree with you that $NC$ is not the best way to characterize efficient parallel algorithms.
Indeed, by definition NC also includes lots of problems which are not efficiently parallelizable. A common example is parallel binary search. The problem arises because parallel binary search has polylogarithmic time comple... |
null |
Two most important field that logic plays vital role is:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractable][2].
I can't define them in two paragraph, but simple survey will introduce you to them.
[1]: http://en.wikipedia.org/wiki/Formal_language#Language-specification_for... |
null |
Two most important fields that logic plays vital role are:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractablility][2].
I can't define them in two paragraph, but simple survey will introduce you to them.
[1]: http://en.wikipedia.org/wiki/Formal_language#Language-specificati... |
null |
There are extremely *deep* and *pervasive* connections between logic and computer science. In understanding what they might be, keep in mind that computer science is also called "information technology" or "informatics", meaning that computer systems capture, process and deliver information. Well, logic is a similar ... |
Two most important fields that logic plays vital role are:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractable classes][2].
I can't define them in two paragraph, but simple survey will introduce you to them.
---
Seems needs some clarification, in formal languages you need ... |
Two most important fields that logic plays vital role are:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractable classes][2].
I can't define them in two paragraph, but simple survey will introduce you to them.
---
Seems needs some clarification, in formal languages you need ... |
Two most important fields that logic plays vital role are:
1. [Formal Language specification and verification][1].
2. [Fixed parameter tractable classes][2].
---
Seems needs some clarification, in formal languages you need to extremely work on logic, for clarification take a look at:
1. [Formal language][3].... |
For people like me who study algorithms for a living, the 21st-century standard model of computation is the *integer RAM*. The model is intended to reflect the behavior of real computers more accurately than the Turing machine model. Real-world computers process multiple-bit integers in constant time using parallel h... |
For people like me who study algorithms for a living, the 21st-century standard model of computation is the *integer RAM*. The model is intended to reflect the behavior of real computers more accurately than the Turing machine model. Real-world computers process multiple-bit integers in constant time using parallel h... |
null |
|algorithms|complexity-theory|time-complexity| |
For people like me who study algorithms for a living, the 21st-century standard model of computation is the *integer RAM*. The model is intended to reflect the behavior of real computers more accurately than the Turing machine model. Real-world computers process multiple-bit integers in constant time using parallel h... |
Normally in algorithms we do not care about comparison, addition, subtraction of numbers, we say they are $O(1)$, for example by this way, comparison based sorting is $O(n\log n)$, but if numbers are big we can't do this in registers, and normally we should implement it with string,... but this causes extra calculation... |
I am confused about the following claim: "The only values in the untyped lambda calculus are lambda-abstractions".
Why are the other terms not values? What does it mean for a lambda-abstraction to be a value? The first thing that came to my mind was that maybe lambda-abstractions are the only possible normal forms, ... |
Why are lambda-abstractions the only terms that are values in the untyped lambda calculus? |
|lambda-calculus| |
There are a number of things going on here:
* The language you are talking about has no additional data types, otherwise there would be other kinds of values.
* The reduction strategy of the language does not reduce inside lambda abstractions. Both call-by-value and call-by-name conform to this. Otherwise, not ever... |
I've encountered same problem, but took different approach.
You can construct some kind of "hash" function, which will for similar word give same or near number.
Problem is, that function which will give "good" result for words with inserting/removing, will give "bad" for transition, and vice versa.
Example: map l... |
|logic|lambda-calculus| |
null |
There are a number of things going on here:
* The language you are talking about has no additional data types, otherwise there would be other kinds of values.
* The reduction strategy of the language does not reduce inside lambda abstractions. Both call-by-value and call-by-name conform to this. Otherwise, not ever... |
null |
The operator $A(L)= \{w \mid ww \in L\}$ |
null |
Worst-case Hardness of NP-complete problems is not sufficient for cryptography. Even if NP-complete problems are hard in the worst-case ($P \ne NP$), they still could be efficiently solvable in the average-case. Cryptography assumes the existence of average-case intractable problems in NP. Also, proving the existence ... |
null |
null |
I am currently learning assembly programming on wombat 4, I am looking at Frame pointers. I understand exactly what a frame pointer is: it is a register and are used to access parameters on a stack. But i'm confused on how they affect the program counter and why they are preferred over normal registers.
Could som... |
Frame Pointers in Assembler |
|computer-architecture|programming| |
We are missing some context so I have no idea what point Knuth is trying to make, but here's how to interpret a Turing machine this way. Perhaps it will help you understand what's going on. In general, a good way of getting a grip on a concept is playing with it. In the case of programming paradigms, that means writing... |
I am trying to attack TAOCP once again, given the sheer literal heaviness of the volumes I have troubles in committing to it seriously. In TAOCP 1 Knuth writes, page 8, basic concepts.
---
Let A be a finite set of letters. Let $A^*$ be the set of all strings in A (the set of all ordered sequences $x_1$ $x_2$ ... $x... |
Please explain this Knuth's TAOCP 1 phrase |
|algorithms| |
null |
As the stack pointer may change while a function is executed, access to the stack is less confusing with a static frame pointer, that is set upon the entry to the function, so relative addressing becomes simpler.
On reason for using the stack to store parameters is that there is usually more memory available than re... |
I am currently learning assembly programming on wombat 4, I am looking at Frame pointers. I understand exactly what a frame pointer is: it is a register and are used to access parameters on a stack. But i'm confused on how they affect the program counter and why they are preferred over normal registers.
Could some ... |
null |
I am trying to attack TAOCP once again, given the sheer literal heaviness of the volumes I have troubles in committing to it seriously. In TAOCP 1 Knuth writes, page 8, basic concepts.
> Let A be a finite set of letters. Let $A^*$ be the set of all strings in A (the set of all ordered sequences $x_1$ $x_2$ ... $x_n$... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.