instruction
stringlengths
35
29.1k
In 1962, you could win a prize of \$ 10 000 (about \$ 80 000 in today's money) if you found the solution to an Euclidean travelling salesman problem defined on 33 cities. http://www.math.uwaterloo.ca/tsp/history/pictorial/car54.html Looking at the picture, the problem seems pretty easy. However I failed to find more de...
According to Wikipedia: ...metaheuristic is a higher-level procedure or heuristic designed to find, generate, or select a lower-level procedure or heuristic (partial search algorithm) that may provide a sufficiently good solution to an optimization problem... So a metaheuristic is something like a shaman (maste...
I had a question that asked for the DFA that accepts the following language: {w | every odd position of w is a 0 } Should this DFA accept the empty string, since it doesn't have an odd position?
I'm reading a paper for school and I have come across a passage that I don't understand. It says "If we allow the query to access the entries of the array through an oracle, it is possible to obtain a data structure of sublinear size". Searching for information on what Oracle Access is has given me nothing but stuff ab...
Intuition: Suppose I have an array of nonzero integer values $A[n]$ and a partially constructed Fenwick tree of this array: $F[k], n>k$. I can see why inserting the next element would be worst case $O(\lg n)$. The number of elements accessed from $F[0:k]$ to calculate $F[k+1]$ is equal to the number of trailing zeroes ...
The Knapsack problem has a well-known FPTAS based on rounding and then using the pseudopolynomial dynamic programming algorithm. When the valuations $v_i$ are private, we also need the assignment rule to be monotonic (i.e., if a player gets included in the knapsack, then if he increases his bid/valuation, he should sti...
Reading a bit about the subject of Multi-Bit tries and IP matching in: High Performance Switches and Routers H. Jonathan Chao, Bin Liu. Page 33 Network Routing: Algorithms, Protocols, and Architectures (The Morgan Kaufmann Series in Networking) April 12, 2007 by Deepankar Medhi. Page 507. And they both mention path...
The Problem: Suppose you have a simple polygon (edges don't cross). Find the union of of all 1x1 squares that fit in the polygon. To be clear, I am asking for the union of all points that are in some square that fits into the polygon. Maybe the border of this union can be expressed as a shape whose edges are line se...
I am contemplating the Church-Rosser property and I clearly misunderstand it, but I do not exactly know why. If $x$ and $y$ are such that $x \overset{*}{\leftrightarrow} y$, then $x \overset{*}{\rightarrow} y$ and since $y \overset{*}{\rightarrow} y$, we have that both $x$ and $y$ reduce to $y$ (or $x$, for that matter...
Can anyone explain me what (problem-)kernels are and what's the use of them? My slides say: The kernel of a parameterized problem $L$ is a transformation $(x,k) \mapsto (x',k')$ such that: $(x,k) \in L \Leftrightarrow (x',k') \in L$ $|x'| \leq f(k)$ for some function $f$ $k' \leq g(k)$ for some function $g$ transfo...
Say I have some problem of $O\left(n^k\right)$ complexity. If I were to solve the problem on a computer $x$, it would take time $t$. Now I have a new computer $x'$, which has double the computing power of $x$. How long would it take $x'$ to solve the same problem in terms of $t$?
Let $K$ be the halting set and suppose $K \leq_m A$ (under some function $f$), that is, $K$ is many-one-reducible to $A$. How can $f(K)$ be a finite set? Why if‌ $B$ is recursive, is $f^{-1}(B)$ also recursive?
I'm currently developing my degree thesis, and the lab's idea is to design a new micro architecture, and then, be able to compile stuff for this architecture. So the question is, how do you instruct a compiler to generate your new assembler??? The general idea is to be able to compile with gcc and run netbsd or similar...
Can anyone help me demonstrate these two statements? $$ n! = o(n/2)^n $$ $$ n! = o(n/3)^n $$ I am sure about the first one but I don't know how to demonstrate it. As for the second one I am not sure whether it is true or not.
There's something I don't really understand about the Slotted AHOLA protocol, and I hope you can help me: what happens if a station wants to send two packets at the same time? Will it be considered as a collision? If not, when will the first and second package be sent? I did some research here but all I found was prob...
Consider the following problem: You are on a road trip, and there are $n$ cities along a road, labeled $1$ to $n$. Conveniently, these cities all lie on a single road, and the distance between two adjacent cities is one mile. We are currently at city $1$, and would like to drive to city $n$. Each day, we can d...
I don't recall hearing that nodes in red-black trees can't have one nil child and one non-nil child. However, I did hear that red-black trees have a worst-case height of $2log_2(n + 1)$, where n is the number of nodes, and I don't see how this could be the case if nodes can have one nil and one non-nil child, as a tree...
What is the complement of $\mathrm{ACFG} = \{ G \mid G \text{ is a CFG and }L(G) = \Sigma^* \}$? I think it is $\mathrm{ECFG} = \{ G \mid G\text{ is a CFG and }L(G) = \emptyset \}$. It makes sense to me because the complement of the empty language is the universal language? Am I correct?
Pretend you want to search through a max-heap to find a specific element. I know there is no such option but still... Would it take worse case O(n) or O(logn) time? I am assuming O(n) since the property of a max-heap doesn't really help us unlike a bst. Thanks.
I have two trajectories of a moving object. Each trajectory is composed of poses at discrete time. Each pose is a translation vector and a rotation matrix. Each trajectory defines the same path (with noise) but expressed in some arbitrary frame of reference. I need to find the relative transformation that aligns both t...
I have been trying to get to grips with what an exponential object is using a poset as an example. So in the poset... {2, 4, 6, 8, 9, 12, 14, 30, 36, 48, 60, 72, 84} x is related to y iff x is a factor of y. I understand eg: hom(- x 60) is isomorphic to hom(-, 84^60) so... 2x60 = 2... and 2->84 4*60 = 4... and 4->84 et...
Lets say I have a few million random items. Each item has 6 attributes: Type, Cost, Strength, Stamina, Agility and Intelligence. Type is one of 4 different possibilities, the other 5 are various numbers Now I must produce a set of 4 items where the inputs are X (the maximum cost of all items) and Y (one of the latter 4...
As you know, an Oracle Turing Machine (OTM) is a "black box" which somehow can tell us whether a given Turing machine with a given input eventually halts. By Church's Thesis it is impossible to design an algorithm which is able to solve such a problem. If we will never get such a black box then why is it important and...
Let $n > 1$. For an integer $k$ with $0 \leq k \leq 2^n-2$ the cyclotomic class $C_k$ of $2$ modulo $2^n-1$ is the set given by $$C_k = \{k, k\cdot 2, k \cdot 2^2 , \ldots, k\cdot 2^{n-1} \pmod {2^n-1}\},$$ where the entries are reduced modulo $2^n-1$. Note that either $C_k = C_i$ or their intersection is empty. A set...
Is there a conventional symbol for "points to" or "is a pointer to". I've been using a short right arrow; for example "a is a pointer to b" would be (approximately) a -> b but I wonder whether a short double right arrow would be better: a => b Best of all would be to know, and use, a universally-accepted standard sy...
I am looking for a workload which is hard to paralellise/distribute between multiple machines. For example, integer factorization does not go 10 times faster if you have 10 machines to split the load, but is there a better example?
I looked at Linear Programming, and it are problems like this: You know that Cabinet X costs 10 cents per unit, requires 6 square feet of floor space, and holds 8 cubic feet of files. Cabinet Y costs 20 dollars per unit, requires 8 square feet of floor space, and holds 12 cubic feet of files. You have been given 140 d...
Given an undirected tree (i.e. a tree without any designated root) of even number of nodes. The task is to remove as many edges from the tree as possible to obtain a forest of trees, where each such tree contains even number of nodes. And return/output number of removed edges as an output/answer. Counting maximum numbe...
I'm having some trouble understanding part of Skienna's algorithm for edit distance presented in his Algorithm Design Manual. I'm posting the recursive version, prior to when he applies dynamic programming to the problem, but my question still stands in that version too I think. He provides the following code: #define ...
Let $n > 1$ and let $\mathbb{F}_{2^n}$ be the finite field with $2^n$ elements. The trace function $T(x) = x + x^2 + x^{2^2} + \cdots + x^{2^{n-1}}$ is an onto linear transformation from $\mathbb{F}_{2^n}$ to $\mathbb{F}_2$. There are $\phi(2^n-1)$ primitive elements in $\mathbb{F}_{2^n}$ (generators of the cyclic mult...
Edit: Solved, see comments I don't understand how the inorder traversal traverses through the whole tree. According to wikipedia, the pseudo code for the inorder traversal is: sub P(TreeNode) If LeftPointer(TreeNode) != NULL Then P(TreeNode.LeftNode) Output(TreeNode.value) If RightPointer(TreeNode) != NU...
I'm interested in learning about some of the algorithms available for multiplying non-square matrices, yet despite exhaustive Googling efforts I have been unable to find any discussions of such algorithms except for a couple of extremely general pieces of pseudocode that I found on Wikipedia and MIT OCW. If anyone coul...
I know that Symbolic Model Checking is state space traversal based on representations of states sets and transition relations as formulas like in CTL using models like Kripke Model. I know the theory. But I'm finding it hard to understand the actual application. Where exactly is it used? What exactly does it do and how...
I came across a very hard interview question in last month’s Ph.D. entrance exam. It was asking which one of the languages is inherently ambiguous. Short answer says 2). Why is the language in 2) an inherently ambiguous language? 1) $L = \{a^n b^{2n} c: n\geq 0\} \cup \{a^{2n} b^n d: n\geq 0\}$ 2) $L = \{a^n b^m c^p: n...
I am reading a book on a computer science topic but lack some of the prerequisite background. Normally when I run into terms I don't understand I simply look them up, but for Universal Search I simply haven't been able to find an explanation suitable for a reader without a background in statistics/computer science. I'v...
I prepare for local complexity contest and review some old Interview questions banks. I get stuck in one problem and no idea how we can solve it. please share your idea or help with this question: Suppose $C$ is a set of all one-variable computable functions, $C^{(n)}$ is a set of all one-variable computable functi...
If the complexity of recognizing whether two regular expressions represent different languages is EXPSPACE-complete, then what can be said for the complexity of recognizing whether two $\omega$-regular expressions represent different languages?
I tried reading PBRT but I wasn't able to fully understand the concepts in the book. The following are the two books that I found useful to read before reading PBRT. http://www.amazon.com/Ray-Tracing-Ground-Kevin-Suffern/dp/1568812728/ref=sr_1_1?s=books&ie=UTF8&qid=1426597005&sr=1-1&keywords=ray+tracing http://www.amaz...
Quite often, I stumble upon abstract algebra concepts like initial algebra, free algebra, and similar while reading papers on programming languages. For instance, in papers on algebraic data types, monads, separation logic, models of polymorphic lambda calculus, etc. Where can I find materials that will introduce me t...
To dumb it down to basics, lets say I have a struct called item that looks like this: struct item { int power, cost; }; then I have 2 arrays of these items, each filled with N items with various amounts of power/cost Then I want a list of combinations of these items (item a + item b) where each item must have the ...
Let $C_i$ be the execution time for task i, $T_i$ be the task period and utilization rate $U = \frac{C_i}{T_i}$ Then $U$ must be less or equal to $1$ for the task to be schedulable Proof: Let $\hat T$ be the lcm of task $T_1,...T_n$ i.e. $\hat T = \prod_i > T_i$. Define $\hat L_i = \hat T/T_i$ the number of times ...
Here is the question: Consider a computer system that has cache memory, main memory (RAM) and disk, and the operating system uses virtual memory. It takes 2 nsec to access a word from the cache, 10 nsec to access a word from the RAM, and 10 ms to access a word from the disk. If the cache hit rate is 95% and main memor...
By Church-Turing's thesis, it is impossible to design an algorithm to decide the halting problem. Does the word algorithm in this context include artificial intelligence or not, that is, does Church-Turing thesis also apply to artificial intelligence? Is it possible to design an intelligence system in the future to ...
Since any node points to a memory location is there any specific need in using it's pointer as structure type.Why couldn't we use integer as the pointer type in linked list rather than structure?
Suppose we are given an array $\texttt{a[]}$ of $n$ non-negative integers. The algorithm should give back $\texttt{-1}$ if an integer appears more than once in $\texttt{a[]}$. Otherwise we interpret $\texttt{a[]}$ as a permutation $\pi:\{0,\ldots, \texttt{max(a[])}\} \to \{0,\ldots, \texttt{max(a[])}\}$ sending $\text...
Given $f : \{0,1\}^* \to \{0,1\}$ and $n \in \mathbb{N}$, we define $\textsf{Prob}(f,n)$ as the following problem: Find an $x \in \{0,1\}^n$ such that $f(x) = 1$. A machine solving $\textsf{Prob}(f,n)$ would have $f$ encoded as a bit-string representing another machine computing $f$ and would have $n$ encoded in bina...
I'll apologize in advance if anything in here is ineloquent. Suppose we have a pair of lossless compression (C) and decompression (D) functions. compressed = C(uncompressed) and uncompressed = D(compressed) Because the system is lossless, it should be expected that any data passed through C will map to a single, unam...
I have the following deterministic finite automaton and I am need to prove correctness of the claim that this automata accepts $\{wab \mid w\in \{a,b\}^*\}$ I know that I need to prove by induction on the length of the word but I am not sure how to do the induction step. My try: Anchor: After processing the only strin...
I'm reposting this because people found the last description to be too hard to follow. The data unit I'm working with is a pair of 2 numbers. The numbers can be any integer that is bigger than 0. Example: [X, Y] The input is 2 arrays of these pairs, each array can have any length. Example: A = {[1, 2], [3, 2], [5, 1...
I have a list of n items. I need to find the items that will be present in a given range, if the list were to be sorted. Sorting the entire list is not required and not desired, the buckets can be evenly spaced, but if an approach can handle a particular bucket starting at index i and ending at index j it would be pref...
I would have made a comment, as this pertains to Andrej Bauer's answer in this thread; however, I believe it is worth a question. Andrej explains that given the set of all bit strings of length 3 or less, a lossless compression function can only "compress" some of them. The others, for instance "01" would have to actu...
I'm currently reading some papers about Markov chain lumping and I'm failing to see the difference between a Markov chain and a plain directed weighted graph. For example in the article Optimal state-space lumping in Markov chains they provide the following definition of a CTMC (continuous time Markov chain): We consi...
I am trying to solve this problem, and i have tried multiple methods, but i must be missing something, here is the problem: Given a matrix MxN. Find the shortest path from (1,1) to (M,N), where each number in the matrix represents the costs and one can only move horizontal and vertical: e.g. M = 1, 50,50,50,50; 1, 50...
What is the adjective used to describe the fact that a server keep track of queries made by a user. I take the example of a database server.
Suppose I have a function $f$ on sets. What is the property of $f$ called when, for all sets $x$, $y$: $f(x)$ is a superset of $f(y)$ when $x$ is a superset of $y$ i.e. $$\forall x,y : x\supseteq y \Rightarrow f(x) \supseteq f(y)$$
I am working on the following problem Find the linear least squares unit weights for the `OR' problem, ie. $v_1^T = (0,0), v_2^T = (1,0), v_3^T = (0,1), v_4^T = (1,1)$ and $u_1 = 0, u_2 = u_3 = u_4 = 1$. Here $v$ represent inputs and $u$ outputs. For problems like this I usually find a matrix $W$ (the weights) such tha...
This question comes from an application in multivalued logic. Suppose, we are given an alphabet of three letters $A, B, C$ and a set of indices $1,2,3,4,5$. Consider items formed by subscripting the letters with one of the indices. Examples are the following: $$A_1 \\ B_4 \\ C_3 \\ ... $$ Suppose, additionally, that th...
Consider the following problem. Given: A complete graph with real non-negative weights on the edges. Task: Find a planar subgraph of maximum weight. ("Maximum" among all possible planar subgraphs.) Note: The maximum-weight subgraph will be a triangulation; if the complete graph is on $n$ vertices, it will have $m=3n-6...
Has anyone studied the consequences of the Kleene star in regular expressions to always be "possessive"? In other words, if * would always match as much as possible and no backtracking is allowed, would I still be able to express any regular language? Let's say that @ is the possessive * operator. There are cases wher...
I am looking to develop an app that generates a single identicon image that summarizes the genome information in visual form. Identicons are essentially a visual hash of of data. usually string data such as an IP address or name. In this case, rather than generating an identicon from a single piece of string data. I w...
So in this paper I'm reading (https://adamsmith.as/papers/fdg2013_shortcuts.pdf), the authors talk about an $NP^{NP}$-complete problem, in relation to Answer Set Programming. I know what P, NP, etc. are but I don't unerstand what they mean with $NP^{NP}$. Also I can't Google it because Google doesn't recognize superscr...
I have been reading about the AI approaches, and I came across the AI emergent approach that has the following definition: That is, the appearance of an entity with a sense of its own identity and agency within a sufficiently complex system. And I have got trouble understanding the meaning I have read the the paper Wha...
I have to decide which language type will result from the union of a type-2 (context-free) and a type-3 (regular) language. Is there a way or rule to decide this for all language types?
I have a task of comparing two organisation charts. These chart objects are described as a set of nodes (people) where each has a unique ID field and a parent ID field (pointing to another node's unique ID). For simplicity we can assume that there's only one node without a parent ID (head of the organisation) and that ...
I've recently read that there were many real numbers that would never be reachable by humanity. The explanation itself says that we can write as many programs as integers which is infinite, but there are infinite real numbers between two integers so Real numbers infinity is bigger than integer numbers. Well my questio...
In the below post, it is explained how to express xor of two variables as linear inequalities. Express boolean logic operations in zero-one integer linear programming (ILP) Naturally, the xor of multiple variables can be expressed using a sequence of multiple 2-input xors but my question whether there is a smarter way ...
I have the following problem: How to show that the special case of SAT, in which each clause has either exactly two literals or at most one negative literal, is NP-complete?
I am trying to find a context free grammar for the language $L = \{xy \mid |x|=|y| \text{ and } x≠y^R\}$ where $y^R$ is the reverse of string y and $x, y\in \{a,b\}^*$ . Here is a possible solution: $G=\{V,Σ,R,S\}$ where $V=\{A,B,a,b\}$ $Σ=\{a,b\}$ $R=\{S\rightarrow aSa|bSb|aBb|bBa,$ $\ \ \ \ \ \ \ \ \ \ B\righta...
So I am reading about the calculus of inductive constructions. And I see here and here that there hidden indexes that the user does not know about in the $Type$ sort. It says that they are instantiated with proper values at the time of type checking. I am wondering, what is the importance of this? Looking at the rules ...
From my understanding for a function to be considered Turing-computable the Turing machine which computes it must terminate for all inputs (according to this http://planetmath.org/turingcomputable and various other sources I've read). But then doesn't this mean that all partial functions are not Turing-computable? (and...
I am trying to implement the branch and bound algorithm to solve the knapsack problem (in the Coursera discrete optimisation course). I tried implementing dynamic programming first, and that worked fine, but ran into memory issues with larger datasets, so I decided to try branch-and-bound. My implementation works well ...
The language I'm learning is Scheme and I'm working on an exercise that gives this: (define (p) (p) ) (define (test x y) (if (= x 0) 0 y)) Then the question asks to evaluate the expression: (test 0 (p) ) and to comment on the behavior that would be observe...
In "A Calculus of Mobile Processes, Part 1" [1], Milner et al. give an example for transmitting a pair of values $(u,v)$ from the process $P$ to either $R$ or $Q$ (see page 13). All three processes are assumed to run in parallel. They present following solution: $$ \begin{align} P &= (w) (\bar{x}(w).P' | \bar{w}u.\bar{...
I'm working on an application, in which users can use domination in graphs. I have already finished up with graph generation algorithm, I use lists to store vertices... So, I have found a well developed, gorgeous implementation of the needed algorithm. It is a bit complicated for me, I would like to ask for some descri...
I want to approximate how close is the greedy algorithm to the optimal solution for the Set Cover Problem, which I'm sure most of you are familiar with, but just in case, you can visit the link above. The problem is NP-Hard, and I'm trying to find a bound on how well does the greedy algorithm perform. I know it looks a...
I ran into examples that I not trivially understand on course-of-values recursion, In defining a function by primitive recursion, the value of the next argument $f(n+1)$ depends only on the value of the current argument $f⁢(n)$. Definition of functions by course-of-values recursion, $f⁢(n+1)$ depends on value(s...
I'm trying to determine a function $f(x)$ that is $O(f)$ but not $o(f)$ and also not $\Omega(f)$. Note the $f$ used in the asymptotic notation is not the same as $f(x)$. Originally I thought of $f(x)=\log(x), O(x)$ but I am not convinced that $o(x)$ is invalid for this function. Previously I thought it was, because I c...
Suppose that you do some sequence of operations on a max heap, in this case only Insert and Extract-max. Whenever the heap becomes of size N then what you do is you copy all the elements to a new heap of size 2N. The goal is to come up with a potential function to analyze the amortized cost of Insert and Extract-max. M...
If I have a set of (edit) positive integers, and I'm sure that the pseudo-polynomial time algorithm for partitioning the problem will not give me an answer - what would I do next? To illustrate this problem let's take a look at this example: {100,1,2,3}. The p-p algorithm will give an answer False, and then I can end w...
I wrote a simple TRS that I believe is non-confluent, but I'm not able to find a term with two normal forms for it. The TRS is defined on the signature $\mathcal F=\{f,\ l,\ s,\ o\}$ and the rewrite rules $\mathcal R$ are defined as follows: $l\to s(o)$ $t(x,\ l)\to s(x)$ $t(l,\ x)\to s(x)$. This TRS is clearly finit...
I have to prove the following problem in propositional logic: Let $F$ be a set of clauses and let $F' = F \cup \{res(C_1,C_2,A_i)\}$ be the extension of $F$ by a resolvent of some clauses $C_1,C_2 \in F$ where $A_i$ is a literal occuring positively in $C_1$ and negatively in $C_2$. Prove that: If $F$ is valid, then $F'...
Since there is no algorithm for the post correspondence problem, there exists an instance of this problem such that we can neither prove that the instance is positive nor prove that the instance is negative, i.e. an unprovable instance of this problem. Otherwise, for each instance, a proof that the instance is positive...
I would like to prove that any context free language over a 1 letter alphabet is regular. I understand there is Parikh's theorem but I want to prove this using the work I have done so far: Let $L$ be a context free language. So, $L$ satisfies the pumping lemma. Let $p$ be $L$'s pumping constant. Let $L = L_1 \cup L_2$ ...
I had been first introduced to the idea of declarative syntax when using Angular JS. From what I understand, the idea is that you say, "do this" instead of "in order to do this, do this, this and this". You don't care how it's done, you just want it done, and you pass it off to some lower level of abstraction to do. No...
I am working on a recursive formula associated with discrete mathematics which seems very difficult to compute. The formula is as follows $F_{i,j}(m)=\sum_{t=j}^{m}\left [ x_{ij}.\sum_{k=1}^{m}\sum_{l=j-1}^{m} F_{k,l}(m-ij) \right ]$ It's given that $F_{i,j}(m)=0$ for $m<0$. Here $x_{ij}$ is defined as a random numbe...
Do you immediatly handle an exception when it occurs (for example an overflow exception in the EX stage) or do you wait until the final pipeline stage and then check whether any interrupts had occured?
A bit confused about whether this grammar is ambiguous or not C' -> C C -> d C u C C -> d C C -> ε I tried building the DFA for this but I get this in one of the states: C -> d C DOT u C, $ C -> d C DOT, $ Isn't this a shift-reduce conflict, so surely it means the grammar is not LR(1)? Or does it reduce regardles...
Looking at the Independent Set problem and its complement, I want to show that IS is poly-time reducible to its complement, however I am struggling on coming up with the reduction function. I will define its complement for further clarity, does every subset such that its size is at least $k$ in $V$ contain at least one...
Recently I am learning about solution of the 2-satiability problem using strongly connected components. There is a theorem related to this problem given below: Let $F = Q_lx_1 Q_2x_2\ldots Q_nx_n C$ be a quantified Boolean formula with no free variables, where each $Q_i$ is either universal or existential, and $C$ is i...
Directly from Wikipedia, a set of vertices $X \subseteq V(G)$ of a graph $G$ is independent if and only if its complement $V(G) \setminus X$ is a vertex cover. Does this imply that the complement of the independent set problem is the vertex cover problem?
In my computer organization class I have been given a series of problems. One I'm stuck on currently is below: Assume that $X$ consists of 4 bits, $x_3 x_2 x_1 x_0$, and $Y$ consists of 4 bits, $y_3 y_2 y_1 y_0$. Write logic functions that are true if and only if (a) $X < Y$, where $X$ and $Y$ are thought of as unsign...
Let's say I have a decision problem $D$ and its complement $D'$. I know D is poly-time reducible to $D'$ (its complement). Furthermore, I know $D$ is NP-complete. What is the strongest statement I could possibly make about this kind of relationship?
We ran into a problem that was mentioned in an interview 2 days ago. Can you help us with any idea or hint? A sequence of $n$ people, $\langle\,p_1,p_2,\dotsc p_n\,\rangle$ enter a room. We want to find the index, $i$, of the tallest person in the room. We have one variable for saving that index, which is updated when...
I have these two languages $L_1={\{a^n b^m,n≥m+5,m>0}\}$ Where $∑=(a,b)$ $L_2={\{a^n b^m,n≥m+5,m≤5}\}$ Where $∑=(a,b)$ As you can see that there is only one difference, the condition of m is different. My question is to determine whether these two languages are regular or not, and to prove it. If one or both these lan...
I'm trying to show that $L_6=\{c^n a^m b^p : n+m=p,p \geq 6\}$ is not regular. I need a little help, I was practicing the pumping lemma, and I encountered this language, I saw these conditions and got totally confused, what to do now? Earlier I showed that $L_5=\{a^n b^n : n≥0\}$ is not regular. In this Language it was...
I'm trying to wrap my head around it, but no matter what I read, I still can't fully understand it. I tried to read a little bit about the annealing process in physics, but I have no background whatsoever in physics, let alone in thermodynamics, so I couldn't understand what is it exactly, and how it fits into the algo...
Objective is to create DFA from a regular expression and using "Regular exp>NFA>DFA conversion" is not an option. How should one go about doing that? I asked this question to our professor but he told me that we can use intuition and kindly refused to provide any explanation. So I wanted to ask you. "Regular exp>NFA>DF...
What I want to do I am trying to define a LL(1) grammar of the lambda-calculus. What I did Here is the grammar: $Term \to Abs$ $Term \to App$ $Abs \to \lambda \ id \ . \ Term$ $App \to Var \ AppSeq$ $AppSeq \to App$ $AppSeq \to \epsilon$ $Var \to id$ $Var \to (\ Term \ )$ Here are the FIRST sets: $FIRST(Term) = \{ \...
Why is the sequence 1100101 not acceptable for this DFA? Is it because once it reaches the final state 'q3' it can't go back to 'q1'?
say that you have a 128 bit (32*4) VLIW word. Can each 32 bit sub-word contain any operation (ADD,CALL,BRANCH,...) if there are no hazards or can each sub-word only specify one functional unit (so if the BRANCH functional unit doesn't get used, that sub-word becomes a NOP)?