instruction
stringlengths
35
29.1k
I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I've heard something about stack frames and how they reserve memory for return value and variable return values could make this problematic, but if some...
From http://en.wikipedia.org/wiki/Parse_tree A concrete syntax tree or parse tree or parsing tree[1] or derivation tree is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar. Parse trees are usually constructed according to one of two competing relations,...
As I understand, the generation process of a string in a context free language according to its context free grammar can be represented as a tree. For a formal language which can have a formal grammar, can the generation process of a string also be represented as a tree? What kind of trees can identify context-free gr...
i'm so glad that ask my first question on my favorite site. Infact i ran into multiple choice question in recent exam on Compiler Course. Suppose T1, T2 is created with SLR(1) and LALR(1) for Grammar G. if G be a SLR(1) Grammar which of the following is TRUE? a) just T1 has meaning for G. b) T1 and T2 has not any diff...
Given a collection of non-empty subsets of $\{1,2,\ldots,N\}$ ($N$ not fixed), the problem is to find the smallest non-empty collection of subsets so that the number of distinct elements appearing among the union of subsets is less than or equal to the number of subsets chosen. This seems like an NP-hard problem but I ...
please don't offer an answer about "it's an electronic thing" or something like that, just keep reading. I don't understand why we use a dictionary, a lexicon, with just 2 elements to express the entire digital world. My point is about the fact that information is entropy, things that are predictable or just don't vary...
Lets consider propositional logic. We say a proof system for propositional logic is syntactically (negation) complete if for every $\alpha$, either $\alpha$ or $\neg \alpha$ are provable within the system, i.e., $\Sigma \vdash \alpha$ or $\Sigma \vdash \neg \alpha$. (I assume standard definitions for $\Sigma$ and $\vda...
I have been doing a lot of research into pattern matching algorithms. For some background I am searching a long binary alphabet text consisting of considerably more 0s than 1s. The individual patterns I am searching for are of the form 11111, 1*1*1*1*1, 1**1**1**1**1**1, etc, where * is the Don't Care symbol (so eithe...
I've read in "Introduction to Algorithms" (CLRS) that formal language $L$ is NP-language if and only if there is a polynomial verification algorithm $A(x, y)$ and a constant $c$ such that $$L=\{x\in\{0,1\}\mid \exists y \text{ with } |y| \leq |x|^c\text{ and } A(x, y)=1 \}\,.$$ What is the purpose of the constraint: $|...
I've been coming across a problem in one of my assignments requiring the calculation of the speedup of a two-way superscalar cpu. The problem is as follows: There is a two-way superscalar CPU with 2 pipelines U & V. The instruction pipeline U processes the complex instructions, while the instruction pipeline V processe...
Given inequality $Ax + By \le C$, where $A, B, C$ are integers, $A$ and $B$ are coprime and $C < AB$. I need to find number of non-negative integer solutions of it. Is there exists algorithm which run in polynomial time? For example if $A \le 10^{10}, B \le 10^{10}$ it should work less than a second. Thanks in advance....
I ran into a question about Quick Sort Algorithm. Suppose in Quick Sort, Partition procedure take C times, (need constant time). if we use random data as input, what is the order (time complexity) of Randomized-Quick Sort? any hint or solution highly appreciated.
I am writing a numeric library to exploit GPU massive parallelism and one of the implemented primitives is a matrix class. Naturally I require a determinant and inverse function for this class and I am having trouble finding algorithms which perform well on a massively parallel architecture where there is no shared mem...
I'm at the following exercise in Software Foundations: (** **** Exercise: 2 stars (baz_num_elts) *) (** Consider the following inductive definition: *) Inductive baz : Type := | x : baz -> baz | y : baz -> bool -> baz. (** How _many_ elements does the type [baz] have? (* FILL IN HERE *) [] *) All of the answe...
There are plenty of details about carry lookahead adders such as Kogge-Stone, Lander-Fischer, etc. in college CS courses. They are described as "common in the industry". However, I can't find any evidence (aside from maybe the Manchester carry chain) from recent times that they are actually used anywhere specifically....
I have come across this question: Let 0<α<.5 be some constant (independent of the input array length n). Recall the Partition subroutine employed by the QuickSort algorithm, as explained in lecture. What is the probability that, with a randomly chosen pivot element, the Partition subroutine produces a split in which t...
My question is similar to question here Divide self-intersecting polygon I have points of self-intersecting polygon, its edges and also I am able to find points where it intersects. I have to divide it into simple polygons and tessellate them later. I have an issue how we currently select the edge after the intersecti...
I am creating an event notification system. Each event has a user and a subject, such that, 'user did event to the subject'. Now while presenting these the events need to be grouped. All the events in the same group must either refer to the same user or the same subject and each event must be in exactly one group. Su...
Here's an old puzzle: Let $s$ be a string of decimal digits ($s[i] \in \{0,\dotsc, 9\}$). Define a function $f(s)$ as follows: Interpret $s$ as a decimal number, $n_{10}$, and convert $n$ to its octal equivalent, $m_8$. Now treat $m$ as a decimal number, $m_{10}$ and convert it to its hexadecimal equivalent, $h_{16}$,...
Given a biased $N$-sided die, how can a random number in the range $[1,N]$ be generated uniformly? The probability distribution of the die faces is not known, all that is known is that each face has a nonzero probability and that the probability distribution is the same on all throws (in particular, the throws are inde...
Let $A$ be a regular language, let $A'=\{xz\}$ such that for some $y,|x|=|y|=|z|$ and $xyz\in A$. Show that $A'$ is not necessarily regular language. This is an excercise of Sipser, I've no idea how to construct $A,A'$ please help someone
$L = \{P : P(n)$ outputs $n^2$ for all $n \in N \}$ In questions of this nature, are we supposed to assume that "outputs" means "halts and outputs"? In modern programming languages, I can certainly "output" using a print statement and then have the program go into a loop after that.
I searched this over Google few times but ended up with articles on transparency rather than an answer. With relation to distributed database study(or distributed OS), what is the concept of transparency? I mean in replication, fragmentation and everywhere I guess the idea is to implement these concepts but not to both...
Is it correct to say that there are languages that a NFA with epsilon recognizes but a PDA is not? I think that it is wrong but I cannot find a suitable explanation.
How can I prepare for an introductory CS college course? I am currently in Grade 12 and next year I will be studying Computer Science at a university in South Africa (syllabus is here). However CS has a very high dropout rate here in South Africa, more than any other course, and I'm nervous because of that. My experien...
I have a family of acyclic networks in which every path from the source of a given network to its target has length exactly $3$. I'm aware of a publication that in general, finding a max flow in a DAG is no simpler than finding one in a cyclic network, but unfortunately the only places I could find it put a paywall the...
We define a Pythagorean triple as a triple $\langle a,b,c\rangle$ such that $a,b,c\in \mathbb N$ and $a^2+b^2=c^2$. In order to avoid duplicates, we say that a triple $\langle a,b,c\rangle$ is legit iff $b>a$. Let $\mathcal P$ be the set of all legit Pythagorean triples. We define a lexicographic order $\prec$ on $\ma...
I have thousands of wireless LTE hotspots. Each month I need to assign each hotspot a rate plan. Each hotspot uses some amount of data in a month (represented in megabytes). Each rate plan has some amount of data that is included (i.e. 1000 mb). Hotspots that share the same rate plan can "pool" their data allowances...
I was trying to prove the next exercise 1 It's not look so hard, but with some tries, I couldn't find out a way to show it, I was supposed wrong assumptions. To convince myself if that relation really happened, I use Mathematica to plot some a range. Do you have some ideas? 1 Ian Parberry and William Gasarch. Proble...
Let $U =\{\frac{1}{n}: n\in \mathbb{N}\} \cup \{-\frac{1}{n}: n\in \mathbb{N}\}$ be the set of positive or negative unit fractions. Given positive integers $m<n \in\mathbb{N}$, how do you find $u_1, u_2 \in U$ such that $|\frac{m}{n} - (u_1+u_2)|$ becomes minimal? A weaker problem would be the following: Given positive...
I was given two languages $$L_1=\{0^k1^k0^m\mid k,m \in \mathbb{N}\text{ and }k < m\}$$ and $$L_2=\{a^mb^{m+1}\}$$ and I was asked to prove whether they are context free or sensitive. For $L_1$ : I did pumping lemma and I cannot clearly rule out the context free. So I accepted that it is and tried to do a high level ...
I'm having a hard time viewing Turing's solution to the Halting Problem as a logician, rather than as an engineer. Here is my understanding of the Halting Problem: Let $M$ be the set of all Turing Machines. Let $i$ be the set of all inputs for all the Turing Machines in $M$. Let every element in $M$ be an elemen...
$DoesNotHaltOn\_w=\{(M, w) : M$ does not halt on input w$\}$ $AlwaysHalt =\{ M : M$ halts on all inputs x $\}$ Hopcroft gives the following proof that $AlwaysHalt$ is not R.E. 1) Given an input x of length n, $M'$ simulates $M$ on w for n steps. 2) If during that time $M$ halts then $M'$ loops and $M'$ does not ha...
Given an undirected graph $G=(V,E)$, two distinct vertices $s,t\in V$, a weight function $f:E \to \mathbb{N}$, and a constant $M\in \mathbb{N}$, does there exist a pair of edge disjoint paths connecting $s$ and $t$, each of which has weight at most $M$? In other words, we are given an upper bound on the path weights, ...
Am I correct in saying that traverse(node): if node is null, return print node traverse(node's right subtree) traverse(node's left subtree) would produce output that is the reverse of post-order traversal? post-order(node): if node is null, return post-order(node's left subtree) post-order(...
I would greatly appreciate your advice on following machine learning problem: I need to train a classifier to learn a device's behavior. The device itself can be observed under different operating/input conditions through a set of sensors. A sensor yields time series data and we call all observations during an interval...
I am trying to think of an efficient way to synchronize a tree's nodes with the following rules. Consider for instance this tree: so the top of the heap is always B which can have many leaf-type nodes called G, or children which are node themselves called S, which can have leaves as well (G) it is possible in the futu...
I read one old-midterm exam on Automata. consider: the language that accepted by above pushdown automata is not generated by which of the following grammar? 1) S->aBaa|a$\epsilon$ aB->aS|$\epsilon$ 2) S->aaB aB->aaaB|$\epsilon$ 3) S->aaB|a aB->aaB|$\epsilon$ 4) S->aB B->aaB|$\epsilon$ i think (3) is true, bu...
A certain system consists of 2 CPUs. The CPU that is not being used is assigned to a task whose execution is requested. On this system, two tasks, A and B, are executed.These tasks both use a common resource R exclusively.The CPU usage of the tasks A and B, the usage of resource R and the execution sequence are shown i...
Assume you have a finite language $L$ succinctly represented as a acyclic DFA $M$ (models can't be much simpler than that :) ). How can we efficiently sample a word from $L$ with uniform distribution? Note that counting the number of words in $L$ is easily doable in linear time in the size of $M$, which might be usef...
I am studying computer architecture. I would like to know the difference between the terms "computer architecture" and "microarchitecture".
Is there a program that will tell you the optimal algorithm for ANY problem if the problem is decidable? If not, why not? If yes, how can such a program be realistically constructed? I would prefer an intuitive explanation over a formal one, thanks.
Hello and apologies if my question will be too elementary. My background is from arithmetic geometry, but I have been recently faced with certain computational problems of combinatorial nature, where I feel way out of my league, so I will definitely appreciate some clarity on the matter :) Long story short, I am faced ...
During thinking on one problem, I realised that I need to create an efficient algorithm solving the following task: The problem: we are given a two-dimensional square box of side $n$ whose sides are parallel to the axes. We can look into it through the top. However, there are also $m$ horizontal segments. Each segment ...
To try to test whether an algorithm for some problem is correct, the usual starting point is to try running the algorithm by hand on a number of simple test cases -- try it on a few example problem instances, including a few simple "corner cases". This is a great heuristic: it's a great way to quickly weed out many in...
Is the problem of determining whether or not a given Boolean expression is satisfiable computationally distinct from actually finding a solution to the expression? In other words, is there another way of finding that a given expression is satisfiable without explicitly determining the 'right settings' for the Boolean v...
Assuming l1 and l2 cache requests result in a miss, does the processor stall until main memory has been accessed? I heard about the idea of switching to another thread, if so what is used to wake up the stalled thread?
I have an alternative algorithm for the problem of finding a convex hull for a collection of points. It is somewhat similar but not the exact of Graham scan. Find a point that is guaranteed to be inside the convex hull, this can be done by finding the line connecting the left most and right most points. And then pick ...
One of the most used simple examples of application of Communication Complexity is the $\Omega(n^2)$ lower bound for recognizing palindromes of length $2n$ on a single tape Turing machine. Is there a similarly simple example that proves a lower bound of $\Omega(n^3)$ for another problem that can be decided in time $O...
I'm working on a problem and would like to do some research on similar problems to help refine my approach. Can anyone help me identify what kind of problem this is or, at least, what kind of problems it relates to? The basic model is a set of different job types, handled by a set of machines. There is also a dispatc...
Writing a survey, I am confronted to a very difficult and -- I dare say -- deep issue: I have many sentences mentioning or stating results of the form "a $\Omega(\sqrt{n})$ lower bound", or "a $O(\sqrt{n}/\varepsilon^2)$ algorithm". And I am struggling to decide whether I should use "a" or "an" in front of these: is th...
Supposing I have some algorithm that is able to provide me with a confidence value for some event occurring. Let's say on day 1 it tells me that there is a 80% chance it will rain, on day 2 it tells me there is a 20% chance that the mail will be late, and on day 3 it tells me that there's a 90% chance my milk will go o...
For a complete graph, the size of minimum vertex cover is $n-1$. I was wondering whether there exist an upper bound (or an expected value or upper bound) for the size of minimum vertex cover for scale-free graphs, i.e. such whose degree distribution follows a power law. I searched and didn't find anything, is anybody a...
I'm studying binomial heaps. A book tells me that insertion of a node to a binomial heap take $\Theta(\log n)$ time. So given an array of $n$ elements it would take $\Theta(n \log n)$ time to convert it to a binomial heap. Does anyone know a method that can convert an array of numbers to a binomial heap in $\Theta(n)$...
In "Conceptual Wavelets" (2009) by D. Lee Fugal, on pg 47 he writes Conv ([-1, 1], [1, 1]) = [-1, 2,-1] When I do it I get 0 -1 1 0 1 1 > -1 1. 1. > 0 1 1. > 1 So I get [-1, 0, 1]. What am I not understanding? The definitio...
This is a homework. It looks easy, but not really. A list of integers $a_n$, for every $i<j$, if $a_i>2a_j$, then it is an inversion. Count the inversions in the list, and return the count and the ordered list. Note, here the order is defined by the condition, not just sort the integers. The easiest way is double loop,...
The k-means algorithm is known to be NP-hard. While the distance function computation in the algorithm loop is data parallel, the algorithm is iterative and may become exponential in the number of iterations. Is there a way to parallelize in practice k-means so as to alleviate (even in a small way) the hardness of k-me...
I'm just starting to learn about NP-completeness. While I understand that reducibility plays a key role in this, I'm astonished how few problems I've been able to find who's proof that they are NP-Complete is not based on reduction to an existing NP-Complete problem. While I understand these proofs are perfectly valid,...
I am doing some reading (and implementation) of some Clustering Algorithms. First I started with the well known K-Mean algorithm and implemented it directly from a paper. Got a kind of decent understanding of what I going on there. What I am actually interested in is Particle Swarm Optimisation based clustering. For Pa...
Take the following array of integers: [60, 45, 30, 45, 45, 5, 60, 45, 30, 30, 45, 60, 60, 45, 30, 30, 60, 30, 30] They need to be sorted into pairs of sub-arrays. The first sub-array in each pair must total at most 180, and the second must total at most 240. How would you find the right combinations of elements so that...
I'm not sure if this is the right site to ask, but I couldn't find a another one. Some time ago I found out about the join calculus. It is based on constructs called joins to support concurrency. For example: (pseudocode) int get() & void set(x) { return x to get } void main() { set(1) & set(2) & print(get...
We have a set of 24 distinct arrays, each array has 36 elements and each element can have one of 13 possible values. Then we're given an array X (this array is certainly part of our set) and we have to find to which array of our set it corresponds to. Of course, we can check all 36 elements of X against each of 36 elem...
I'm asked to design an RMQ data structure (Range Minimum Query: return index of $min$ in a range $[i,j]$) for an array that has $<=\log(n)$ local minimums (a local minimum is an index $i$ such that $A[i-1]>A[i]<A[i+1]$). There are 2 restrictions: Only $O(\sqrt{n})$ additional space (rather than $O(n)$ which is used fo...
I'd like to enumerate all undirected graphs of size $n$, but I only need one instance of each isomorphism class. In other words, I want to enumerate all non-isomorphic (undirected) graphs on $n$ vertices. How can I do this? More precisely, I want an algorithm that will generate a sequence of undirected graphs $G_1,G_...
If $r$ is a machine-representable number and $f(r)$ is the next larger machine representable number, are the following true or false? In fixed-point arithmetic, the distance between $r$ and $f(r)$ is constant. In floating-point arithmetic, the relative distance $|(f(r)-r)/r|$ is constant. I believe that (1) is true, ...
A path is simple if no vertices are repeated. How many simple paths exist between two vertices in a complete graph? One way is listing all simple paths using depth-first search. but I think it should be more simple to find the number of all simple paths between 2 nodes in a complete graph. Here is the same problem but ...
I'm struggling to understand some concepts related to the relationship between language and computability theories. Can we convert decision problems to the corresponding grammars describing the languages? Can every decidable decision problem be converted to a context-free or context-sensitive grammars? If it does not m...
Let $\Sigma=\{a,b,c\}$. Describe an algorithm that takes as input a deterministic finite automaton $M= (Q,\Sigma,\tau,s,A)$ and determines whether or not $M$ accepts a word containing $bb$ (i.e., a word of the form $\alpha bb \gamma$ for some $\alpha,\gamma \in\Sigma^*$). You do not have to give a formal proof that you...
A student recently asked me to check an NP-hardness proof for them. They performed a reduction along the lines of: I reduce this problem $P'$ that is known to be NP-complete to my problem $P$ (with a poly-time many-one reduction), so $P$ is NP-hard. My answer was basically: Since $P$ has instances with values from $...
I am confused between these two terminologies: recursively enumerable language, recursively enumerable set. Do they have the exactly same meaning?
I'm trying to prove that c2n = o((loglog n)n) (That's little-o) for any constant c. I understand that we can prove one function grows at a smaller rate than the other by taking the limit as n approaches infinity, and I can very easily pick some arbitrary integer value for c and show that indeed ((loglog n)n) grows at a...
Problem: You are required to sort an array with numbers from 1 to n. You can do a "move", which means choosing one element and moving it to any place you want (insert to any place, not swap). Prove the minimum number of "moves" to sort the array is n - k, where k = the length of the longest increasing subsequence. Ex: ...
I've read that some current CPUs (e.g. Intel i7 and ARM A9) have (L1) cache latencies of multiple clock cycles while also being pipelined. Some devote multiple pipeline stages to instruction fetching. How is the L1 cache implemented to support pipelining? Is it, say, $k$ actual stages for decoding the address or does ...
I'm currently preparing for an exam and recently came across the following exercise and would like to know whether my solution would be correct. Exercise: Prove that the following axiom is not correct in the Hoare Calculus: {true} u:= t {u=t} My Proof via Reductio ad absurdum: Assumption: Axiom is valid Hoare Calculus...
I have a basic question about the power of Linear Programming that has been bothering me for some time. I believe there is something simple I am missing. Linear Programming is $\mathsf{P}$-complete, which means that every problem in $\mathsf{P}$ can be reduced to it using an $\mathsf{NC}$ reduction. (See the wiki for...
Question: "Certain properties of a programming language may require that the only way to get the code written in it be executed is by interpretation. In other words, compilation to a native machine code of a traditional CPU is not possible. What are these properties?" Compilers: Principles and Practice by Parag H. Dave...
It's possible to determine whether a deterministic machine with finite memory will halt in O(n) time if the machine has n possible states. You simply run the machine until it halts or visits the same state twice, which is guaranteed to happen in no more than n steps. Can any other algorithm do this in fewer steps? Is t...
I am trying to learn(self-study, not homework) how to perform transitive reduction according to what what Prof. Leskovec explains in section 10.8.6 in Mining Massive Datasets. The book is free to access online. The section is actually talking about a way to perform transitive closure for a graph randomly choosing a nod...
We have a weighted tree of $n\leq 10^5$ nodes, and for every node $v$, value $L(v)$. The goal is to calculate, for every vertex $v$, number of vertices $u$ such that $\mathrm{dist}(v,u)\leq L(v)$. This is a task from a programming contest. Judging by the limit on $n$, and also specifics of time limits on this contest, ...
At the beginning we have a directed unweighted graph of $n \leq 10^3$ vertices, and $m \leq 10^5$ edges, with some vertex being a source, and we perform updates and queries on it. An update is adding some edge between two vertices $u$ and $v$. A query is asking, for some vertex $v$, what is $\mathrm{dist}(\mathrm{sourc...
I thought this question is better served in the CS part of Stack Exchange. Now that we have GPGPUs with languages like CUDA and OpenCL, do the multimedia SIMD extensions (SSE/AVX/NEON) still serve a purpose? I read an article recently about how SSE instructions could be used to accelerate sorting networks. I thought th...
In Bitcoin, when one node wants to tell another node about a block, it sends the block header, then all the transactions it contains. This is inefficient, because the receiving node might already have some or all of those transactions. The sending node needs to tell the receiving node the transactions that the receiv...
Consider a base 2 computer that stores floating point numbers using a 6 bit normalized mantissa (x.xxxxx), a 4 digit exponent and a sign for each. a) For this machine, what is machine epsilon? b) What is the smallest positive number that can be represented exactly in this machine? c) What mantissa and exponent are stor...
could you help me in clarifying a doubt regarding how to find square of a graph g from graph g.the doubt occurs on 15th page of the document which I have shown you by the link given.the doubt is that I could see all edges and vertices were correct for square of the graph.But I couldn't see an vertex for sugar,sugar and...
I initially considered this problem trivial, but then looked with more attention, I could not find an easy solution. Let's say we have two ordered lists of symbols (strings): A = "foobarquuz123" B = "foobar456quuz" my goal is to have a way to merge the two incomplete lists into the following, completed with parts from...
Describe (in English phrases) the languages associated with the following regular expression. it says to be as simple as possible #1 (x (yyy + x)*)* #2 (c (cc)*d(dd)*)* for number 1 I got all words in which when y is in the word it can only appear in blocks that are divisible by 3(0,3,6,9, etc.) the second question I ...
The k-means algorithm reduces to computing the objective function: $ \underset{\textbf{S}}{\operatorname{argmax}} \sum_{i=1}^k \sum_{\textbf{x}_j\in\textbf{S}_i} \lVert \textbf{x}_j - \mathbf{\mu}_i \rVert $ for some observations $\textbf{x}_1,\ldots\textbf{x}_n$ to be partitioned into sets $\textbf{S}_i$. How can thi...
Can you always decide if a specific Turing machine accepts a specific string? I started thinking about this after reading an answer to this question, Rice's theorem vs Turing completeness, which seams to you can. If this is true, intuitively, it seams it would be implied that HALT could be decided, which is obviously ...
One way to interpret the (simply typed) lambda calculus is via coherence spaces (Proofs and Types, chapter 8). For example, we can consider the space containing token element ($\mathbf{1}$) and the space containing two incoherent tokens ($\mathbf{Bool}$). These are given as follows: $$ \mathbf{1} = \{\emptyset, \{0...
I was reading dynamic programming chapter from famous book Introduction To Algorithm In rod cutting problem it gives simple algorithm as follows: cutRod(p,n) { if (n == 0) { return 0 } q = -∞ for (i=1 to n) { q = max(q,p[i]+cutRod(p,n-i)) } ...
My question is the following: If we have a problem divided into two versions, weighted and unweighted. Can we prove that the unweighted problem is NP-hard from the fact that the weighted problem is NP-hard ? For example let say I have the knapsack problem (the weighted version): $$\max \sum_{i}^n w_i x_i$$ $$\text{s.t....
How is video playback done on a computer? It's obviously not relying purely on the CPU, since video playback continues when a user performs another activity, such as typing into a YouTube comment field. This task seems further complicated in the case of streaming video, where data presumably needs to be transferred f...
In Recent Contributions to The Mathematical Theory of Communication (Weaver 1949), aka The Mathematics of Communication (Weaver 1949) (various copies exist online), and also published as Part I of The Mathematical Theory of Communication (Shannon and Weaver 1949), Weaver says: We are now in a position to state the fun...
Background: The pool ball weighing problem is a classic CS question thrown at students, typically to demonstrate a binary search (alternative to ripping phonebooks in half). Pool Ball Problem: Given $n$ pool balls where exactly 1 weighs more than the rest, find that pool ball using a scale. The common approach is to sp...
Describe (in English phrases) the languages associated with the following regular expression. it says to be as simple as possible #1 (x (yyy + x)*)* #2 (c (cc)*d(dd)*)* for number 1 I got all words in which when y is in the word it can only appear in blocks that are divisible by 3(0,3,6,9, etc.) the second question I...
Is there any way to combine multiple Hidden Markov Models trained from different sets of data? For example, I want to detect the phases of a sequential activity. I collect two sets of data by using two types of sensors: accelerometer, and video stream. I create two HMM models from the accelerometer and video stream, re...
So sometimes in combinatorics, you are computing the count $a_n$ of something that depends on a natural number parameter $n$. Either by hand or using a computer, you can often compute some initial terms in the sequence $(a_n)_n$. Now, you can enter those initial terms into the Online Encyclopedia of Integer Sequences, ...
Some of the MIPS processors like 5kc, 5kf have "limited dual issue". Searching online it seems that this means that the processor allows for a dual issue in only some selected cases, but it is not clear which ones these precisely are. Can someone elaborate on what "limited dual issue" exactly means ? Further, came acro...
could you please help me for finding an unambiguous CFG for the following expression: $a^ib^j$ where $i \le j \le 2i$
I was reading about the busy beaver problem the other day and I'm confused as to why we can't keep an array of Turing machine states that the machine has been through and simply iterate through it at each new machine state to see if it exactly matches a state we've previously seen. That ought to tell us there's an infi...