instruction
stringlengths
35
29.1k
In this example: Assume a system’s memory has 128M words. Blocks are 64 words in length and the cache consists of 32K blocks. Show the format for a main memory address assuming a 2-way set associative cache mapping scheme. Be sure to include the fields as well as their sizes. The following is supposed to be the solut...
i have problem with resolution in first order logic i have : C1 : ¬ Loves(x,F(x) ) or Loves ( G(x) , x ) and C2 : ¬ Animal ( X) or Loves ( jack , x ) can some one help me why the answer ( after Resolve C1,C2 ) is : ¬ Animal(F(jack) ) or Loves ( G(jack) , jack ) because my answer is : x/ jack then i will hav...
There is a theorem which says that: Given a finite state automaton having $n$ states, if there exists a string $w$ whose length satisfies $n \leq |w| \leq 2n-1$ then the language accepted by the automaton is infinite. I understand the constraint $|w| \geq n$, but I don't understand why the constraint $|w| \leq 2n-1$ ...
I would like to train a RNN with LSTM cells in Tensorflow to predict the next word of a sequence. Words are N-length vectors of 0s and 1s. By looking at different tutorials, I saw that the input tensor has a shape like this seq_input = tf.placeholder(tf.float32, [n_steps, batch_size, seq_width]) However, it is not cle...
Given a finite alphabet $\Sigma$ with more than one symbol, is $L = \{u u^R u : u \in \Sigma^*\}$ context-free? ($u^R$ is the reverse word of $u$) I tried to show it wasn't context-free by using the pumping lemma but I'm out of ideas.
I am currently working on a project that involves taking a single color frame, performing image segmentation and then visualization of the scene. I am currently at the stage of performing alignment between two objects - one in my database and one segmented from picture. Picture data is processed: for each pixel in the...
Is it possible to derive a grammar with iself? Or more precisely, is it possible to conceive a grammar which language contains that grammar? For example, the Wikipedia article about BNF claims to represent the BNF syntax with BNF. But if we tried to derive BNF with it, we'd obtain the same BNF, but with each character ...
I am taking a computer theory class and one of the exercises is to prove that the property "doesn't halt for some input" is not semidecidable. This property is the negation of the property "halts for all inputs". I know that the halting problem is undecidable, but i need some kind of contradition to prove that the neg...
I'm trying to learn about declarative programming, and while reading the wiki it said the following: In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow....
I am looking for some help with understanding the extended Euclidean Algorithm, specifically, this implementation (in Haskell): eGCD :: Integer -> Integer -> (Integer,Integer,Integer) eGCD 0 b = (b, 0, 1) eGCD a b = let (g, s, t) = eGCD (b `mod` a) a in (g, t - (b `div` a) * s, s) I understand the Wikipedia...
In languages like C, the programmer is expected to insert calls to free. Why doesn't the compiler do this automatically? Humans do it in a reasonable amount of time(ignoring bugs), so it is not impossible. EDIT: For future reference, here is another discussion that has an interesting example.
I'm using the following definition of $NP$: $$A \in NP \Longleftrightarrow A(x) = \exists w: B(x,w) $$ where $B \in P$ and $|w| = poly(|x|)$. Now instead of the problem whether the program $\Pi$ halts on input $x$, I'll use the close cousin that asks whether $\Pi$ halts on $0$. Then I can write: $$HaltsOnZero(\Pi) = ...
This is a homework problem and I'm not sure if I am doing it correctly. Show that $\log(n^2+1)\in \Theta(\log n)$. I got: $$ \log (n^2) \leq \log(n^2+1) \leq \log (n^2+n^2) $$ $$ 2\log n \leq \log(n^2+1) \leq \log(2\cdot n^2) $$ $$ 2\log n \leq \log (n^2+1) \leq \log 2 + \log(n^2)$$ $$ 2\log n \leq \log(n^2+1) \leq 1...
A question on SO about complexity of sorting vectors of vectors got me thinking about the complexity of comparing 2 vectors. Let's consider vectors of average size 1) N. The first formula we get for the comparison of 2 vectors is O(N), but my intuition says it could be lower. Worst case scenario is N comparisons (vecto...
This question is a kinda spin off from Why do we not combine random number generators? If for example we had N identical type random number generators, with N different seeds, what would the period be if their outputs were xored together? Would it be period, N x period or period (power N)? So a numerical example would...
Consider the TSP problem. Let $F_n=\{\text{all cyclic permutations $\pi$ on $n$ objects} \}$. Define the neighborhood 2-change of TSP as $$N_2^n(f)=\{g: g\in F_n \text{ and $g$ can be obtained from $f$ as follows:}\\ \quad\quad\quad\quad\quad\quad\quad\;\;\;\; \text{remove two edges from the tour; then}\\ \quad­\quad\...
let's say L is a regular language,what term does L should uphold so that there is an NFA without epsilon moves,in which for every accepting state δ(q,σ)=Ø?I can think of some terms like that the last letters can't hold a power,but I was wandering if there is a formal definition?
If P1<=P2 means P1 is reducible to p2,then which is true? 1 If P1 is RE But Not REC,P2 is also RE but not REC? 2.If P2 is RE But Not REC,P1 is also RE but not REC? As per my knowledge,if P1 is undecidable then P2 is also undecidable,so if I consider this property,then as RE BUT NOT REC is also undecidable,then answer w...
I am having some confusion in understanding RICE's theorem. It says every non trivial property of RE in undecidable. I need to understand when to apply RICE's theorem and when to not. Questions like:- Turing machine makes at least five moves,It accepts a string input of length atleast five ,TM halts for every input on...
Is there any difference between word size and size of internal register of CPU ,since "Word size" refers to the number of bits processed by a computer's CPU in one go ,so does this imply that word size is architecture dependent and ALU register's size is same as word size ?
The hosts are assigned IP address by the router using dhcp. So, the router has a list (mac addresses) of all the hosts that are directly connected to it as well their ip addresses. Now if a packet comes from outside, the router must be able to find the destination mac address from its logs. Then what is the need to use...
I am trying to understand cascade classifiers for computer vision. I use OpenCV Traincascade for now and successfully trained some cascades. However I am trying to grasp the whole process. One thing I do not understand about the cascade training is how the features are selected on each stage. How does an image classifi...
Pervasive Sensing focuses on sensors and Pervasive Computing talks about using sensors for example. Are they both the same thing but different names?
I'm one year through both an undergraduate CS and undergraduate math degree, currently studying Big-O analysis, and am trying to develop a "mental checklist" as it were, or a kind of procedural algorithm, for performing Big-O analysis of mathematical functions. In this post, I'm merely asking some kind soul to point ou...
i have trouble with understand this type of questions , i know how i can determine if the sentences is valid or unsatisfiable in Propositional logic , but in FOL i can't for example , i have the following sentences in FOL : 1 = 2 the professor said this is neither valid nor unsatisfiable but , i think it is alway...
According to my understanding, the Bellman–Ford algorithm can handle cyclic graphs with negative weights. but it cannot have negative cycles. But can it handle zero weight cycles?
Our task is to compute the minimum hamming distance for the following 16-bit words: 0000000000000000 0011001100110011 0101010101010101 0000111111110000 0011111111000000 1100110000000000 1111111111111111 This minimum distance is defined as the minimum of all distances between every combination of two of these bitst...
I don't understand some things in Store and Forward equation: D -> Number of channels and switches pairs. tr -> Routing time. tw -> Transfer time in a channel. What is the L/W? And normally exercises provide me tw (time transfer in a link), but now I am doing an exercise in which tw is not provided. I think I shou...
From page 26 of Lambda-Calculus and Combinators: Definition 2.18 (Abstraction) For every CL-term $M$ and every variable $x$, a CL-term called $[x].M$ is defined by induction on $M$, thus: (a) $[x].M \equiv \mathbf{K}M$ if $x \notin FV(M)$; (b) $[x].x \equiv \mathbf{I}$; (c) $[x]Ux \equiv U$ if $x \notin FV(U)$ (f) $...
Unsupervised feature discovery of text that started with its bit string representation would need to discover octets were the first-order parse of such a bit string. This raises a question: What is the technique called that can discover that a binary string, for example: 01001001111100101010101010111110110010001110001...
Consider the example where $n = 4$, bit 0 is fixed at 1, and bit 2 is fixed at 0. I would like to generate all $n$-bit numbers with those bits fixed. Essentially, everything I generate would have the form: $$1*0*$$ where $*$ represents a bit that can vary. The fixed bits can be in arbitrary positions, and there can be ...
an access sequence of cache block address of length N and contaons n unique addresses. The no. of unique block address between 2 consecutive accesses to the same block address is bound above by k. What is miss ratio if access sequence is passed through a cache of associativity A >= k exercising LRU replacement policy? ...
I understand how the instructions are kept in relocatable format in RAM. It is done so by keeping a base register and a limit register. Physical address = base register value + logical address. And logical address = the logical distance from the starting location of process's address space, just like an array. But what...
The are cuisenaire rods with N differnt lengthes $x_1,x_2,...,x_n$ (each length is a natural number), the number of the Cuisenaire rods is unlimited. Given a natural number B. you should tell if you can pick a bunch of Cuisenaire rods with exactly the length of B. for example: if the cuisenaire rods are $3,11,19$ and ...
I've read so many about the Coin Change problem, debates about wheather it is solvable using Greedy, Dynamic Programming and so on. Nevertheless I cannot find an application of this problem. What are applications of Coin Change problem?
I asked this question here on stackoverflow, but maybe because of off-topic over there, it didn't received proper response. Does user level threads take advantage of multiprocessing ? I read one such answer here. But, it's not clear though. https://stackoverflow.com/questions/25582876/what-does-it-mean-by-user-threads...
In machine learning literature, when handling words or text inputs, the strings are often mapped onto a vector space using techniques such as word2vec. The terminology in this is that the individual word vectors are 'embeddings' and the embeddings together are a distributed representation of the input words (see refere...
So I know the Next Fit Bin Packing algorithm is bounded by two times the optimal solution for the problem, but I can not think of an order of arriving elements that actually takes twice the number of bins necessary. Something like: 50 -> 25 -> 50 -> 25 -> 50 -> 25 -> 50 -> 25 would result in: |25| |25| |25| |25| |50| ...
I am using the technique of this paper: https://arxiv.org/pdf/1604.07953.pdf to localize food objects. The difference is that I am using the next generation of google-net, inception-v3 network. For the localization problem, in the paper they modify the network cutting the last 2 inception modules to receive 14x14 grid ...
I want to prove that the language $L = \{ a^{n}(ab)^{{n}^{2}}b^{n} \mid n \geq 0 \}$ is not context-free by using Parikh's theorem. My first assumption is that the $(ab)^{{n}^{2}}$ part cannot be written as a subset of linear vectors. From this it follows that $\psi(L)$ is not semi-linear. My problem is to show that b...
From page 15 of Lambda Calculus and Combinators an Introduction: Note 1.34 If $M \equiv aM_1 \ldots M_n$ where $a$ is an atom, and $M \triangleright_\beta N$, then $N$ must have form $$ N \equiv a N_1 \ldots N_n $$ where $M_i \triangleright_\beta N_i$ for $i = 1, \ldots, n$. To see this, note that $M$ is really $$ (...
$M$ is some Turing machine, $\left<M\right>$ is the code of the Turing machine. $L =\{\left<T\right> | L(T) \ne \emptyset\}$ How to see intuitively that $L$ is partially decidable? We can try running a given $M$ on all strings and accept if $M$ accepts. However, what if the simulated $M$ gets into an infinite loop?
So I am working on solving a problem on whether following language is decideable: $L = \{n \in \mathbb{N} \mid M_n$ never freezes (for any input)$\}$, where $n$ is the Gödel-number of a Turing machine. The model for Turing machines that we use operates on a one-side-unbounded tape, so "freezing" in this context means...
In both the lambda calculus ($\lambda$-calculus) and Combinatory Logic (CL), we have the notion of function application. For example: \begin{array} & \left( \lambda x . x \right) y = y & \text{(function application) } \\ ([ x ] . x) y = y & \text{(function application) } \\ \end{array} Fair enough. But, in each of the...
Does the size of an algorithm restrict how many bitstrings it can compress, and how much it can compress the bitstrings? Some definitions and an example to illustrate this is the case. An elite program is the shortest program that outputs a particular bitstring. Elite programs are generally incomputable (Kolmogorov co...
In general, the size of the DFA resulting from the union of two DFAs A and B is O(|A|.|B|) in the worst case (usually the product construction is used to compute the union). Let's consider the class of 'synchronized DFAs' as the class of DFAs having a synchronizing word : https://en.wikipedia.org/wiki/Synchronizing_wor...
I'm getting into algorithms and I came upon range trees. What confuses me is the leaves in a range tree, since for example: When you remove the leaves: It's just a regular BST. And, every implementation I see of a range tree/range searching, for example, doesn't put the points in the leaves like in the first image. ...
POINTS_TABLE = [3, 5, 7, 1] function score(answer) { result = 0 for i in 0..4 result += POINTS_TABLE[answer[i]] return result } answer = [1, 2, 1, 0] s = score(answer) The sum performed is 5 + 7 + 5 + 3 = 20. It uses the values from the input as the indexes to read from the POINTS_TABLE. This is the style...
I have been reading the paper of F. Cohen about viruses, here is the link: https://web.eecs.umich.edu/~aprakash/eecs588/handouts/cohen-viruses.html I quite not get the following part: Detection of Viruses In order to determine that a given program 'P' is a virus, it must be determined that P infects other progra...
I am to find the time complexity of my algorithm and I found one method here. However I am really not sure about it correctness thus I would like to check it. There is my algorithm (N is a set (len(N) is constant) and C is a number): def f(N, C, k = 0): if C < 0: return 0 if C == 0: return 1 ...
In The Algorithm Design Manual section 5.9.2, covering graphs and articulation vertices, Steven Skiena writes Let reachable_ancestor[v] denote the earliest reachable ancestor of vertex v, meaning the oldest ancestor of v that we can reach by a combination of tree edges and back edges. This phrasing is ambiguous. ...
It seems to me that one way computer science could be divided up, is into three domains: What is efficient for humans to represent and comprehend What is efficient for computers to represent and process An idealized form of how computation/problems are defined that is extremely succinct, specific, and not tied to hum...
I am studying pure type systems, particularly the calculus of constructions, and trying to use an encoding for recursive types on it, which, according to Philip Wadler, is possible. As an example, I'm using the Morte Haskell library to encode Scott numerals as given by Cardelli. A summary of the encoding is as such: gi...
Find a CFG for the following language: $$L = \{a^i b^j a^n b^m \mid i + j = n + m\}$$ I'm not sure how I can do that context free. I know that I have to borrow one char from the left group for each char from the right group. but not sure how.
I found a code in the internet for Dijkstra's shortest path algorithm in PHP. The problem is it only shows one possible path. If there are several paths having the same distance, it only outputs one of them. How can I modify this algorithm to produce all shortest paths? //set the distance array $_distArr = array(); ...
I need to Find grammar for the following language: $\{ a^{m_1}ba^{m_2}b\dots a^{m_k}bca^n \mid m_j = n \text{ for some } 1 \le j \le k \}$. can someone help me to solve it? I am not sure how to start.
I have to do a project where I write a greedy algorithm to maximize a company's sales. There are 6 shelves, each with 8m length. I have to position 100 items whose length, value and max sales possibility I know on those shelves. My problem is, according to my instructions the max sales possibility changes according to ...
Given a row of length N, and a set of 1D bars having lengths A[1...M], how many ways I can fill the row? A is an integer array, the bars are having dimensions $\{1\times A_1,1\times A_1,1\times A_1,..., 1\times A_M \}$ The row can also be considered as $1\times N$ grid. 2 Bars with equal length has to be considered...
Assume you have a single-linked list of length n. The list is immutable. A node node has a method next and node.next() returns a reference to the successor of node. node.print() prints the value of node node or does some other stuff, such etails don't matter. Is it possible to print the nodes of the list in reverse or...
I was reading about Producer Consumer problem from Operating Systems by William Stallings where following code was given: +----------------------------------------------------+-------------------------------------------------------+ | Producer | Consumer ...
Question I'm reading the FLP impossibility paper. I think I understand the idea of the proof, and I don't have questions about it. However, it seems like the assumption of having at most, a single faulty process is not used in the proof. Put another way, if we remove this assumption and forbid process failure, the proo...
Given a set $S$ of $n$ overlapping intervals, where each interval is in the range of [1..O(n)], preprocess $S$ so we can efficiently answer the following query: Given an interval [i,j] output the interval from $S$ that has the longest overlap with [i,j] (i.e., their intersection is as large as possible). Note that [i,...
If I have a constraint like $y_1 + y_2 +\dots + y_n = k$ for positive integers $y_i$, how would I minimize $$\quad\frac{x_1 }{ y_1} + \frac{x_2 }{ y_2} + \frac{x_3 }{ y_3} + \dots + \frac{x_n }{ y_n}$$ if all of the $x_i$ are given? One can assume that $n\le5\cdot10^5$ and $k\le10^{12}$.
Back in 2002, using this arctan formula for pi discoverd by Stoemer: $$ \pi = 176 \arctan(1/57) + 28 \arctan(1/239) - 48 \arctan(1/682) \\ + 96 \arctan(1/12943)$$ and I assume using this series for arctan: $$ \arctan(x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \frac{x^9}{9} - \dotso $$ $\pi$ was gen...
I have a list of problems which I don't know how to prove (non-)recursive (save, I think, for the first), where $\mathcal{M}_n$ is the Turing-Machine with the Gödel-number $n$: $\mathcal{R}=\left\{n:\mathcal{M}_n\text{ does not move right for any input.}\right\}$ $\mathcal{R}_\mathcal{S}=\left\{n:\mathcal{M}_n\text{ do...
The wikipedia page Powerset construction says that the DFA equivalent to this $(n + 1)$-state NFA (with $n=4$ here) "requires $2^n$ states, one for each $n$-character suffix of the input". I understand that the author wants to say that the smallest DFA equivalent to this NFA needs at least $2^n$ states. But I can find...
Why the height complexity of a data structure, generally expressed in terms of $\log n$, do not contain a ceiling or floor ?
In general, there exists NFAs of size n whose smallest equivalent DFA requires 2^n states. But if we restrict ourselves to NFAs whose graph is eulerian, is it possible to turn any such NFA of size n into a DFA of size at most O(n) ? If so, does it hold also for a NFAs whose graph is strongly connected ? I would appreci...
I've heard some claims that the calculus of constructions without inductive types isn't powerful enough to express proofs by induction. Is that correct? If so, why isn't the Church-encoding sufficient for that?
This is the 24.1-5 question in CLRS. I'm having a hard time understanding the questions and also how to solve it. δ(u,v) is defined as the shortest path weight from u to v if there exist a path from u to v. Let G=(V,E) be a weighted, directed graph with weight function w:E→R. Give an O(VE)-time algorithm to find, for e...
$$L = \big\{ (0^{m^2})^* \ \big \vert \ m \ge 1 \big\}\,.$$ I've given answer as regular but i am not sure. How? Please explain.
This question might be redundant but I want to verify my understanding further. Suppose I have this linear directed graph: $$S \overset{2}{\to} A \overset{1}{\to} B \overset{3}{\to} E \overset{1}\to D.$$ Here, $S$ is the source, $D$ is the target, and numbers indicate to edge weight: When taking about shortest path, d...
I am designing a DSL for writing numerical simulations. I am working on a specific issue related to returning values from functions, and I am wondering if any other existing language solves the same problem. A toy example of a basic "simulation kernel" in my DSL looks something like this: function MySimulationKernel() ...
I wanted to clarify my understanding that both the theorems of Barron about approximating functions by neural nets are about one hidden layer net. Is this right? Is there any Barron's theorem for high depth neural net? Is there any lecture notes or such which gives a detailed exposition of the Barron's theorem? I ...
I am trying to de-knot a point of confusion in my mind regarding "turing-completeness" and the "universal approximation theorem". The context here is deep neural nets: So, consider two types of networks: a recurrent neural net, (RNN), and a feedforward net, say a pure convolutional neural net (CNN). I understand that...
I'm trying to understand Chord algorithm (for Peer-to-Peer systems) but I can't understand how it maps the documents to the nodes. I have one example where we have: keys with 4 bits 5 active nodes with the following identifiers: 1, 5, 7, 10, 13 After mapping the documents to the nodes, we have: Key 0 - Node 1 Key 2 -...
Backus-Naur Form specifications for the grammars of languages like like C or C++ build up expressions with counter-intuitive definitions. For instance, a multiplication expression like 5 * 3 is also a logical-or-expression and an equality-expression and a bunch of other things it doesn't actually look like, because th...
The following context-free grammar presents a "dangling else" type ambiguity (imagine that $a$ stands for if expr then and $b$ stands for else and $c$ stands for some other kind of instruction or block): $$ \begin{aligned} S &\rightarrow aSbS \;|\; aS \;|\; c\\ \end{aligned} $$ For example, $aacbc$ can be parsed as $(a...
The modified max product problem is as follows: given integer string $z_1\ldots z_n$, and an integer $k \leq n - 1$, what is the maximum product that can be formed by placing $k$ multiply signs in between the numbers, in the best possible configuration. This has ${n-1 \choose k-1} = \frac{n!}{(n-k)!k!}$ configuration...
I have two bitstrings that are 100 bits long. Bitstring A has a Kolmogorov complexity (KC) of 90 and bitstring B has a KC of 10. Intuitively, I think bitstring B is probably easier to compress than bitstring A. "Easier to compress" means a larger proportion of 100 bit bitstrings with B's KC can be compressed by a sta...
Let $a_{kn}$ be positive real numbers for all $k\in\{1,\dots,K\}$ and $n\in\{1,\dots,N\}$ and let $t>0$. I need to find a subset $S$ of $\{1,\dots,N\}$ of minimum size such that: if $|S|=1$ then $a_{ki}\geq t$ for all $k\in\{1,\dots,K\}$ and $i\in S$. if $|S|>1$ then for all $k\in\{1,\dots,K\}$, there must exist some...
Is there a good algorithm for generating all and only the unique permutations of a finite set respecting some kind of symmetry? For example, in Klondike solitaire, the two black suits are interchangeable, the two red suits are interchangeable, and the black suits are interchangeable with the red suits. This results in ...
am I right in the assumption that both linear and logistic regression algorithms can be represented as the simplest form of neural networks,a perceptron, which consists of a two layers, an Input and an output, that combines all the input each with it's own respective weight to produces a prediction or classification po...
I have two sequences - $A$ (of length $n$) and $B$ (of length $m$). They consist of numbers from the alphabet $\{1, 2, ..., k\}$. How want to find the shortest sequence $C$ such that $C$ is not a subsequence of $A$ and $C$ is not a subsequence of $B$? It should be made from numbers from $\{1, 2, ..., k\}$. For example ...
How would you solve the following problem... Theres a table filled with data like this: Data1: 50 51 48 55 50 Data2: 51 49 52 50 51 Data3: 49 53 50 51 48 Data4: 48 50 52 51 53 Data5: 47 50 51 54 49 Data6: 50 48 50 49 52 Data7: 51 50 51 49 51 Data8: 48 51 49 50 50 ... The goal is to create pairs from the table, based o...
Let $G = (V, E, W)$ be a weighted graph with positive and negative weights. I would like to find the set of vertices $V^\prime$ such that the sum of the weights of the edges that they share is the maximum you can get from $G$. I suspect that this is an NP-complete problem, so my question is whether this can be reduced ...
Could you proof it to me that A(A+B) = A? AA + BA [AA = A] A + AB Then what?
Context: This question rises from the paper "Methods for Visual Understanding of Hierarchical System Structures" by Kozo Sugiyama, Shojiro Tagawa and Mitsuhiko Toda, which lays out a framework (the Sugiyama framework), for hierarchical graph drawing. In the paper, Sugiyama et al. introduce the Barycenter Method for re...
From pg. 35 of Lambda Calculus and Combinators An Introduction: Corollary 3.3.1 in $\lambda$ and $CL$: for every $Z$ and $n \ge 0$, the equation $$ xy_1 \ldots y_n = Z $$ can be solved for $x$. That is, there is a term $X$ such that $$ Xy_1 \ldots y_n =_{\beta, w} [X/x]Z. $$ Proof: Choose $X \equiv \mathsf{Y} (\lambda...
While doing research on expert systems, I notice that it is rare to see this term used in the last 20 years. For example, a recent paper was: Wang, Hao, Naiyan Wang, and Dit-Yan Yeung. "Collaborative deep learning for recommender systems." Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discov...
Suppose I have a string that goes like "abcabcdeaabcdef", where each character is either one more than the previous one or a. If the character at position i is "c", I know that it is preceded by "ab". I want to find the number and length of all sequences (substrings that contain sequential characters). For example, the...
The question is to show that there are $(n-1)!/2$ distinct tours for a Euclidean traveling salesman problem (ETSP) on $n$ points. My attempt was using induction. So I start by: If $n=3$, then we have a triangle and there is only one tour. Assume that there are $(n-1)!/2$ distinct tours for a ETSP on $n$ points. Prove ...
How can we compute the shortest-path tree of minimum total weight for a given connected graph? I am using Dijkstra's algorithm to find the shortest-path tree, but there may exist more than one shortest-path tree with different total weights. The above picture shows one such example (where $a$ represents the starting v...
I am practicing for an exam and one of the exercises is: Find an example sequence where FFD (offline) performs better than BFD (offline). Intuitively I would say no such sequence exists as the sequence is sorted, but I have not managed to find a counterexample or proof.
Is there any systematic (algorithmic) method to convert a regular expression like $(a^*)(b)(b^*)(a^*)c$ to an automaton (let's say a Buchi automaton)?
I'm reading a paper entitled "Succincter" which discusses a compression scheme that involves encoding a value as a sequence of $M$ bits, along with a "spillover" value which can be recursively encoded. The details of the encoding scheme are not really relevant for the purpose of this question. Rather, I am specificall...
During the fetch, decode, execute cycle, the Program Counter (PC) increments after the operand is copied from the Memory Data Register (MDR), and then carries on with the processing of the instruction. Why does the PC increment in the middle of the cycle rather than at the end? My only guess would be that it relates t...
I have a binary vector $v \in \mathbb{F}_2^m$ and a set of binary vectors $Q=\{q_1,q_2,\dots,q_n\}$ each belonging to $\mathbb{F}_2^m$ and I know that $v \in \text{span}\{Q\}$ but I want to know if there exists a subset $Q_k \subset Q$ of at most $k$ vectors ( i.e. $|Q_k| \le k < n$ ) such that $v \in \text{span}\{Q_k\...
We have the following i <- 0 j <- 0 x <- 1 y <- 1 z <- 1 c <- 1 u <- 1 while i<n do i <- i+1 j <- i x <- x*i z <- x y <- i+1 y <- x*y while j<2*i do j <- j+1 z <- z*j od c <- z div (x*y) od I want to find the loop invariant for both while-loops. I applied th...
Can you explain in step-by-step basis of how motion capture system work? Especially the part, that enables the 3D models to mimic the movement of the actor.