instruction
stringlengths
0
29.8k
⌀
I am just beginning to learn computation theory. I wrote up a non-deterministic finite automata that accepts strings that contain the substring "abba": ![My NFA][1] I tried to convert it to a DFA by putting together sets of states in the NFA to be states of the DFA:![My DFA][2] However, I just realized that my...
Why isn't converting from an NFA to a DFA working?
|formal-languages|
|automata|finite-automata|
|asymptotics|mathematical-analysis|landau-notation|
|computability|kolmogorov-complexity|
|reference-request|artificial-intelligence|reasoning|
A function over finite strings is called computable if it can be computed by a program (more formally, a Turing machine). A set of finite strings is computable if it membership problem in that set (given $x$, is $x \in L$?) can be decided algorithmicaly (more formally using a Turing machine). They are used for di...
Complexity is usually defined using Turing machine model to avoid the issue of the amount of resources taken during a complicated operation like adding integers. You can use different notation of complexity of a RAM machine and that depends on what you are trying to do. If you want to be able to compare it with stan...
There are plenty of papers on fuzzy logic, and applications of it. Fuzzy logic models a piece-wise control function, and is regarded as a non-linear controller. Generally, fuzzy logic can approximate any non-linear function if you divided the state-space into enough fuzzy sets. Because it is non-linear, it is gen...
null
null
I learned about algorithms in a university course years ago. But if you are to do algorithms using a book, then you need a good one. Two books stand out for me as the way to get into algorithms: * The Algorithm Design Manual **by** Steven S. Skiena * Introduction to Algorithms **by** T Cormen, C Leiserson, R Rivest...
null
null
Your conjecture is wrong. For some constants $C,D$, it holds that $K(sr) \leq 2K(s) + K(r) + C \leq 2K(s) + |r| + D$ (proof: use a universal Turing machine to generate $s$ and then $r$; you need somewhat more than $K(s)+K(r)$ to store both programs, though $2K(s)+K(r)$ is an overkill). Therefore if $2K(s) + D < |s|$, y...
I'd like to understand what approaches should one adopt when deciding/proving that a given function *F* is uncomputable, by any Turing Machine (TM). The ones I've tried so far are as follows: - Reduction, from a known uncomputable function (such as $UC(\alpha)$, the uncomputable function as proved by Cantor's diago...
What approaches are most useful when proving uncomputability of a given function?
|complexity-theory|computability|turing-machines|undecidability|
I'd like to understand what approaches should one adopt when deciding/proving that a given function *F* is uncomputable, by any Turing Machine (TM). The ones I've tried so far are as follows: - Reduction, from a known uncomputable function (such as $UC(\alpha)$, the uncomputable function as proved by Cantor's diago...
I am reading section 6.4 on Heapsort algorithm in CLRS, page 160. HEAPSORT(A) 1 BUILD-MAX-HEAP(A) 2 for i to A.length downto 2 3 exchange A[i] with A[i] 4 A.heap-size = A.heap-size-1 5 MAX-HEAPIFY(A,1) Why is the running time, according to the book is $\Theta (n\lg{n})$ ...
Heapsort running time
|algorithm-analysis|landau-notation|sorting|
I'd like to understand what approaches should one adopt when deciding/proving that a given function *F* is uncomputable, by any Turing Machine (TM). The ones I've tried so far are as follows: - Reduction, from a known uncomputable function (such as $UC(\alpha)$, the uncomputable function as proved by Cantor's diago...
|computability|turing-machines|proof-techniques|undecidability|
|algorithms|algorithm-analysis|landau-notation|sorting|
Complexity is usually defined using Turing machine model to avoid the issue of the amount of resources taken during a complicated operation like adding integers. You can use different notation of complexity of a RAM machine and that depends on what you are trying to do. If you want to be able to compare it with stan...
You construct the heap in linear time. Then, you execute the loop and perform a logarithmic time operation $n-1$ times. Hence, your running time is $n + (n-1) \log n + O(1) = \Theta(n \log n)$. In other words, as $n$ grows the $n \log n$ term dominates.
You construct the heap in linear time. Then, you execute the loop and perform a logarithmic time operation $n-1$ times. Other operations take constant time. Hence, your running time is $$n + (n-1) \log n + O(1)$$ $$= n + n \log(n) - \log(n) + O(1)$$ $$= \Theta(n \log n).$$ In other words, as $n$ grows the $n \log...
Let us count operations line by line. You construct the heap in linear time. Then, you execute the loop and perform a logarithmic time operation $n-1$ times. Other operations take constant time. Hence, your running time is $\qquad \begin{align} & n + (n-1) \log n + O(1) \\ &= n + n \log n - \log n + O(1) \\ &= \...
I am reading section 6.4 on Heapsort algorithm in CLRS, page 160. HEAPSORT(A) 1 BUILD-MAX-HEAP(A) 2 for i to A.length downto 2 3 exchange A[i] with A[i] 4 A.heap-size = A.heap-size-1 5 MAX-HEAPIFY(A,1) Why is the running time, according to the book is $\Theta (n\lg{n})$ ...
Why does heapsort run in $\Theta(n \log n)$ instead of $\Theta(n^2 \log n)$ time?
Your methodology for creating the DFA from the NFA is fine. The problem is that you started with the wrong NFA (you'll notice that your NFA doesn't accept abbaa either). Try this one instead: ![enter image description here][1] [1]: https://i.stack.imgur.com/Px3Rh.jpg
There are unfortunately as many techniques to prove functions uncomputable as there are to prove things in general, so there's no comprehensive doctrine for how you should approach this. Note that the proof by reduction is just a special case of a proof by contradiction; assuming that the function *is* computable le...
I have the problem to find for the recursion tree method a guess for the next recurrence: $$T(n)=3T\left (\left\lfloor \frac{n}{2}\right \rfloor\right) +n$$ I write some costs for the levels of tree, you can see, but I'm confusing in the final guess. I know for the master theorem that the answer for the guess is like...
Doubt with a problem of grown functions and recursion tree
|complexity-theory|
|algorithms|runtime-analysis|
I'm confused to conclude the recursion tree method a guess for the next recurrence: $$T(n)=3T\left (\left\lfloor \frac{n}{2}\right \rfloor\right) +n$$ I write some costs for the levels of tree, you can see, but I'm confusing in the final guess. I know for the master theorem that the answer for the guess is like that ...
I wonder whether the massively parallel computation units provided in graphic cards nowadays (one that is programmable in [OpenCl][1], for example) are good enough to simulate 1D cellular automata (or maybe 2d cellular automata?) efficiently? If we choose whatever finite grid would fit inside the memory of the chip,...
Are today's massive parallel processing units sufficiently powerful to run cellular automata?
null
I write this code in python: def sub(ma): n = len(ma); m = len(ma[0]) if n != m : return n2 = int(ceil(n/2)) a = []; b = []; c = []; d = [] for i in range(n2): a.append(ma[i][0:n2]) b.append(ma[i][n2:n]) c.append(ma[n2+i][0:n2]) d.append(ma[n2+i][n2:n]) return [a,b,c,d] def sum(...
Do you think a recurrence to the this code by algorithm?
|algorithm-analysis|runtime-analysis|
Okay, this is my approach to this problem. I think the key concept here is the **clustering coefficient** $c$. The value of $c$ is denotes how likely it is that two nodes are connected by an edge, if the have a common neighbor. In SN-friendship graphs the clustering coefficient is usually high compared to classical ran...
The subroutine *sub* quarters the matrix into four parts. This takes time $f(n)$, and so the running-time of *sum* (which sums all entries in its input square matrix in a curious divide-and-conquer fashion) satisfies the recurrence $$ T(n) = \begin{cases} O(1) & n=1 \\ 2T(\lfloor n/2 \rfloor) + 2T(\lceil n/2 \rceil) +...
Instead of having logarithms in the working, I'll substitute $n=2^m$: $$ T(n) = n\sum_{i=0}^{m} \left(\frac{3}{2}\right)^i = n \frac{\left(\frac{3}{2}\right)^{m+1}-1}{\frac{3}{2}-1} = 2n \left(\left(\frac{3}{2}\right)^{m+1}-1\right) = 2n \left(\frac{3}{2}\right)^{m+1}-2n $$ I believe the previous step is where...
null
Whatever you do, computing the next state for a cellular automaton ask for as many computation than there are cells in the automaton. Thus to get a constant time, you need as many computing core as there are cells. The number of these in GPU are currently at most a few thousands, while the computation of the next st...
If you haven't learned about algorithms at university I recommend taking one of the online classes, you may consider signing up for one of the courses at coursera.org or following videos posted by Stanford University.
let's see if I can explain this... So if the inner loop was j<n, then this would be O(n^2) right? Now, for the first iteration you do n-(n-1) times through the inner loop. on the second time you do n-(n-2) times through the inner loop. On the Nth time you do n-(n-n) times through, which is n times. if you av...
I was given a homework assignment with Big O. I'm stuck with nested for loops that are dependent on the previous loop. Here is a changed up version of my homework question, since I really do want to understand it: sum = 0; for (i = 0; i < n; i++ for (j = 0; j < i; j++) sum++; The ...
Big O: Nested For Loop With Dependence
|untagged|
Stephen Cook's proof of the NP-completeness of SAT is constructive. Given a Turing machine $M$, one can create a logical formula that is satisfiable if and only if $M$'s computation halts in an accepting state. This suggests that we could take a logical formula and create a Turing machine $M'$ whose computation is desc...
Creating artificial NP-Complete problems
|algorithms|np-complete|
I want to filter efficiently a list of integers for duplicates in a way that only the resulting set needs to be stored. One way this can be seen: - we have a range of integers $S = \{1, \dots{}, N\}$ with $N$ big (say $2^{56}$) - we have a function $f : S \to S$ with, supposedly, many collisions (the images ...
I wonder whether the massively parallel computation units provided in graphic cards nowadays (one that is programmable in [OpenCL][1], for example) are good enough to simulate 1D cellular automata (or maybe 2D cellular automata?) efficiently. If we choose whatever finite grid would fit inside the memory of the chip,...
Are today's massive parallel processing units able to run cellular automata efficiently?
null
So we have the following table of processes , where A, B and Γ are the resources. Here is a pic that i drew with the processes and the resources. https://i.stack.imgur.com/Rvyvo.jpg So the exact question is this: Using banker's algorithm, calculate the minimum values of x and y in order the system is Deadlock ...
Banker's Algorithm and deadlocks
|reference-request|
So we have the following table of processes , where A, B and $\Gamma$ are the resources. Here is a pic that i drew with the processes and the resources. ![Table][1] So the exact question is this: Using banker's algorithm, calculate the minimum values of $x$ and $y$ in order the system is Deadlock free. I ha...
|algorithms|reference-request|
|runtime-analysis|landau-notation|
So let me clarify a few things, you are interested in the big-O notation - this means **upper bound**. In other words, it is okay to count more steps than you actually do. In particular, you can modify the algorithm to ... for (j = 0; j < n; j++) ... So you have two nested loops, each loop ru...
before you feel you have a "new" SAT algorithm, please review the standard/classic backtracking/search algorithm in the literature for the problem dating to ~1962, the [Davis–Putnam–Logemann–Loveland algorithm](http://en.wikipedia.org/wiki/DPLL_algorithm). most backtracking/recursive algorithms for the problem will li...
before you feel you have a "new" SAT algorithm, please review the standard/classic backtracking/search algorithm in the literature for the problem dating to ~1962, the [Davis–Putnam–Logemann–Loveland algorithm](http://en.wikipedia.org/wiki/DPLL_algorithm). most backtracking/recursive algorithms for the problem will li...
(I did some extensive searching and found material that answers my question. I liked Patrick87's answer, but I found this to be more complete.) The answer to the question lies in a careful examination of the philosophy of Computer Science. In Computer Science, three intellectual traditions meet (or collide, if you w...
|algorithms|algorithm-analysis|runtime-analysis|recurrence-relation|
|algorithms|asymptotics|runtime-analysis|recurrence-relation|
(I did some extensive searching and found material that answers my question. I liked Patrick87's answer, but I found this to be more complete.) The answer to the question lies in a careful examination of the philosophy of Computer Science. In Computer Science, three intellectual traditions meet (or collide, if you w...
|algorithms|reference-request|concurrency|
|algorithms|algorithm-analysis|runtime-analysis|landau-notation|
So let me clarify a few things, you are interested in the big-O notation - this means **upper bound**. In other words, it is okay to count more steps than you actually do. In particular, you can modify the algorithm to ... for (j = 0; j < n; j++) ... So you have two nested loops, each loop ru...
null
heres a new ars technica article entitled [Is it true that "not everyone can be a programmer"?](http://arstechnica.com/information-technology/2012/09/is-it-true-that-not-everyone-can-be-a-programmer/) on teaching programming incl academic papers analyzing efficacy of teaching methods/approaches and capability of studen...
Here is a new ars technica article entitled [Is it true that "not everyone can be a programmer"?](http://arstechnica.com/information-technology/2012/09/is-it-true-that-not-everyone-can-be-a-programmer/) on teaching programming including academic papers analyzing the efficacy of teaching methods/approaches and capabilit...
null
Here's the general approach I used, which I'm hoping would be useful for similar types of problems on deciding uncomputability of functions using TMs. There are 2 types of such functions (as far as I've faced!): 1. Functions which decide properties of the *Turing Machine supplied as input*, e.g. Problem 1 in my que...
null
Instead of having logarithms in the working, I'll substitute $n=2^m$: $$ T(n) = n\sum_{i=0}^{m} \left(\frac{3}{2}\right)^i = n \frac{\left(\frac{3}{2}\right)^{m+1}-1}{\frac{3}{2}-1} = 2n \left(\left(\frac{3}{2}\right)^{m+1}-1\right) = 2n \left(\frac{3}{2}\right)^{m+1}-2n $$ I believe the previous step is where...
A couple of the ones you're looking at here are pretty simple actually (at least to sketch!). For all of these, there are many other ways to do it, even many other sensible ways, so these are just attempts to pick the simpler approaches (we'll see if I succeed). As mentioned in one of the comments on the question, $...
The source of this question comes from an undergraduate course I am taking, which covers an introduction to the analysis of algorithms. This is not for homework, but rather a question asked in CLRS. You have a slow machine running at *x* MIPS, and a fast machine running at *y* MIPS. You also have two algorithms of t...
Given a fast and a slow computer, at what sizes does the fast computer running a slow algorithm beat the slow computer running a fast algorithm?
|algorithm-analysis|runtime-analysis|
The source of this question comes from an undergraduate course I am taking, which covers an introduction to the analysis of algorithms. This is not for homework, but rather a question asked in CLRS. You have a slow machine running at $x$ MIPS, and a fast machine running at $y$ MIPS. You also have two algorithms of t...
null
null
Your question is quite open-ended, in that you have not specified how accurate the **upper bound** should be, nor how **efficient** the algorithm should be. There is certainly a trade-off between the run-time and the accuracy. --------------------- Ways to get an exact answer: - Naive brute force - I guess you k...
The source of this question comes from an undergraduate course I am taking, which covers an introduction to the analysis of algorithms. This is not for homework, but rather a question asked in CLRS. You have a slow machine running at $x$ MIPS, and a fast machine running at $y$ MIPS. You also have two algorithms of t...
.Given a fast and a slow computer, at what sizes does the fast computer running a slow algorithm beat the slow computer running a fast algorithm?
null
Given a fast and a slow computer, at what sizes does the fast computer running a slow algorithm beat the slow computer running a fast algorithm?
null