instruction
stringlengths
35
29.1k
Assume that I have a file that consists of pairs of numbers separated by a space. These numbers are the labels for vertices in my graph. For example: 0 5 0 7 2 3 4 5 1 5 . . . I want to create a graph (adjacency list) by reading this file line-by-line. For each line, I will create an edge between the two vertices. Of ...
I can define any boolean function (I think) using and and not, or using or and not (plus a constant 0 or 1). And I can define or in terms of xor. And then there are nor and nand. So I am wondering: Why are we traditionally taught boolean logic using and, or and not? Is there a "simplest" set of boolean functions th...
I have an array of size $N$ $(N \leq 10^5)$. I need to perform two types of operations on the array. Decrease elements in range $[L,R]$ by $X$. Count the number of negative elements in range $[L,R]$. There are $10^5$ queries. All I can think about is using a segment tree with lazy propagation, but I believe there wou...
This is very much clear to me that an FSM has limited memory (sufficient to store present state). How do I prove that (intutively or otherwise) that a CFL has more memory than a DFA or NFA (thus making a CFL more powerful than FA) ?
library(ggplot2) compress <- function(str) { length(memCompress(paste(rep("a", str), collapse=""), type="bzip2")) / nchar(paste(rep("a", str), collapse="")) } cr <- data.frame(i = 1:10000, r = sapply(1:10000, compress)) ggplot(cr[cr$i>=5000 & cr$i<=10000,], aes(x=i, y=r)) + geom_line() The compression ratio st...
Let $\Sigma = {1,2,3,4}$ . We say that symbol $\sigma $ bonds with symbol $\tau$ if $\sigma = \tau$ of $\sigma = \tau +1$ for even $\sigma$ and $\sigma = \tau -1$ for odd $\sigma$ . In other words , 1 and 2 bond , and 3 and 4 bond (in addition to every number bonding with itself ) . The Pattern bonding ...
Many sites give the Sobel operators as the convolution mask for smoothing an image. However, I haven't found a single site that describes how you can derive the operators from partial first derivatives. If anyone can explain the derivation, I would highly appreciate it.
Wikipedia says that shared memory comes with lots of costs associated with cache coherence costs. But I thought the whole idea of shared memory is that all the CPUs access the same memory? So if one CPU changes that memory then other CPUs would access the same value? It would seem like this would require FEWER cache co...
While reading A.S. Tanenbaum's book "Structured Computer Organization", I had come to this paragraph. The text is about how interpretation of a program works. The other technique is to write a program in L0 that takes programs in L1 as input data and carries them out by examining each instruction in turn and executin...
I was doing dynamic programming exercises and found the Floyd-Warshall algorithm. Apparently it finds all-pairs shortest paths for a graph which can have negative weight edges, but no negative cycles. So, I wonder what's the real world significance of negative weight edges? A plain English explanation would be helpful....
I was given the following code and was told to find the best and worst case running times in big theta notation. (Below is in python) def find(a, target): x = 0 y = len(a) while x < y: m = (x+y)/2 if a[m] < target: x = m+1 elif a[m] > target: y = m el...
Quantified Boolean formulae are the prime examples of problems that are hard for the polynomial hierarchy, i.e., for the $\Pi$ and $\Sigma$ versions of it. However, there is also the $\Delta$ version, defined as $\Delta_{i+1}^{\rm P} := {\rm P}^{\Sigma_i^{\rm P}}$. In particular, $\Delta_2^{\rm P} = {\rm P}^{\rm NP}$. ...
Suppose I have a connected graph with $n$ vertices and $n−1$ edges, that is in form of a tree. Now, I will add the number of vertices in the tree and uniformly randomly select a vertex. I break the graph at this selected vertex, deleting the vertex and the edges connected to it. Now, I again repeat the same thing at al...
Can anyone explain heavy light decomposition of trees or give a resource to read it from? I have already gone through http://ipsc.ksp.sk/2009/real/solutions/l.html which is the best i could find but still could not understand its working completely.
In Haskell, are datatypes converted to the "Church encoding" i.e. folding the data type. For example, given data N = Z | S N in Haskell, it can be converted to its church encoding by foldN Z z s = z foldN (S n) z s = s (foldN z s n) Where if we do foldN m, we get the church encoding: \z s . s ( .... s n ... ) In...
I have this algorithm where: $$ T(n) = \begin{cases} 1 & \text{if}\; n \le 1 \\ T(n/2) + 1 & \text{otherwise} \\ \end{cases} $$ So, evaluating for $T(0), T(1), T(2), T(3), \ldots, T(n)$, I'm getting values like: $$ 1, 1, 2, 2, 3, 3, \ldots, n, n $$ I assume this is twice the sum of $1$ to $n$, that would be the sam...
I am given a system with a segmented paging architecture. Both physical and virtual address spaces contain $2^{16}$ bytes each. The virtual address space is divided in $8$ equal size segments. The page table consist of $2$ byte page table entries. Question 1: What is the minimum page size in bytes so that page tabl...
Suppose you are given an input set $S$ of $n$ numbers, and a black box that if given any sequence of real numbers and an integer $k$ instantly and correctly answers whether there is a subset of input sequence whose sum is exactly $k$. I want to show how to use the black box $O(n)$ times to find a subset of S that adds ...
I've come across this problem in my studies, and I've abstracted it to the more general case here. Given a finite alphabet, what is a regular expression that matches all strings over the alphabet, except one particular finite substring? As an example: Given $\Sigma = \{a, b, c\}$ What is a regular expression that match...
One of my courses introduced the following question: Given the recurrence relation for mergesort: $T(n) = 2T(n/2) + n$ How would the following parameter passing strategies influence the relation and running time of the algorithm: A pointer to the array is passed to the sorting function, The entire array is copied to...
Can someone help me understand the steps in this argument? There is a decision problem that is in $\mathsf{co\text{-}NP}$ (under standard Karp reductions) and is $\mathsf{NP}$-hard with respect to Cook reductions. Does this imply that if it is in $\mathsf{NP}$ then $\mathsf{NP} = \mathsf{co\text{-}NP}$ and if so, why?
Does this property have a name? Given a collection of sets $\mathcal{P}$, for all pairs $A, B\in\mathcal{P}$, either $A\cap B=\emptyset$ or $A\subseteq B$ or $B\subseteq A$. This concept could equally apply to monoids, groups, partial orders or other mathematical structures, with some adjustments to the definitions...
Consider a regular language $L$. Let $D(L)$ be a minimal DFA for $L$ and $N(L)$ be a minimal NFA for $L$ (minimal in the sense of the smallest possible number of states for an automaton that recognizes the given language). Write $|A|$ for the size (number of states) of the automaton $A$. In general, $|N(L)|$ can be a l...
A DRAM that must be given a refresh cycle 64 times per ms.Each refresh requires 150ns,a memory cycle requires 250 ns. What is the approximate percentage of the memory's total operating time must be given to refreshes? Can someone explain how to find the solution?
I am a starting Ph.D. student in computer science, and I am trying to understand some classic game-theory papers, such as those by Nash, Kalai and Smorodinsky. But I find it hard to understand the mathematical parts. It seems that these papers were written by mathematicians, for mathematicians. Can you recommend a bo...
I'm having trouble finding materials on what 'finger search' is, in the context of a red black tree. Even Wikipedia has a very short page about that, could you refer me or explain what kind of search is that.
I want to know that whether which of the following algorithm can be parallelized? Bubble Sort, Insertion Sort, Selection Sort, Shell Sort, Quick Sort, Merge Sort, Radix Sort. Those which can't be, please explain me briefly that how? Or please try to tell me in simple words that what is parallelism in sorting algorithms...
I am playing around with MapReduce and wanted to ask why the map function takes two inputs (key, value)? Why not just pass along the value? Specifically, if you look at the word count example on Wikipedia page you will see that the map function is: function map(String name, String document): // name: document name // ...
In the last section of chapter 3 (page 54) in Probability and Computing: Randomized Algorithms and Probabilistic Analysis by Mitzenmacher and Upfal, a randomized algorithm is discussed for finding the median of a set $S$ of distinct elements in $O(n)$ time. As a substep the algorithm requires sorting a multiset $R$ of ...
I need help with finding out the time complexity of the following algorithm: procedure VeryOdd(integer n): for i from 1 to n do if i is odd then for j from i to n do x = x + 1 for j from 1 to i do y = y + 1 This is my attempt: $$ Loop1 = \Theta(n)$$ $$ Loop2 = \Theta(n)$$ $$ Loop2 = O(n)$$ And we...
I am new to Advanced Algorithms and I have studied various samples on Google and StackExchange. What I understand is: We use $O(\log n)$ complexity when there is division of any $n$ number on each recursion (especially in divide and conquer). I know that for binary search, we have time complexity $O(n \log n)$, I und...
Here is a question that I encountered in one of my exams: Find one context-free grammar that recognizes the language: $\qquad L = \{a^n(b^mc^m)^pd^n \mid m, n, p \geq 0\} $ Can you find such a grammar? I even doubt its existence, but I have not been able to prove that.
I am new to C++ and just learned that "The declaration of a static data member in the member list of a class is not a definition. You must define the static member outside of the class declaration, in namespace scope." I am curious about why this is. Are there particular design advantages to making the rules of the la...
I am working on string searching algorithms that support multiple pattern search. I found two algorithms that seem like the strongest candidates in terms of running time, namely Aho-Corasick and Rabin-Karp. However, I could not find any comprehensive comparison between the two algorithms. Which algorithm is more effi...
Note: I moved this question from stackoverflow.com I have an algorithmic problem where I would like to see if it can be solved in better than $O(n)$: I have given a table $T$ of $n$ elements where each element is a tuple $(s_i, e_i)$ with $s_i, e_i \in \mathbb{N}$ and $s_i < e_i$, i.e. each tuple is some kind of an int...
I have been studying about activity-selection-problem and the solution of greedy choice I came across is to select the activity that finishes in the earliest among the present activities. But surely there are other greedy choices to solve the problem. The one I have been able to figure out is to select the activity tha...
Let $\Sigma = \{0,1\}$. For every word $w \in \Sigma^*$, let $|w|_0$ and $|w|_1$ denote the count of 0's and 1's, respectively, in $w$. Let $L$ be the language $$L = \{ w \in \Sigma^* \mid |w|_0 \gt |w|_1 + 2 \text{ or } |w|_1 \gt |w|_0 + 2\}$$ Prove or disprove whether $L$ is regular.
So I'm reading Introductions to Algorithms and sometimes I wish it would be a little bit more friendly with how it explains topics. One of these topics is proving big-theta. I understand that the definition of $\Theta$ is as follows: $\Theta(g(n)) = f(n)$ if there exists positive constants $c_1$, $c_2$, and $n_0$ su...
Given languages X, Y and Z, each with alphabet, define X/Y/Z as: X/Y/Z = { w ∈ Σ* | ∃u ∈ Y and ∃v ∈ Z; such that wuv ∈ X }. Prove that if X is context-free, and Y and Z are regular, then X/Y/Z is context-free.
I am trying to solve the Problem CTRICK on SPOJ. I have an $O(n^2)$ solution that is giving “Time Limit Exceeded”. After browsing for some hints, I found that it can be solved using Interval Trees. But I have no idea, how to think it that way. Here is the problem: The magician shuffles a small pack of cards, holds it f...
Given languages A,B and C, each with alphabet Σ, define A/B/C as A/B/C = { w∈Σ* | ∃u ∈ B and ∃v ∈ C; such that wuv ∈ A }. Prove that if A is context-free, and B and C are regular, then A/B/C is context-free.
For example if $$ f(x)= \Theta (g(x)) $$ from the definition of the theta notation, there exist c1 and c2 constants such that $$c_1 g(x) \le f(x) \le c_2 g(x)$$ then if only we took the constants $1/c_1$ and $1/c_2$ we could say from the definition that $$ g(x)= \Theta (f(x)) $$ Right?
Suppose an algorithm has a runtime recurrence relation: $ T(n) = \left\{ \begin{array}{lr} g(n)+T(n-1) + T(\lfloor\delta n\rfloor ) & : n \ge n_0\\ f(n) & : n < n_0 \end{array} \right. $ for some constant $0 < \delta < 1$. Assume that $g$ is polynomial in $n$, perhaps quadratic. Most like...
This is not homework. I have the solution but it's not what I'm getting. I know there are multiple solutions to the problem but I want to make sure that I'm not missing anything. The question is as follows: Prove that 2$n^2$ - 4n + 7 = Θ ($n^2$). give the values of the constants and show your work. Here is how I ...
I already have a solution for this problem but it's just not making sense to me. Here is the problem (It's from Introduction to Algorithms by CLRS found in CH.4): Show $T(n) = 2T(\lfloor n/2 \rfloor +17)+n$ is $O(n \log n)$ This is what I have so far: So Assume $T(k) \leq cn\lg n$, for $k<n$. $\qquad \begin{align...
Question from Artificial Intelligenge: A Modern Approach by Russell and Norvig (Exercise 2.1). Suppose that the performance measure is concerned with just the first $T$ time steps of the environment and ignores everything thereafter. Show that a rational agent's action may depend not just on the state of the env...
I am trying to modify the Floyd-Warshall algorithm to find all-pairs minimax paths in a graph. (That is, the shortest length paths such that the maximum edge weight along a path is minimized.) Floyd-Warshall algorithm contains the following loop to enhance the distance (ds) and the next vertex (ns) matrices at each ite...
I'm looking for an algorithm that provides a canonical string for a given colored graph. Ie. an algorithm that returns a string for a graph, such that two graphs get the same string if and only if they are isomorphic. In particular, I'm looking for a simple algorithm that is easy to implement with a reasonable perform...
Given a program consisting of variables and instructions which modify these variables, and a synchronization primitive (a monitor, mutex, java's synchronized or C#'s lock), is it possible to prove that such a program is thread safe? Is there even a formal model for describing things like thread safety or racing condit...
I am looking for some graph theory concepts and definitions around embedding a DAG into another DAG. I could only find a few lines on Wikipedia around this so I wonder if someone can help me find good references for the important concepts and definitions. For example, assume I have a DAG $G=(E,V)$ where there are two ...
It seems that factoring a number known to be composite is in its own interesting little complexity class, e.g. polynomial time using quantum computing even though no one has proved $\mathsf{P} = \mathsf{NP}$ for quantum computing. Are there interesting, non-obvious examples of problems with polynomial-time verifiabili...
I am writing a compiler for my programming language (both almost complete), but they are stuck in the, I would call, "String vs List-of-Char dilemma". Maybe some more experienced compiler programmer could help. It is a functional, strongly typed (with inference) and almost pure (immutable vars) language. As I could per...
We started learning recurrences and I am having trouble with some of the problems. Our professor is having us substitute in $n=2^m$ and $S(m)=T(2^m)$ then writing down equations and summing them all up. I understand the substitution part, but not how to simplify the end result. One of the problems I am stuck on is $T(n...
I read about post-selection and didn't understand the meaning behind this thing. I didn't understand the Wikipedia article well, so what is a simple but understandable explanation of post-selection and how to use it in complexity?
I'm currently taking a numerical analysis class in college and we're covering floating point systems. For the most part, I have a good grasp on it. However, something I can't seem to visualize, and haven't seen any totally lucid explanations about after searching extensively, is spacing between floating point numbers. ...
I've seen two different lambda expressions for the logical NOT function. One of them just applies its parameter to constants true and false internally in a reverse order: $NOT \;\;=\;\; \lambda x.\; x \; \mbox{false}\; \mbox{true} \;\;=\;\; \lambda x. \; x \; (\lambda t.\lambda f.f) \; (\lambda t. \lambda f. t ) $ and ...
I have a $n\times n$ matrix called $M$, and two integers $k_\min$ and $k_\max$. Each row and each column of M is sorted in the increasing order. I would like to know if there is way I can count the number of its elements which are inside $[k_\min, k_\max]$, using a $O(n)$ algorithm.
Given $x\in\Bbb N$, I would like to find $x\bmod N$, where $N$ is composite. For example $N=35$, $x=53$ and $x\bmod N=18$. Is this operation considered monotone in circuit/algebraic complexity language? I also want to have consider $x_1+x_2\bmod N = x_1\bmod N+x_2\bmod N$ and $x_1x_2\bmod N = (x_1\bmod N)(x_2\bmod N)$....
I have a finite automaton with these properties: Contains cycles It's a directed graph All the states/nodes are initialy reachable from the initial state It has final states but I guess it isn't relevant for my issue It's a random generated automaton, and the generation isn't meant to satisfy properties like strongly ...
Let $G = (V, E)$ be a connected graph and let $M\subseteq V$. We say that a vertex $v$ is marked if $v\in M$. The problem is to find a simple path in $G$ that visits the maximum possible number of marked vertices. The associated decision problem is: is there a simple path that visits every $v\in M$? The problem is o...
If we have $n$ elements $s_1, \dots, s_n$ and build a kind of treap (tree-heap) out of it. Each $s_k$ has a priority, which is an integer in $\{ 1, 2, 3 \dots, \lceil \log n \rceil\}$. Since the priorities will have duplicates, I just want the treap the verify that for each node $s_k$, all the nodes in its right and le...
Some complicated algorithms (union-find) have the nearly-constant inverse Ackermann function that appears in the asymptotic time complexity, and are worst-case time optimal if the nearly constant inverse Ackermann term is ignored. Are there any examples of known algorithms with running times that involve functions tha...
What does it mean to multiply or divide polynomials? I have used them so many times, in error correcting codes, cryptography, etc. but it was never clear to me what would be a graphical representation/ interpretation. I have always pondered what did it mean when someone multiplies a line with a curve to get another hyp...
Suppose I have a DFA recognizing a regular language $L$, how do I prove that $$\text{lefthalf}(L)= \{ w_1 \mid \exists w_2 \in \Sigma^* ,w_1w_2 \in L \land \|w_1\| = \|w_2\| \}$$ is also a regular language?
Is there some natural or notable way to relate or link math groups and CS formal languages or some other core CS concept e.g. Turing machines? I am looking for references/applications. However note that I am aware of the link between semigroups and CS languages (namely via finite automata). (Does this literature on s...
Say, I have some permutation or combination formula like this, $$\frac{n!}{(n-r)!r!},$$ and I want to $\bmod$ the result with some big prime ($10^9+7$ for example). I already tried with modular operation and multiplicative inverse but failed (I don't quite understand them). Can someone give me some example in code so ...
I am trying to calculate the runtime complexity of a function that does not have fixed size input, but uses several helper methods that do have fixed size input. I was unsure of how to include the helper methods in my calculations. If I have an array with a fixed size of 32 indices, and I have a function that sums up ...
Given a directed graph $G = (V,A)$, a feedback arc set is a set of arcs whose removal leaves an acyclic graph. The problem is to find the minimum cardinality such set. I want to find out about is there some approximation algorithm around this problem.
If the running time of an algorithm scales linearly with the size of its input, we say it has $O(N)$ complexity, where we understand N to represent input size. If the running time does not vary with input size, we say it's $O(1)$, which is essentially saying it varies proportionally to 1; i.e., doesn't vary at all (bec...
Consider the following sequence $a_n$: \begin{align*} a_0 &= \alpha \\ a_k &= \beta a_{k-1} + \kappa \end{align*} Now consider the implementation of this sequence via lisp: (defun an (k) (if (= k 0) alpha (+ (* beta (an (- k 1))) kappa))) What is the running time to compute (an k) just as it is written? Also...
I have an index taking as keys values from the power set $P(S)$ of a set $S$, except for $\emptyset$ and $S$. Then I have a query $Q=(s, k)$, where $s \in P(S) - \{\emptyset \cup S\}$ and $ 1 < k \le |S|$. The result of the query is the set of covers $R$ of $S$; $\forall r \in R, |r| \le k$. So for instance, if $S = \...
I have a Set $S$ of objects, a set $U$ of users and a map $c: U \rightarrow S^{\prime}$, where $S^{\prime} \subset S$ and $\emptyset \notin S^{\prime}$. Every time I add a new entry to $c$, i.e. adding a new user $u$ with her associated subset of $S^{\prime}$, I need to get the list of other users with whom she covers ...
What are the common ways to check if a given language is regular, context free, or context sensitive? Any surveys or notes would also be helpful. There's no need to describe your suggestions. eg. it is sufficient to say a language is regular if it can be recognized by a DFA.
In a three dimensional Cartesian space, given a ray in its parametric form: $r(t) = [1, 1, 1] + t[-1, -1, -1]$ find the intersection points between the ray and the following primitives. a) A sphere centered at the origin with a radius of $1$, and b) a triangle with vertices $\{[1,0,0]^T , [0,1,0]^T , [0,0,1]^T \}$. R...
In the A* search algorithm, we use a priority queue with heuristic function to find optimum result with minimum cost. But, how do we get the path after reaching goal?
What are some applications that require computing the permanent of a matrix? One application I know of is related to graph theory and matchings. Apparently, the number of perfect matchings of a bipartite graph is the permanent of its incidence matrix. I am curious to know more applications of matrix permanent.
Suppose I type in the website www.youtube.com. The computer first asks a local domain name server (DNS) what the IP address of this website is. If it can't find it, it then asks the root server, etc. This is recursive querying. How does DNS work if there is no recursive querying? Is the root server the only one that ...
It is well known now that Grover's quantum algorithm can SORT a database of $N$ entries in $O(\sqrt{N})$ time. How can an algorithm work without reading through the list of entries which needs $O(N)$ operation. How does Grover's algorithm avoid reading the list? Is there a special representation that can be used classi...
Data Structures is the second CS course taught at Columbia University and it lists Discrete Mathematics as a Co-Req. I have a BSEE and have not taken any discrete mathematics and am having a hard time understanding why I need to take this to do things like create data structures? Is this just so the university can cram...
I am trying to learn about applying the pumping lemma and I'm not really sure how to go about proving this language isn't regular with the pumping lemma: $L= \{0^n 1^m \space | \space m \equiv 0 \space mod \space n, \space n \geq 2 \}$ Now I realize that the condition $m \equiv 0 \space mod \space n$, is essentially sa...
I know how to code for factorials using both iterative and recursive (e.g. n * factorial(n-1) for e.g.). I read in a textbook (without been given any further explanations) that there is an even more efficient way of coding for factorials by dividing them in half recursively. I understand why that may be the case. Howe...
I've converted an NFA to a DFA. But even after checking over it a few times, it still doesn't feel right. I'm sure this is trivial, but I'd like someone to give me an idea where I went totally wrong on this. NFA: DFA:
This is the question I am asked and I am currently proving it using proof by contradiction something like this: Let's take some language L which is non regular. Let's assume compliment of L i.e. $(L^c)$ is regular. Since we know that regular languages are closed under complementation, complementation of $(L^c)$, i.e. ...
By Information-Theoretic definitions, the One Time Pad (OTP) is called/was proved to be a Perfectly Secure Cipher. For the sake of completeness, we define OTP: An enc/dec function, $f:\mathcal{P} \times \mathcal{K} \rightarrow \mathcal{C}$ Perfect Security: Given $m, m^* \in \mathcal{M}$, $$P\big(m=m^* \mid E_\mathcal...
Consider the following pseudo code for mapreduce to find the frequency of words in a collection of documents: map(String key, String value) // key: document name // value: document contents for each word w in value EmitIntermediate(w, "1") reduce(String key, Iterator values): // key: word // values: a list of coun...
As the question states, how do we prove that $\textbf{NTIME}(f(n)) \subseteq \textbf{DSPACE}(f(n))$? Can anyone point me to a proof or outline it here? Thanks!
I'm willing to take a course in formal languages and automata theory , where we will explore side by side a functional programming language to implement the different algorithms we will encounter ,despite i am new to the language , i am assuming i've learned what's nessecary to move to the theoretical part , so i'm won...
Problem taken from here (page 3): http://cse.unl.edu/~choueiry/S06-235/files/MasterTheorem-Handout.pdf $T(n) = 3T(\frac{n}{2}) + \frac{3}{4}n + 1$ $f(n) = \frac{3}{4}n + 1$ It says we cannot use the traditional Master Theorem because $f(n)$ is not a polynomial. How is $\frac{3}{4}n + 1$ not a polynomial? It's a polynom...
I read that most scientists don't believe that P=NP. It might be subjective but can you simplify why not? I'm not informed enough to have an opinion but I'd like to know the definitions and some "pretty simple" explanation why to believe one or the other case, for instance why even believe that it can be proved?
Several popular machine learning algorithms such as Logistic regression or Neural networks require its inputs to be numeric. What I'm interested in is how you make these algorithms work on non-numeric inputs (such as short strings). As an example, let's say we're building an email classification system (spam/not spam),...
I just started learning about formal lang and automata theory, and recently learned about regex, so I don't know any complicated symbols, so please stick with basic symbols. The question is: Write a regex for the following language over {0,1} that is a set of all odd length strings that contain exactly two 0's. I've go...
Below are two questions I found in Theory of Computation book but couldn't find its correct answers, can anyone please give correct answers with explanation? It is undecidable, whether an arbitrary Turing machine(TM) has 15 states an arbitrary TM halts after 10 steps an arbitrary TM ever prints a specific letter an a...
If a language is decidable, we can write a method that always halts and returns true for each string that is an element of the language and false otherwise. If a language is undecidable, what does that mean? Does it mean: a.) We cannot write a method; we cannot even conceive of a method. b.) We can write a method that ...
I am looking for a library which provides a "serializer" ADT for synchronization. (http://courses.cs.vt.edu/~cs5204/fall99/Summaries/Concurrency/serializers2.html) Googling leads me to nowhere, unlike monitors,semaphores and other constructs, serializers are hardly discussed over the web in depth. Any other pointers a...
A type-0 grammar generates a recursively enumerable (RE) language. A RE language is also known as a semi-decidable language. A semi-decidable language is a particular kind of undecidable language: If a language is semi-decidable, we can write a method that returns true for each string that is an element of the langua...
I am looking for visual tools for the design, and optionally verifications, of concurrent systems. PS: There is no tag for visual-programming, I must have 150 reputation to create one, so please create one if you can.
I know how to use the FFT for multiplying two equations in $O(n\,log\,n)$ time, but is there a way to use FFT to compute the expanded equation before simplifying? For example, if you are multiplying $A(x) = 1 + 2x + 6x^2$ and $B(x) = 4 + 5x + 3x^2$ such that you get $C(x) = A(x) \cdot B(x) = 4 + 5x + 3x^2 + 8x + 10x^2 ...
Given any Context-Free-Grammar, $G$, and another in Chomsky Normal Form, $G_c$, how can we check if both $G$ and $G_c$ generate the same language? One of the trivial ways I know of is to convert $G$ into a CNF form. which motivates my second question, Can two different Context-Free-Grammars in CNF, $G_c$ and $G_c^\p...
I feel the notion "there are countably many Turing machines" is wrong. Suppose there is a Turing machine whose input alphabet is {0}. If we replace the input alphabet {0} with {a} and replace every occurrence of "0" with "a" in the transition table, then we get another Turing machine. Obviously, these two machines are ...
Could somebody explain to me why the height of a weight balanced binary tree in $O(\log n)$ in the worst case?