instruction
stringlengths
35
29.1k
In the compiler course by Alex Aiken on Coursera, more specifically lecture 05-02 Context Free Grammars, the professor says that CFGs give answers of the type yes/no, i.e. whether the given string of tokens is valid or not. He adds that it is also desirable to know how a particular string of tokens is in the language;...
Given an orthogonal polygon (a polygon whose sides are parallel to the axes), I want to find the smallest set of interior-disjoint squares, whose union equals the polygon. I found several references to slightly different problems, such as: Covering an orthogonal polygon with squares - similar to my problem, but the co...
I'm trying to generate a random but realistic network topology so I can test the performance of some routing algorithms. I came across Waxman's model described in Routing of Multipoint Connections, which seems pretty simple: Distribute $N$ nodes randomly across a plane (uniform in x and y). For each pair of nodes, gen...
In my homework we're given the following problem: Determine whether the context-free language described by the following grammar is regular, showing all the reasoning steps: S -> T T | U T -> 0 T | T 0 | # U -> 0 U 0 0 | #. My teacher says the pound sign (#) is just a delimiter that is in the alphabet and not epsilon. ...
Here is the variation: We have some P piles of numbers,each having some pi numbers , and in each turn a player may choose a pile, and then a number from the chosen pile. All the numbers greater than equal to the chosen number are removed from the chosen pile. We have to determine, if the player moving first has a winn...
I've got a grid consisting of squares that is 3 squares high and N squares long. Some of the squares are filled with numbers that are not greater than 3*N. You can move only to squares that are below, above, on right, or left from you. When you move on a square, you fill that square with a number of the amount of move...
Given N numbers and M range queries (starting and ending points), I need to compute majority (most frequent element, if it exists) in these ranges. I'm looking for an algorithm that would answer queries in logarithmic or even constant time.
Let $\phi$ be a 3-CNF formula over variables $x_1,x_2,\ldots,x_n$. Every variable $x_i$, $i \in [n]$, occurs equally many times as a positive literal and as a negative literal in $\phi$. Is it NP-complete to decide the satisfiability of such a formula? Assuming it is, I would be interested in knowing if it has a speci...
I am learning LR(1) parsing from the Dragon Book. I am really confused with this sentence. Formally we say that a configuration $[A \to u•v, a]$ is valid for a viable prefix $α$ if there is a rightmost derivation $S \Rightarrow^* βAw \Rightarrow^* βuvw$ where $α = βu$ and either $a$ is the first symbol of $w$ or $w$ ...
Basically, how much math background do you need to understand how category theory is applied to Haskell? If you already have mathematical maturity, can you jump right into it, or should you be familiar with certain subjects in algebra?
I'm trying to prove that every language that is not the empty set or {0,1}* is complete for NL (nondeterministic logarithmic space) under polynomial-time Karp reductions. I'm really not sure how to even approach this problem or what languages are being discussed if you exclude both the empty set and {0,1}*. Any suggest...
I am stuck and having a hard time with this question. I want to construct a CFG for the language $$L = \{{a^lb^mc^n | l,m\in N, n=|l-m|\}}$$ I know that the language consists of strings where: 1. number of a's = number of b's, so c=0 2. number of a's more than number of b's, c=l-m 3. number of a's less than number of b...
I can't figure out a proof that recursive languages are closed under concatenation. I know this is easy for most of the people but unfortunately my professor is not very good at explaining the material. If anybody can provide any hints on how to do it I would greatly appreciate it.
Is there a proof or reference that $\left\{\text{MAX},\text{MIN}\right\}\text{-True-2-XOR-SAT}$ is $NP$-hard, or that it (the decision version) is in $P$? Let: $$\Phi\left(\mathbf x\right)={\huge\wedge}_{i}^{n}C_i,\\ \forall_{C_i} \left.C_i=(p \oplus q)\right|_{\left(p\in \mathbf x \vee\neg p\in\mathbf x\right),\left(q...
I'm a fledgling computer science scholar, and I'm being asked to write a paper which involves integer factorization. As a result, I'm having to look into Shor's algorithm on quantum computers. For the other algorithms, I was able to find specific equations to calculate the number of instructions of the algorithm for a ...
I'm trying to prove that the language SPACE TMSAT (where SPACE TMSAT = {⟨$M$, $w$, $1^n$⟩ : DTM $M$ accepts $w$ in space $n$}) is PSPACE-complete. My solution is as follows: SPACE TMSAT $= \{<M,w,1^{n}> :$ DTM $M$ accepts $w$ in space $n\}$ can only be computed by running machine $M$ on $w$. As this forces the allowanc...
What is the complexity of $\text{MIN-2-XOR-SAT}$ and $\text{MAX-2-XOR-SAT}$? Are they in P? Are they NP-hard? To formalize this more precisely, let $$\Phi\left(\mathbf x\right)={\huge\wedge}_{i}^{n}C_i,$$ where $\mathbf{x} = (x_1,\dots,x_m)$ and each clause $C_i$ is of the form $(x_i \oplus x_j)$ or $(x_i \oplus \neg...
The Monster M is the largest of the finite sporadic groups that arises in the classification of finite, simple groups in mathematics. M can be realized as a (very large!) set of 196882 X 196882 matrices with nothing more than entries of 1's and 0's, so long as we compute arithmetic as follows: 1+1=0 1+0=1+0=1 1*1=1 0*...
How to prove that if a language A is not regular then A* isn't regular either? I have tried the usual methods with no result.
Please tell me if my next optimization can work: I have symmetric, weighted, undirected graph, where it is knowen that the optimal tour, that visit all the vertices exactly once and return to the starting vertex, only contains edges with the weight of 1, it is also known that there is no edge with weight less than 1. M...
I'm looking for job sites in applied/interdisciplinary mathematics, more specially, say postdocs or higher positions in mathematics and medical imaging, mathematics and computer vision. I'm aware of mostly all the popular job sites, mathjobs, euro math jobs, jobs.ac.uk, nordic math jobs etc etc, but most of the jobs th...
This is a cross post from Stack Overflow, and DSP at Stackexchange since I cannot really decide which part of Stackexchange is most fitting. If this is the wrong place please tell me and I'll remove the question. I have a matrix with numerical data. The matrix contains values from 0 to an arbitrary integer value. Each ...
Let $T$ be a tree, and there is a weight function on the edges $w:E\to X$. $(X,\oplus)$ is a monoid structure. Define $f(u,v) = \bigoplus_{i=1}^k w(e_i)$, where $e_1,\ldots,e_k$ is the unique path from $u$ to $v$. Can we preprocess the tree, such that we can use linear space (or close to linear space), so we can answer...
The question asks to: construct a DFA which accepts exactly $\frac{n(n-1)(n-2)}{6} + \frac{n(n-1)}{2}+1$ many members of $\{0, 1\}^n$ for every n. I have no idea where to start to constructing the DFA, could you give some directions? By the way, how many states should this DFA have?
I would have a brief question about how to construct a Turing machine that is accepting only this language: $\qquad\displaystyle L_2 = \{a^i b^j \mid i \geq j \}$. I can't come up with any mechanism that would preserve that there are greater or equal number of 'a's than 'b's. Could you suggest me something?
I am learning about CS Theory and specifically Nondeterministic Finite Automata (NFA) right now. In my book I came across a section of text that discussed a way to determine the length of a walk stating specifically that : If a transition graph has a walk labeled $w$, then there is a walk w of length no more than $\La...
I have found an interesting exercise in my introduction to graphs workbook: Let $ad(G) = \frac{2\vert E(G)\vert}{\vert V(G) \vert}$ and $mad(G) = max\{ad(H): H\ is\ an\ induced\ subgraph\ of\ G\}$. Given a graph $G$ and a number $k \geq 3$, prove that if $\chi(G) > k \wedge mad(G) \leq k \Rightarrow \exists A \subseteq...
I'm currently taking an Algorithms course, and we are covering Backtracking, CSP, and heuristics. However, I'm getting confused on exactly the differences between these terms and their applications. When using Backtracking on a problem, I understand we are calculating the set of all allowable solutions to satisfy some ...
They have finite resources so they can be modeled by finite number of state what is the same that a finite state machine. There are any proof that it is not true? Thanks.
For functions or computations we have terms like: Deterministic – Determinism Pure – Purity Now what is the correct corresponding noun for side-effect-free? "Side-effect freeness"? "Side-effect freedom"? "Non-side-effective"?
I am trying to create a regular expression that will generate the following language under the {a,b,c} alphabet: all words that do not contain the substring "bbc" I am having a really hard time understanding how to approach this question. I have done several other questions where a certain substring must be excluded, b...
I have an array $A[]$ of size $L$, which contains numbers in the range $1 \ldots N$. Here $L>N$, so the array will contain repetitions. If $x,y$ are two numbers that are both present in the array, define the distance $d(x,y)$ to be the minimum difference in positions where $x,y$ appear, i.e., $$d(x,y) = \min \{|i-j| ...
It is well known that any CNF formula can be transform in polynomial time into a 3-CNF formula by using new variables (see here). If using new variables is not allowed, it is not always possible (take for instance the single clause formula : $(x_1 \lor x_2 \lor x_3 \lor x_4)$). Let define the (SAT to 3-SAT) problem :...
Let $S$ be a set of $n$ integers. Consider the following weighted permutations problem. Let $m<n$ be an integer. What is an efficient algorithm to enumerate all subsets of $m$ integers of $S$ such that they are listed in order of the sum of the integers in each subset? Each subset is a permutation, and each permutati...
I have an assignment where i need to create a Turing machine that decides an infinite language $L\subset \{0,1\}^*$ for which all $L'\subseteq L$, if $|L'|=\infty$, then $L'$ is not a regular language. I think this is not possible due to Rice's Theorem. It's not possible to tell for a Turing Machine if a language is re...
Let's say we have a sport, where many competitions are organized throughout the year. In these events, a set of people compete, although not every person competes in every event. I would like to categorize these people, and the events, in such a way that people in category $A$ performed well in the events of category $...
I want to be able to describe the idea behind the pushdown automaton (no tables or diagrams). So, I already know that $L = \{ ww \mid w \text{ in } (0,1)^*\}$ is not context free. Since CFL are not closed under complement its complement $L'$ is a CFL. I also read somewhere that any odd word is part of $L'$ (what abou...
Suppose I have an undirected graph which is stored as an adjacency matrix. The graph contains a single cycle; all other vertices are isolated. How can I efficiently find the length of the cycle? The best I've been able to come up with: Starting at row 0 of the matrix, traverse through rows until an initial 1 is found,...
I'm playing around with tournaments and currently have the problem that I need to check whether a given subset of the edges of a tournament is transitive (it need not be acyclic). I'm aware that I can always take the transitive closure of the edge set and see whether it terminates without adding a single edge or not, b...
It is said in the book Artificial Intelligence: A Modern Approach for finding a solution on a tree using BFS that: breadth-first search is optimal if the path cost is a nondecreasing function of the depth of the node. The most common such scenario is that all actions have the same cost. From that I understand that...
Let's say I have a 11x11 grid with a few points (around 8) marked in the grid. One of the points is in the center cell. Call it point P. I choose a point other than P and connect it with a line segment to P. Call that point C1 I choose another point that is not C1 and connect it with a line segment to P. Call that poin...
Let $P$ be the predicate on natural numbers defined by $P(x) \iff \varphi_x(x) = 1$ where $\varphi_x$ is the $x$-th computable function. Show that $P$ is not computable.
I am aware of a logarithmic-time algorithm to maintain the connected components of graphs in the Euclidean plane (D. Eppstein, GF Italiano, R. Tamassia, RE Tarjan, J. Westbrook, and M. Yung. Maintenance of a minimum spanning forest in a dynamic plane graph. J. Algorithms, 13 (1): 33 {54, 1992.). Does anyone know if the...
Let say I have a pda : δ(q1,a,Z)=(q2,aZ) δ(q2,a,aZ)=(q2,bZ) Is this allowed.... you can see that in δ(q2,a,aZ)=(q2,bZ), we are basically popping 'a' and pushing 'b' for a single transition... Is this allowed for PDA ??
I'm not sure if this is the correct stack exchange or correct tags, but my question is as follows: I am working on a sort-of ratings system for players in a particular game. After allowing the ratings to develop for many games, I have set up a "database" (not sure if this is the correct term) for matches: a point in t...
I try to understand the details regarding using Hidden Markov Model in Tagging Problem. The best concise description that I found is the Course notes by Michal Collins. The goal is to find a function $f(x)=arg max_{y \in Y} p(y|x)$, where $y$ is the tag set for sentence $x$. Question 1. It's suggested to use a generat...
How would you determine big O notation for $\log^b x$? I don't think you can simply say $O(\log^b x)$, can you? If you can, then here is a better question: $x^3 + \log^b x$. How would you know if it's $O(x^3)$ or something else depending on the $b$ value?
I want to estimate with big O the following expressions: $$ \begin{align*} f_1(x) &= \frac{x^4 + x^2 + 1}{x^4 + 1}, \\ f_2(x) &= \frac{x^3 + 5 \log x}{x^4 + 1}. \end{align*} $$ How do you eliminate the constant on the bottom of the fraction? How would you work to solve these types of problems?
I have the following grammar G: $$ \begin{align*} &S \to aB|bA \\ &A \to a|aS|bAA \\ &B \to b|bS|aBB \end{align*} $$ I am going to prove that this language L(G) consists of words with the same number of a's and b's by strong induction. Inductive hypothesis: $S$ produces $m$ $a$'s and $m$ $b$'s, $A$ produces $m+1$ $a$'s...
I've been reading these: Fast Reduction from RSA to SAT CNF Generator for Factoring Problems (Also have C code implementation) I don't understand how the reduction from FACT to $3\text{-SAT}$ works. Are there any simple articles in which I can read about it? My final goal is to eventually implement a reduction from $...
I've had this question on my exam today and I couldn't figure it out, I would like to know the answer. The question: Given relations $R$, $S$ on a set $U$. $R$ is transitive, $S$ is reflexive. Prove that $(R;S;R)^2$ is a subset of $(R;S)^3$. Partial answer of mine: By using associativity you get an equivalent questi...
How can we systematically convert a non-deterministic Turing machine into a deterministic Turing machine that recognizes the same language?
A book I read states "Since $G$ is planar, $G$ has a vertex $v$ of degree at most 5". Is this true? Why? Does this theorem have a name?
I'm studing P and NP complexity classes. I like know, why is SAT not in P? Is it because I can not determine if any Boolean expression is satisfiable?
This question is motivated by an older question about tiling an orthogonal polygon with squares.         Given a $3\times 2$ rectangle like the first image, the second image is a square partition of that rectangle. A square partitioning is a covering by non-overlapping squares; the entire rectangle must be covered,...
I have the following problem, which seems to be similar to Set Cover. We are given a set $U$ of elements (the universe, e.g., $U=\{1,2,3,4,5\}$). We're also given a set $S$ of subsets (e.g., $S=\{\{1\},\{2\},\{3\},\{4\},\{5\},\{1,2,5\},\{1,3,4\},\{2,3,4,5\}\}$). The standard set cover problem asks for the minimum subse...
Consider the following 3-SAT variant defined over the variables $x_1,\ldots,x_n$. In the $k$P$k$N-3SAT problem each variable $x_j$, $j \in [n]$, occurs exactly $k$ times as a positive literal in $\phi$, and exactly $k$ times as a negative literal in $\phi$, where $\phi$ is a 3-CNF formula. The problem is then to decide...
I came across the following dynamic subtraction game: There is one pile of n chips. The first player to move may remove as many chips as desired, at least one chip but not the whole pile. Thereafter, the players alternate moving, each player not being allowed to remove more chips than his opponent took on the previ...
Here is a variation of a job-scheduling Problem. Let $J = \{j_1,...j_n\}$ be a set of Jobs for $1 \leq i \leq n$. Given Job length $|j_i|\in \mathbb{N}$, deadline $f_i \in \mathbb{N}$, profit $p_i \ge 0$ and starting-time $s_i \in \mathbb{N}$. I am looking for a greedy approximation factor given that the Job length ma...
I've been researching ways of modeling and executing tasks which are dependent on each other (but in an acyclic way) and came up with task graphs. But the question that's bugging me is how can I find out the maximum degree of concurrency in a given task graph. In my case, I'm talking of a relatively small graph, around...
This question is motivated by an older question about tiling an orthogonal polygon with squares. It is a generalisation of my former question about how to prove that the minimum square partition of a 3X2 rectangle has 3 squares). Let: An almost-square-rectangle be a rectangle that has a width $w$ and height $h=w-1$. ...
I am searching for an algorithm to check whether a complete, undirected graph is fullfilling the triangle inequality( $\text{weight}(u,v) \le \text{weight}(u,w) + \text{weight}(w,v)$ for all vertices $u, v, w$). My first naive try was to use an algorithm for solving the all-pairs-shortest-path-problem and compare the r...
Half a decade ago I was sitting in a data structures class where the professor offered extra credit if anyone could traverse a tree without using recursion, a stack, queue, etc. (or any other similar data structures) and just a few pointers. I came up with what I thought was an obvious answer to that question which wa...
My task is to convert the following grammar to CNF: $S \to SS \mid (S) \mid \lambda$ after removing lambda productions: $S\to SS, S\to (S), S\to(), S\to S$ after removing unit productions: $S\to SS, S\to (S), S\to()$ I got upto this point. Do not know how this grammar will be in CNF coz I am not sure if using () make...
I'm talking about this one research project: but MS closed it in 2008. I've read many articles about it, about high perfomance (30+% faster against tradinional monolithic kernels), much more secure etc. So it should be really a revolution in OS designing. Why they did it? I would be really happy if they didn't... So on...
For a given acyclic graph $G$, a topological sort is an ordering $v_1, \dots, v_n$ of the vertices such that the arrows in the graph are all directed forward under that ordering. Question: can all topological orders of a graph $G$ be obtained from a single ordering by iteratively swapping two vertices that are not conn...
Dominosa is a relatively new puzzle game. It is played on an $(n+1)\times(n+2)$ grid. Before the game begins, the domino bones $\left(0,0\right),\left(0,1\right),\ldots,\left(n,n\right)$ are placed on the grid (constituting a perfect tiling). In the next step, the domino bones are hidden, leaving only the numbers ...
recently there have been a few questions on teaching CS in both cs.se & tcs.se and there are many high-rated related questions on the two sites on the topic. thinking over the latest one made me realize that a lot of students get exposed to some aspects of STEM through the media (sometimes inaccurately), and one of the...
It seems odd to me that the TSP denies the possibility of repeated cities. The goal of this traveling salesman is to go as fast as possible and visit all of the cities, right? So what if it is faster to travel through a city you have already been to?
I have a professor who is really poor at explaining the material, which is what makes answering his questions very hard. Here is the question: Recursive language with non-recursive subsets. Does one exist? I'm sure it is a very simple and easy answer but I can't figure it out. Don't give me the answer just point me i...
I'm struggling to understand this question: Give an encoding of the Turing machine with lowest index that accepts anything but the empty set. I know what an encoding of a Turing Machine is. But my professor didn't explain what the index of a Turing machine is and how I know that it is lower or higher? Can someone exp...
I have been given a graph with n nodes. Now, I have to color every node of this graph by k colors, number from 0 to k-1. Now, there is a rule. For a node $x$ with adjacent nodes $y_1 , y_2, y_3, y_4,... y_m$, $color(x)=(color(y_1)+color(y_2)+color(y_3)+...+color(y_m)) \pmod k $ where $color(a)$ indicates a color number...
Two matrices can be stored in either row major or column major order in contiguous memory. Does the time complexity of computing their multiplication vary depending on the storage scheme? That is, I want to know whether it will work faster if stored in row major or column major order.
I've been thinking about this one for a while: Consider the language of TMs which do not recognize themselves: $L_{s}=\{ \langle M\rangle ~|~ M \text{ does not accept } \langle M\rangle \}$. If $N$ is a TM where $L(N) \subseteq L_s$, then is $\langle N\rangle \in L_s$? Intuitively, I'm pretty sure it is true. I pictu...
One of my seniors had a job interview and he was asked why it is called dynamic. He couldn't answer and after he gave up the interviewer said that there's nothing dynamic about it, its just called like that. That is hard for me to believe. Does it refer to the fact that the subproblems are solved during run-time and us...
Let $\text{NOT-SELF} = \{\langle M \rangle : M \text{ is a TM that does not accept } \langle M \rangle \}$. How do you prove the following claim? If $Q$ is a TM so that $L(Q) \subseteq \text{NOT-SELF}$, prove that $\langle Q \rangle \in \text{NOT-SELF}$.
According to Wikipedia (link), patience sort finds the longest increasing subsequence of a given sequence. Lets say the longest increasing subsequence of seq has length correct(seq) Patience sort works like this: Parameters: A sequence of integers called seq Output: A number between 0 and the length of seq. Lets call i...
I'm trying to show that $L=\left\{w^rww^r:w \in \{0,1\}^*\right\}$ is not context free using the pumping lemma. I thought picking the string, $0^p0^p0^p$, would be a good candidate for this, but someone told me I might want to consider another string. Why is this? Any way in which I divide the string and then pump the ...
Consider these 2 languages: $L_{\ge5} = \left \{ \left< M \right> : M \text{ accepts at least 5 strings} \right\} $ $L_{<5} = \left \{ \left< M \right> : M \text{ accepts fewer than 5 strings} \right\}$ Are these recursive, R.E., or not R.E. sets (languages)? I would say that they are not recursive, based on app...
Solve the following recurrence equations a. T(n) = T(n/2) + 18 b. T(n) = 2T(n/2) + 5n c. T(n) = 3T(n/2) + 5n d. T(n) = T(n/2) + 5n This is only a sample of what I was given but I am not sure what the question is asking me or how to solve it? Can someone please explain this to me? The only thing I really know about them...
I'm trying to prove that the following language is undecidable:$$ \{ \langle M, w \rangle ~|~ M \text{ is a TM where its head moves left a finite number of times on } w \} $$ But I'm having a bit of trouble. I know I have to do some type of reduction, but I'm not really sure what. Can a Turing Machine be simulated b...
I'm looking for the name of the following concept. Given a monoid $(M,\oplus)$, and a finite set of generators $x_1,\ldots,x_n$. The generators are the alphabets. We define the regular expression on the words formed by the generators. We treat those words just like strings. For words $x$ and $y$, we write $x\equiv y$ ...
Would switching the accept and reject states of an LBA A create a new LBA we'll say A' in which the language of A' is the complement of the language of A? I believe the answer is yes just by working out an example...but I'm not sure on a solid proof...nor am I sure if the fact that I am working with an LBA vs a regular...
This is homework, so please only hints. I didn't want to put this on StackOverflow since this is mostly about theory, and SO gets inundated with too many questions. I am asked to find a method of arranging items in a skiplist, with height limited to 3 and unlimited number of elements, in such a way such that searching ...
This is a problem that I was given for my data structures and algorithms class. I am not sure how to tackle this problem. Can I get some assistance? At Hogwarts a new shipment of $n$ goblins has arrived. To be of any use, a goblin must be completely truthful (never lies). Unfortunately, not all of the $n$ goblins in...
Suppose we have a $n\times n$ symmetric matrix $\mathbf A$. I want to know if there exists two elements of a vector $\mathbf x$, let's call them $x_i,x_j,i\ne j$, such that $x_i +x_j+[A]_{i,j}\ge y$ for some vector $\mathbf x$ of size $n$. So: $$ f\left(\mathbf x \in \mathbb N^n,y\right)= \begin{cases} 1&\text{if }\exi...
I'm trying to use gates that do addition and multiplication modulo 5 to emulate logic gates. Assuming false and true are mapped to 0 and 1 respectively (with 2, 3, and 4 being invalid), I figured out I can map the operations like this: a and b -> a*b (mod 5) a or b -> 2*(a+b)*(a+b+2) (mod 5) I was wondering if there w...
I'm looking for an efficient algorithm for the following problem or a proof of NP-hardness. Let $\Sigma$ be a set and $A\subseteq\mathcal{P}(\Sigma)$ a set of subsets of $\Sigma$. Find a sequence $w\in \Sigma^*$ of least length such that for each $L\in A$, there is a $k\in\mathbb{N}$ such that $\{ w_{k+i} \mid 0\leq i ...
Following up on vonbrand's answer I want to write a small document about stronger master theorems for our students, one of which is the Akra-Bazzi theorem. I have copied the theorem from their paper [1] and found -- besides a small notational confusion² -- the following problem. The authors require (emphasis mine): $g...
Let $G$ be a graph, and let $s$ and $t$ be two vertices of $G$. Can we efficiently sample a shortest $s$-$t$ path uniformly and independently at random from the set of all shortest paths between $s$ and $t$? For simplicity, we can assume $G$ is simple, undirected and unweighted. Even in many restricted graphs, the numb...
An OS contains 10 identical processes that were initiated at the same time.Each process contains 15 identical requests. Each request consume 20 msec of CPU time.A request is followed by an I/O operation which consumes 10 msec.The CPU scheduling overhead is 2 msec. The system uses Round Robin scheduling with the time qu...
$L$ is defined over the alphabet $\{a,b\}$ and it's decidable. The language is $\mathrm{perm}(L)$ which is the set of all permutations of all words in $L$. So far my proof is the following: Construct a TM $M$ that decides the language $\mathrm{perm}(L)$. $M$ has input $w$. Let $\pi(w)$ be a random permutation of w. The...
Is there an algorithm/systematic procedure to test whether a language is context-free? In other words, given a language specified in algebraic form (think of something like $L=\{a^n b^n a^n : n \in \mathbb{N}\}$), test whether the language is context-free or not. Imagine we are writing a web service to help students w...
I had a question on an assignment where we were supposed to write a regular expression for a language where every $a$ in $w$ is immediately preceded and followed by a $b$. My answer was $\epsilon + (b + bab)^*$. The teacher pointed out that my answer makes an $a$ surrounded by at least two $b$s, which isn't correct. I ...
I understand how a the language of turing machines which do not accept themselves is not recognizable but I'm not sure if the same proof could be used to describe a DFA... i.e a proof by contradiction in which a recognizer M recognizes a TM which does not accept itself on input ...creates a contradiction in which if M ...
Well everything is in the title. After all Siri voice was made from someone, so can I use software to make a computer generated voice sound like my voice or anybody else?
In trying to understand how Turing Machine encoding works, there is a question that I have come across that goes something like this: Given that the diagonal language, $L_d = \{ w_i \mid w_i \space is \space not \space accepted \space by \space M_i \}$, what is the first string of the encoding of the complement of $L_d...
I am reading about disk redudancy. I read the following: Suppose that the mean time to failure of a disk is 100,000 hours. Then the mean time to failure of some disk in an array of 100 disks will be 100,000/100 = 1000 hours I don't understand this. Why isn't it 100,000^100 instead? Then the same textbook says...
I'm trying to figure out how to prove or disprove the following statement: Infinite union of recursive languages is recursively enumerable. I know how to prove that infinite union of regular languages is not recursive, but I can't figure out how to prove the statement above. Intuition is telling me that the statemen...
I am trying to subtract these two binary numbers: $ 1110 - 1011$ First I convert 1011 to two's complement by doing 1011 to 0100 and then adding 1 to get 0101. Then I add the first number to the converted two's complement number: $1110$ $+$ $0101$ $-----$ $0011$ 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1 carry 1 + 1 + 0 = 0...