instruction
stringlengths
0
29.8k
⌀
|finite-automata|
Questions related to the (computational) complexity of solving problems
null
As a hobby, I have written a basic computer algebra system. My CAS handles expressions as trees. I have advanced it to the point where it can simplify expressions symbolically (i.e., sin(pi/2) returns 1), and all expressions can be reduced to a canonical form. The CAS can also differentiate expressions. Using this ...
Computer Algebra: Algorithms for solving equations symbolically
|computer-algebra|
I am having problems resolving the following question: > Given some problem $X$. If there exists a polynomial time reduction from (for example) $\mbox{SAT}$ to $X$, $(\mbox{SAT} \leq_{p} X)$ and since we know that $\mbox{SAT}$ is $\mbox{NP-complete}$, to show that $X$ is $\mbox{NP-complete}$ is it necessary to show ...
|complexity-theory|terminology|reductions|np|
|terminology|asymptotics|landau-notation|
Finding the minimum subset of intervals covering the whole set
|algorithms|sets|
null
|reference-request|computer-algebra|
null
I have some difficulties in understanding distributed algorithm for tree 6 - coloring in $O(log^*n)$ time. The full description can be found in following paper: [Parallel Symmetry-Breaking in Sparse Graphs. Goldberg, Plotkin, Shannon](http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1613&context=cstech). In...
6-coloring of a tree in a ditributed manner
|algorithms|time-complexity|colorings|
Is there an efficient algorithm to check that a sequence of characters is a concatenation of palindromes? The only thing that comes to my mind is the naive solution: 1. k = 1 2. Split string into k substrings (all possibilities) and check 3. k++ 4. repeat
Is there an algorithm for checking if a string is a catenation of palindromes?
|algorithms|efficiency|
It can be done in linear time (in the size of the input string). Some definitions ---------- Let's define the concept of *maximal palindrome*: A **maximal palindrome of radius k** of a string S is a substring S' such that - starting from the centre, S' reads the same k characters in both directions - but...
It can be done in linear time (in the size of the input string). Some definitions ---------- Let's define the concept of *maximal palindrome*: A **maximal palindrome of radius k** of a string S is a substring S' such that - starting from the centre, S' reads the same k characters in both directions - but...
I have some difficulties in understanding distributed algorithm for tree 6 - coloring in $O(\log^*n)$ time. The full description can be found in following paper: [Parallel Symmetry-Breaking in Sparse Graphs. Goldberg, Plotkin, Shannon](http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1613&context=cstech). I...
6-coloring of a tree in a distributed manner
It can be done in linear time (in the size of the input string). Some definitions ---------- Let's define the concept of *maximal palindrome*: A **maximal palindrome of radius k** of a string S is a substring S' such that - starting from the centre, S' reads the same k characters in both directions - but...
The context free grammar: (e represents epsilon) S --> aSb|aSa|bSa|bSb|e It could generate regular language which means it can be converted to a right linear grammar. Is there a general rule to convert CFG into a RLG?
How to convert a context free grammar (could generate regular language) to a right-linear grammar
|regular-languages|context-free|
null
Problem: Given 11 numbers[N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11] where N1 = amount of profit from product A N2 = amount of profit from Product B N3 = amount of time in **hours** required to make A in factory1(F1) N4 = amount of time in **hours** required to make B in factory1(F1) N5 = maximum numbe...
Maximizing proft
|algorithms|dynamic-programming|knapsack-problems|
Does reduction from an NP-complete problem to some problem $X$ imply that $X\in NP$?
Here's an $O(n\log n)$ algorithm, which is optimal in the algebraic decision tree model by an easy reduction from element distinctness (map each element $x$ to the interval $(x,x+\epsilon)$). We follow Kaveh's outline. Stage 1 runs in $O(n\log n)$ time, so we focus on Stage 2. Let $I$ be the set of intervals in $C =...
An undecidable property of context-free grammars is whether they generate all words over the alphabet. That implies that converting a context-free grammar into a linear grammar (if possible) should be difficult, since it is easy to decide whether a linear grammar (which is the same as an NFA) generates all words over t...
A finite automaton (FA) is simply a machine with limited memory. The FA reads in an input string and does one of two things: accept or reject. In many ways, FAs are realistic abstractions of computers and brains and good depictions of simple machines like vending machines and elevators. You can read more about [finite-...
Given this formula how do you calculate the following? I don't understand, can some one explain? 1 MTTF(System) = ------------------------ [Summation] 1 ------------ MTTFi (was going to upload an ...
Mean time to failure calculation help
|computer-architecture|
***Article:*** CC-Radix: a Cache Conscious Sorting Based on Radix sort ============================================================================== **(IEEE 2003)** I'm trying to figure out what the author means by this section: > Explanation of CC-Radix For clarity reasons, we explain the recursive > ve...
Can someone help me understand cache conscience radix sort? (excerpt from journal article attached)
|algorithms|sorting|
When working with λ-Calculus I see lots of extensions that use other symbols such as ∀ <:Top {} ←, which are from "[Types and Programming Languages][1]" ([WorldCat][2]) by Benjamin C. Pierce. Name Extends/Based on Figure Figure ...
λ-Calculus extensions: meaning of extension symbols
|lambda-calculus|
When working with λ-Calculus I see lots of extensions that use other symbols such as ∀ <:Top {} ←, which are from "[Types and Programming Languages][1]" ([WorldCat][2]) by Benjamin C. Pierce. Name Extends/Based on Figure Figure ...
I have the following homework problem: >A 10 TB disk drive has an MTTF of 6,000,000 hours. How much data can we store in a system comprised of these disks, if we want the system MTTF to be at least 1.2M hours? >If we are allowed to make it redundant (i.e., two of them operating in a parallel mode), and if the MT...
Problem: Given 11 numbers[N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11] where N1 = amount of profit from product A N2 = amount of profit from Product B N3 = amount of time in **hours** required to make A in factory1(F1) N4 = amount of time in **hours** required to make B in factory1(F1) N5 = maximum numbe...
For part 1, its simple. You need to find the $x$ (as defined below) for which MTTF(system) = 1.20M. So 1.20 * 10^6 = 1/[(1/6*10^6)*x] => x = 5. We can have 5 disks (50 TB) if we want an MTTF(System) = 1.2M. For part 2, you need to define MTTR. I dont know what it is.
Maximizing profit
null
Problem: Given 11 numbers {N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11} where - N1:amount of profit from product A N2:amount of profit from Product B N3:amount of time in **hours** required to make A in factory1(F1) N4:amount of time in **hours** required to make B in factory1(F1) ...
I am currently reading "Artificial Intelligence - A modern approach" and I really do not get the difference between intended interpretation and extended interpretation in first-order logic. Are extended interpretations all possible assignments from a symbol in my knowledge base to an object in the world? And is the ...
Difference between intended interpretation and extended interpretation in first-order logic
|logic|artificial-intelligence|first-order-logic|
We first need to clarify what we mean by "does this hold if we have an infinite chain?". We interpret it as an infinite sequence of functions $\{f_i:\mathbb{N}\to\mathbb{N} \mid 1\leq i\}$ such that for all $i$ we have $f_i(n) = O(f_{i+1}(n))$. Such a sequence might not have a last function. We can look at the limi...
Problem: Given 11 numbers {N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11} where - N1:amount of profit from product A N2:amount of profit from Product B N3:amount of time in **hours** required to make A in factory1(F1) N4:amount of time in **hours** required to make B in factory1(F1) ...
We first need to clarify what we mean by "does this hold if we have an infinite chain?". We interpret it as an infinite sequence of functions $\{f_i:\mathbb{N}\to\mathbb{N} \mid 1\leq i\}$ such that for all $i$ we have $f_i(n) = O(f_{i+1}(n))$. Such a sequence might not have a last function. We can look at the limi...
If overlapping is allowed, it can be done in linear time (in the size of the input string). Some definitions ---------- Let's define the concept of *maximal palindrome*: A **maximal palindrome of radius k** of a string S is a substring S' such that - starting from the centre, S' reads the same k character...
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
Given some Language $L = \{w_1\#w_2|w_i \in (\Sigma\setminus\{\#\})^*,\dots\}$ and a function $f$ such that $\min\{|w_1|,|w_2|\} \leq f(|w|)$ for every $w=w_1\#w_2 \in L$ you can estimate the running time of an $\mathcal O(|w_1|\cdot|w_2|)$ algorithm which recognizes $L$ as $\mathcal O(f(|w|)\cdot(|w|-f(|w|))= \mathc...
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
{"Voters":[{"Id":6737,"DisplayName":"Cybernex"}]}
{"Voters":[{"Id":6737,"DisplayName":"Cybernex"}]}
After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $O(N)$ time. I found on the internet the following algorithm: 1. merge the two strings $A$ and $B$ into...
Computing the longest common substring of two strings using suffix arrays
|algorithms|complexity|suffix-array|
After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $O(N)$ time. I found on the internet the following algorithm: 1. merge the two strings $A$ and $B$ into...
I'm in a course about computing and complexity, and am unable to understand what these terms mean. My professor is really nice, but it's like pulling teeth trying to get her to understand that she needs to slow down and properly define some things. As a result, all I know is that np is a subset of np complete which is ...
In basic terms, what is the definition of P, NP, NP-Complete, and NP-Hard?
|complexity|
|algorithms|suffix-array|
|complexity-theory|
Simplest of them is P, problems solvable in polynomial time belongs here. Then comes NP. Problems solvable in polynomial time on a non-deterministic Turing machine belongs here. The hardness and completeness has to with reductions. A problem A is _hard_ for a class C if every problem in C reduces to A. If prob...
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
For part 1, its simple. You need to find the $x$ (as defined below) for which MTTF(system) = 1.20M. So $1.20 * 10^6 = \frac{1}{[(\frac{1}{6}*10^6)*x]} \implies x = 5$. We can have 5 disks (50 TB) if we want an MTTF(System) = 1.2M. Part 2 is homework for you.
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
This is a basic constrained optimization problem. This will require linear programming because you have inequality constraints. Alternatively since this is entirely linear and each factory is **independent** of each other, work out which option A/B offers the highest return per factory. Call this the chosen product....
More than useful mentioned answers, I recommend you **highly** to watch "[**Beyond Computation: The P vs NP Problem**][1]" by **[Michael Sipser][2]**. I think this video should be archived as one of the leading teaching video in computer science.! Enjoy! [1]: https://www.youtube.com/watch?v=msp2y_Y5MLE [2...
{"OriginalQuestionIds":[9526],"Voters":[{"Id":683,"DisplayName":"Yuval Filmus"},{"Id":6447,"DisplayName":"vonbrand"},{"Id":4304,"DisplayName":"Merbs"},{"Id":98,"DisplayName":"Raphael"}]}
[{"Id":98,"DisplayName":"Raphael"}]
[{"Id":98,"DisplayName":"Raphael"}]
[{"Id":98,"DisplayName":"Raphael"}]
{"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
I have the following homework problem: >A 10 TB disk drive has an MTTF of 6,000,000 hours. How much data can we store in a system comprised of these disks, if we want the system MTTF to be at least 1.2M hours? >If we are allowed to make it redundant (i.e., two of them operating in a parallel mode), and if the MT...
What is the system's mean time to failure?
|computer-architecture|reliability|
|complexity-theory|terminology|
null
Suppose Palindrome[][] is an array and Palindrome(i,j) is a function which checks, whether substring from i to j is palindrome and returns 1 if is palindrome or returns infinity if is not palindrome, and you looking for smallest k, create it button up: $$Palindrome[i][i] = 1.$$ $$\forall 0\le i < j < n : Palindrom...
Suppose Palindrome[][] is an array and Palindrome(i,j) is a function which checks, whether substring from i to j is palindrome and returns 1 if is palindrome or returns infinity if is not palindrome, and you looking for smallest number of partitions, create it button up: $$Palindrome[i][i] = 1.$$ $$\forall 0\le i ...
The are some open source JAVA libraies with complete documentation for math/CAS like: [Jasymca][1], [Java Algebra System][2] and many more. I think a good way is start with them and try to contribute more! [1]: http://webuser.hs-furtwangen.de/~dersch/jasymca2/indexEN.html [2]: http://krum.rz.uni-mann...
In mathematics, functions like this are called [multilinear](http://en.wikipedia.org/wiki/Multilinear_form) functions. But computer scientists probably won't generally know this terminology. This function should definitely **not** be called linear, either in mathematics or computer science, unless you can reasonably co...
null
I think the Wikipedia articles [$\mathsf{P}$][1], [$\mathsf{NP}$][2], and [$\mathsf{P}$ vs. $\mathsf{NP}$][3] are quite good. Still here is what I would say: ---- ###Decision Problems There are various kinds of computational problems. However in a first complexity course it is easier to focus on *decision problem*...
null
The naming in the pseudo-code seems to be making things more confusing than they need to be, and it also seems to be glossing over some detail, but here's what I think is going on. Let's just jump right in on a small example. Suppose we have a data set, the integers 0-7 in binary: $000, 001, 010, 011, 100, 101, 1...
The Master theorem is a beautiful tool for [solving certain kinds of recurrences](http://cs.stackexchange.com/a/2823/98). However, we often gloss over an integral part when applying it. For example, during the analysis of Mergesort we happily go from $\qquad T(n) = T\left(\left\lfloor \frac{n}{2} \right\rfloor\right...
Rigorous proof for validity of assumption $n=b^k$ when using the Master theorem