instruction
stringlengths
35
29.1k
I'm writing insertion sort in scheme, but due to the difficulty of writing it recursively within the constraints of list processing of scheme, I made what seems like an insignificant change to the "find lowest" or inner loop. I'll reproduce the algorithm here in Python (aka the universal psuedocode) to explain. I'll al...
In distributed systems theory, I have found the definition that a distributed system requires, among others, location and access transparency. I was wondering if location transparency does not already include access transparency. Wikipedia defines the two as follows: Access transparency – Regardless of how resource ac...
Any $k$ round AM can be reduced just two rounds whereby Arthus just does the $k$ coin tosses and passes on the information to Merlin. Merlin sees all the coin toss results and computes everything necessary since he knows Arthur's function as well. So for any $k$, $AM[k] = AM[2]$ And one anyway has, $AM[k] \subseteq AM...
Adleman's theorem gives $$\mathsf{BPP\subseteq P/Poly}.$$ Why is this theorem considered progenitor to derandomization conjecture that $\mathsf{P=BPP}$? Does it mean Adleman's result could be considered as evidence $$\mathsf{BPP\subseteq P/Log}$$ is a realistic possibility? Anaalogously, does it mean $$\mathsf{NP\subs...
The problem whether two pushdown automaton recognize the same language is undecidable. The problem whether a pushdown automaton recognizes the empty language is decidable, hence it is also decidable whether it recognizes a given finite language. It is undecidable whether the language accepted by a pushdown automaton is...
Consider a grammar G which is SLR(1) except for some shift/reduce conflicts which can be resolved by imposing some precedence or associativity of operators. Is it the case that the construction of the SLR(1) parser and the LALR(1) always yield the same table? If not, what happens if the grammar G is SLR(1)? I'm partic...
A rather basic question but I am confused about the characterization of a certain local search method which I want to describe in the framework of EAs. In particular, consider an EA which in every step of the evolution has a neighborhood of size 2; one element in the neighborhood is the current hypothesis (hypothesis i...
I am new to Automata theory and would to make a regular expression for "even-odd" strings, defined over $\Sigma = \{a,b\}$, which is the set of strings with even numbers of $b$'s and odd number of $a$'s. I am also interested in constructing a DFA and NFA for the language. I tried Even number of $b$'s = $(a^{\ast}ba^{...
I'm working through "Types and Programming Languages" by Benjamin Pierce and I don't quite understand the notation. Particularly on Page 106, (chapter 9 Simply Typed Lambda-Calculus) there is a lemma (9.3.7): $$ \text{If } \Gamma \vdash t:T \text{ and } x \notin dom(\Gamma) \text{, then } \Gamma, x:S \vdash t:T. $$ I ...
Can anyone explain how to find the $\Theta()$ of this equation... $$T(n) = 3T(n-4) + cn$$ When I solve this problem I get this using the $k$ -th iteration... $$T(n) = 3^{k}T(n-4k) + 3^{k-1}c(n-2(k-1)) + 3^{k-2}c(n-2(k-2)) + ... + cn$$ I factor out c and get this... $$T(n) = 3^{k}T(n-2k) + c(3^{k-1}(n-2(k-1)) + 3^{k-2}(...
I need to find algorithms for both undirected and directed graphs, with no assumption on them being connected. Also the algorithms must be $O(V+E)$, where the undirected one should not depend on $k$. I have ideas for both, i'm just not very sure about the directed version, because I'm not sure on how to approach the c...
From Wikipedia: The above formula is often unwieldy in practice, so the following looser but more convenient bounds are often used: (i) $Pr(X\geq (1+\delta)\mu)\leq e^{-\frac{\delta^2\mu}{3}}, 0<\delta<1$ (ii) $Pr(X\leq (1-\delta)\mu)\leq e^{-\frac{\delta^2\mu}{2}}, 0<\delta<1$ The assumption they use is $E[X]=\mu$. ...
Since know that $\mathsf{TC^0\subsetneq PP}$, I wonder if we also know that $\mathsf{TC^0\subsetneq\#P}$? I understand that $\mathsf{\#P}$ is in counting hierarchy.
Even so a linear bounded automata (LBA) is strictly more powerful than a pushdown automata (PDA), adding a stack to a LBA might make it more powerful. A LBA with stack should not be Turing complete, because its halting problem should be decidable. (It seems to be equivalent to the halting problem for a PDA). Can a det...
Given a bipartite graph $G = (A,B,E)$ where every vertex is colored either red or blue I am trying to minimize the number of blue vertices using the following operation: Choose a vertex $v_a$ in $A$ Flip the colors of $N[v_a]$, meaning that $v_a$ and every neighbor of $v_a$ will change color. Is there a polynomial t...
Given formula $\phi$ on CNF-form in CNF-SAT. Clauses can be arbitrarily long. The problem is NP-complete and it is also given that part of the problem is that a variable can occur many times in a formula. Another problem $CNF_3$ is introduced. Each variable can at most occur three times, with a given formula. This prob...
Given a word list of $N$ words formed from a language of $M$ characters, where each word is composed of $n \geq 1$ not necessarily distinct characters, how can I find the best set of $k<M$ characters to learn, where "best" is defined as the set of $k$ with which the most complete words can be spelled. Ie, if I know th...
It is an interesting question from an Interview, I failed it. An array has $n$ different elements $[A_1, A_2, \ldots, A_n]$ (random order). We have a comparator $C$, but it has a probability p to return correct results. Now we use $C$ to implement sorting algorithm (any kind, bubble, quick etc..) After sorting we have ...
I'm trying to find the answers of two questions about the Universal Turing machine. How can the Universal Turing machine simulate a Turing machine if the one that is being simulated has a bigger number of states? How can the Universal Turing machine simulate a Turing machine if the one that is being simulated has a bi...
Can a single node be considered a subgraph? For example, if I had this graph, G: X-----Y and I deleted Y, leaving me with the graph X is this a subgraph (induced) of G? What about the following argument? Assume a single node can be considered a graph. Any graph is an induced subgraph of itself. Therefore, a single n...
The task is to find an equivalent LTL formula for $G(a \Rightarrow Yb)$, which doesn't contain the Y operator. My idea is to search for invalid path patterns with 2 $a$'s in a row, e.g. bbbbaab. Therefore I'm thinking of $G(Xa \Rightarrow b)$, so whenever an $a$ occurs in the next state the the current state must be t...
How can I prove that non-regular languages are closed under concatenation using only the non-regularity of $L=\{a^nb^n|n\ge1\}$ ?
how do you find the Theta of this problem... $$T(n) = T(\frac{n}{3}) + \log_2(n)$$ I end up getting a pattern of $$T(\frac{n}{3^{k}}) + \log_2(\frac{n}{3^{k-1}}) + \log_2(\frac{n}{3^{k-2}}) + ... + \log_2(n)$$ when I solve for k with T(1) = 1 I get this... $$\frac{n}{3^{k}} = 1 \\ n = 3^{k} \\ \ln n = k \ln 3 \\ k = \l...
The Problem Consider the randomized quicksort algorithm which has expected worst case running time of $\theta(nlogn)$ . With probability $\frac12$ the pivot selected will be between $\frac{n}{4}$ and $\frac{3n}{4}$(a good pivot). Also with probability $\frac12$ the pivot selected will be between 1 and $\frac{n}{4}$ or ...
If I had a graph $G$ with some negative edge weights, clearly Dijkstra's algorithm does not definitely halt, since it might get caught in a negative cycle (shedding infinite weight). However, would finding the minimum weight (most negative weight) $w$ and adding the absolute value to every edge's weight preserve the sh...
I'm reading through Pushdown Control-Flow Analysis of Higher-Order Programs, which presents a synthesis of the Abstracting Abstract Machines technique and pushdown automata to get static analysis which perfectly matches call and return sites. The paper presents a monovariant and two polyvariant forms of the system. I c...
Trying to answer the following question: However, my answer is that only one of these states satisfy the TS (which is for sure wrong since the next part of this question asks to remove states that don't satisfy the formula and compute the new TS). Reasoning follows: 1 - does not satisfy the formula since if you go to...
I'm new to world of static analysis and am trying to build a new analysis of C programs for llvm compiler. I've started with the build of the graph of the constraints of the program: The edges represent the flow of data through the program (according to the statements or function calls) and the nodes the run-time memor...
I was going through some Halting Problem reduction and I found the following problem: Given a semi-decider TM $M$, does the language $L(M)$ contain all strings of exactly length $4$? The question later asks to prove whether this is recursive or r.e. Going through some practicing, I came to the conclusion that this is...
Is the set of all finite and countably infinite sequences over $\{0,1\}$ countable? From my analysis, I think it is countable. I think of this as the set of all strings from a finite alphabet $\Sigma=\{0,1\}$, hence $\Sigma^*$. (is this a good assumption?). I later show that I can count each string in the following ord...
What advantages do block programming environments like App Inventor have over high level programming languages like Python or Java?
I am looking for an algorithm to determine whether a graph is Strongly Regular Graph (SRG) or not.
In Combinatorial Game Theory, a major distinction is drawn between impartial games and partisan games. To be impartial, a game must satisfy these conditions: (1) The game is finite; i.e. there is a constant $c$ such that all games end in $c$ moves or fewer. (2) There are no draws; either player 1 or player 2 wins. (3)...
In an octree, each node has up to eight child nodes. This can be implemented with eight pointers per node that are set to null pointers if the child is not used. Another implementation uses a byte as bit-mask that stores which children are used and a pointer to the first child. The children are stored consecutively the...
I was wondering if there is a polynomial time algorithm to test whether a DFA recognizes a star closed language ( which is if $A=A^*$). I think that yes, but I do not have an idea to do it.
This is a homework problem but I am awfully confused. The problem reads as follows: If $L_1$ is recursively enumerable but not recursive, and $L_2$ is recursive, then which of the following is the strongest true statement about the set difference $L_1 - L_2$? a. It must be recursively enumerable and not recursive. b. I...
If $X$ is a sum of i.i.d. random variables taking values in $\{0,1\}$ and $E[X]=\mu$, the Chernoff bound tells us that $$\Pr(X\geq (1+\delta)\mu)\leq e^{-\frac{\delta^2\mu}{3}}$$ for all $0<\delta<1$. If $E[X]\leq\mu$ instead, does there exist a constant $c$ such that $$\Pr(X\geq (1+\delta)\mu)\leq e^{-c\delta^2\mu}$$...
There are parser generators (some of which are limited to certain classes of grammars) which, given a grammar, automatically generate a parser for that grammar. Would it be possible to make a general-purpose translator generator to automatically translate from a string in the language with production rules described b...
From the definition of Big O, it states that there should be a function $g(x)$ such that it is always greater than or equal to $f(x)$. Or $f(x) \le cg(n)$ for all values of $n > n_0$. What I'm not able to understand is what is its importance in Big oh notation. Every question explains what is big-Oh and what how it use...
Let G(V,E) be the graph and V = {$V_1$,$V_2$,....,$V_n$}. A dynamic programming approach solves the Hamiltonian path problem in $O(2^n n^3)$ time. We can have a matrix : dp[s][i][j] : which computes for any subset (say s) of V whether there exists a hamiltonian path starting from vertex $V_i$ and ends at vertex $V_j$ i...
In the definition of lambda cubes, type polymorphism is distinguished from type operators/constructors. I have the nagging feeling that type polymorphism can be constructed through type operators using lazyness. This may be extremely convoluted but I always felt polymorphic types where just functioning "as if" waiting ...
In Software Performance and Scalability: A Quantitative Approach - Henry H. Liu, the author is presenting a scenario where the hardware becomes a bottleneck. In one ot the tests, he is checking the number disk (read/write) operations. In particular, the number of disk writes as the number of threads increases (see figu...
Is the union of finite and countably infinite sequence over alphabet $\Sigma=\{1\}$, countably infinite as well? I understand this is similar a question to the one of finite and countably infinite strings over $\{0,1\}$, however I think that the previous argument is not valid in this case. Now, countably infinite strin...
Consider the following adaptation of the traveling salesman problem: Given a complete, undirected graph $G$ with nonnegative edge weights, color each vertex either red or blue. Find the shortest path that visits all vertices exactly once (does not need to return to starting vertex), but does not visit vertices o...
Suppose that $TM_{halting}$ is the set of machines that halt. Given a number of states $m$ and a length $n$ of the input, let $f(m,n)$ be the maximum number of steps a machine with $m$ states in $TM_{halting}$ can take on an input of length $n$. Is the function $f(m,n)$ computable?
I'm having trouble constructing a Context Free Grammar for the following language: $$a^{\ast}b^{\ast}c^{\ast} - \{a^{n} b^{n} c^{n} \mid n \geq 0 \}$$ I believe it's telling me that no string can be generated that has the same number of of $a$'s $b$'s and $c$'s. This is due to the subtraction of the second set. A g...
Suppose a system in which addresses (physical and logical) occupy 32 bits, page size is 1024 bytes (210), and physical memory is of size 32MB. How many frames are in physical memory? Is the logical address space larger than physical memory? Explain. The solution given is: 232 byte logical address space (assuming byte-...
Let $\Sigma=\{0,1\}$. What is the regular expression for the language of all strings with an even number of $0$'s and an even number of $1$'s? If we only require an even number of $0$'s, the language $(1^*)\mid(1^*01^*01^*)^*$ works. But once there is a requirement on both $0$'s and $1$'s, I'm not sure how to do it.
We know that $\mathsf{non-uniformAC^0\subsetneq PSPACE}$, $\mathsf{non-uniformACC^0\subsetneq NEXP}$. We know that $\mathsf{uniformACC^0=PH}$ is a possibility. What are some of circuit separations that we know of? What are some circuit separations that seem farthest apart but cannot be separated? By this question I me...
I ask, because I have to come up with a first-order logic sentence that shows that there are exactly N objects in the universe. What I've been able to come up with is: $$ \forall x \; \exists y_1, y_2, \dots , y_{n-1} \; (x \neq y_1) \land (x \neq y_2) \land \dots \land (x \neq y_{n-1})$$ I'm not sure if this is a va...
I look forward to the day we can start using quad-precision numbers, but was disappointed to see that in the specification, only 15 bits out of a whopping 128 were assigned to the exponent as shown by Wikipedia. That's only 4 bits more than we had for doubles! This allows for great precision, but we sacrifice the high ...
I am working on finding shortest disjoint path problem, When there are distinct origin destination pairs and there is a predefined time window (or length) associated with each object (which we want to move from one origin to its specific destination). This time window will tell us how long it will take for the object t...
I have a problem where I need to split a graph into subgraphs. The conditions for the splitting is as follows: Every subgraph must be a complete graph/clique No vertex can be part of two or more subgraphs Subgraphs that can be merged with other subgraphs while remaining complete cannot exist When multiple possible com...
The more I think about it, the stranger the concept of having a number type, which is a super-type of integers, rationals and reals seems to be. One thing that comes to mind is the Wittgenstein's concept of class families (where objects are grouped into families, even though neither one is a sub-type of the other, but ...
For a graph $G=(V,E)$, I build an adjacency matrix and encode it into binary, clearly. Now, imagine the alphabet I am given is $\Sigma=\{1\}$, is there a way for me to encode any graph instance with such alphabet? In my reasoning, I think you can, since if you can map any binary string, to a unary string, then you can ...
Does there exist a recursive language $L$ whose cardinality is uncountable? I would like to have an explanation whether Turing Machine can encode uncountable languages and whether we can use this to reject the initial question.
I have no idea how I managed to get this far in life without ever really grasping this but as it happens I'm still very confused on the concept of a hash function. I did some googling/wikipedia-ing, and here's what I get: hash tables are nice because the index can be stored in a smaller array hash functions are kind o...
It seems that everywhere I look, data structures are being implemented using red-black trees (std::set in C++, SortedDictionary in C#, etc.) Having just covered (a,b), red-black & AVL trees in my algorithms class, here's what I got out (also from asking around professors, looking through a few books and googling a bit)...
The question is: Consider a virtual address space of 256 pages with page size of 4KB, mapped onto a physical memory of 128 frames. How many total bits are required in the virtual address? How many total bits are required in the physical address? I can't figure out how to number of frames is used with the number of p...
I have to explain how a 2-PDA works and then write a program (in Delphi) which simulates a 2-PDA step by step for the language $L = \{w\$w\ |\ w ∈ \{0,1\}^n\ with\ n>0\}$. So far, so good. Now I know that a 2-PDA works with two stacks and is equivalent to a Turing Machine. It reads from an input tape and can save the c...
I am doing supervised learning on speech audio files using neural networks. For this purpose, I'll have to extract features from the audio file. But since an audio file is a time varying signal, it is generally divided into multiple frames and then features like MFCC etc are extracted from each frame. So how should I e...
Let $Q$ be the set of states of the Turing Machine, $\Sigma$ be the alphabet, and $\{L,R,S\}$ be the left shift, right shift, and stay respectively. A transition is an element of $Q \times \Sigma \times Q \times \Sigma \times \{L,R,S\}$ which can be read as current state, current symbol, next state, next symbol, moveme...
So I've been reading things about HoTT and trying to get solid on the foundations before getting too much further into the book. I am confused by a certain point; maybe I just haven't read far enough yet however. I don't think my question is specific to HoTT but just dependent type theory in general. Say you have a fam...
I have various Boolean functions in the sum of products format. I "convert" these via combinatorial logic synthesis into a combinatorial network as an And-Inverter Graph - therefore this network only consists of 2-input, 1-output And-Gates and inverters. Every sum of products function is therefore "responsible" for a c...
As far I know, in general case there is no Turing machine which could get any theorem on its input and produce its proof on its output. Why is it so?
This problem is from Algorithms, problem 2 The Problem Given two sorted list of numbers $X$[1..$n$] and $Y$[1..n]. we need to come up with a O($log n$) time algorithm to find the median of the 2$n$ lists.' My question is regarding the case where median($X$) is less than the median($Y$). Here is the proof that the aut...
I have built a heuristic algorithm for approximately solving an NP complete graph problem by recursive linear relaxations. In each recursion, the algorithm returns a reduced graph, with number of nodes $N_{k+1} \leq 0.5N_{k}$. I think this means that the overall complexity should be order $\log N \times T(N)$ where $T(...
This seems like a simple problem but I'm getting the impression I'm missing something. The problem Given the values $v_1, v_2, \ldots, v_n$ such that $DFT_n(P(x)) = (v_1, v_2, \ldots, v_n) $ for $ P(x) = \sum\limits_{i=0}^k a_ix^i$ , $k < n$ - find $ DFT_{2n}(P(x^2)) $ My attempt: First expand $P(x^2) $ : $$P(x^2) = a...
So the Euclidean TSP decision problem is NP-complete (see http://dx.doi.org/10.1016/0304-3975(77)90012-3 ) so the TSP optimization problem should be NP-hard. On the other hand there is a PTAS for the Euclidean TSP (see http://dx.doi.org/10.1145/290179.290180 ). Wikipedia says that a PTAS is not possible for strongly N...
I'm trying to understand the pumping lemma for regular languages and would like to prove that $L=\lbrace{ab^{n}ba^{n}|n\geq1}\rbrace$ is not regular. My suggestion is as follows: Assuming $L\in{}REG$, let $p$ be the number that exists for $L$ according to the pumping lemma. Let $w=ab^{p}ba^{p}$ with $|w|=2p+2>p$. Since...
In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model? I) There is no advantage over the strict model. II) In contrast to the strict model, it guarantees that starvation cannot occur. III) In contrast to the strict model, it guarantees that deadlock cannot occur. IV) I...
I am looking for some advice and direction on solving the weighted interval scheduling problem with $m$-machines to plan some experimental "wet lab" procedures. The problem is very similar to the standard weighted interval scheduling problem described but with the important difference that more than 1 'machine' can be ...
The list of finite languages over a finite alphabet is countable. I could prove it by saying that the list of languages of size 1 is countable, the language of size 2 is countable, and so on. Then I can prove that the infinite union of countable set is countable. However, I am sure that there is a simpler proof. Can so...
I want to implement following algorithm on Turing machine: rewrite binary numbers to their unary counterparts. For example: 101 will be rewritten to a string of 5 consecutive bars (wikipedia) But I don't know how to make the replacement "|0" -> "0||" because it requires 3 cells. Basically I want to insert addition...
Is there an algorithm to test whether the decomposition of relation $R$ into relations $R_1,\dots,R_n$ is dependency-preserving? In more detail, I am given a relation $R(x_1,\dots,x_m)$ on $m$ variables. I am given a decomposition of $R$ into relations $R_1,\dots,R_n$, where each relation $R_i$ refers to a subset of t...
I have a finite automaton with no final/accepting states, so F is empty. How do I minimize it? I got this on a test and I didn't know how to approach the problem because the automaton had no accepting states. Is a single initial state with all the transitions into itself the correct answer?
My textbook says a "complete binary tree" is a "full binary tree" where every root is at the same level. My conceptual understanding: All this time, I was led by my textbook to believe a root is the "top-most vertex" in which all the other vertex are led away from it. So basically I am led to believe there can be only...
I would like to implement short circuit evaluation logic in my code. And I want to know about the full details how it works? Ex: function a() {return true;} function b() {return false;} function c() {return true;} Expression Case 1) a() && b() && c(); Case 2) a() || b() && c(); Case 3) a() && c() || b(); Case 1: b() wi...
Is it $\mathsf{NP}$ complete to decide whether a graph $G$ has bigger clique $\omega(G)$ or bigger independence number $\alpha(G)$?
Setting Exactly as the title stated: Give an example of an $\mathsf{NL}$-complete context free language. $\newcommand{\angle}[1]{\langle #1 \rangle}$ Current Solution Recall in the past we proved that $E_{DFA}$ is regular, so it is also context free. $E_{DFA}$ is in $\mathsf{NL}$ since given DFA $\mathcal M$ over $n...
Given a graph G= (V, E) that is: directed, acyclic, non-weighted, may have more than one edge between two vertices (thus, source and destination are not enough to determine an edge). And given a set of vertices, let's call them vSet; that contains a vertex vRoot; I need to find ALL paths pSet between vSet elements...
For measuring the complexity of an algorithm, is it time complexity, or computational complexity? What is the difference between them? I used to calculate the maximum (worst) count of basic (most costing) operation in the algorithm.
For the purpose of implementing an optimization algorithm (finding the minimum of a multivariate function) I want to create a data structure that supports the following operations: load from array Peek at maximum element (but don't destroy it) Peek at next-to-maximum element Peek at minimum element decrease the maximu...
I'm using Q-Learning to find the values of states in on a gameboard. For example, something like: ----------------- | | | | 1 | ----------------- | | W | | -1| ----------------- | | W | | | ----------------- | S | | | 1 | ----------------- I have the transition, and I can calculate the values of th...
In an out-of-order processor, what is the difference between a reorder buffer and an instruction window? Wikipedia says: "In particular, in a conventional design, the instruction window consists of all instructions which are in the Reorder Buffer (ROB)." Does this mean that the instruction window isn't a seperate h...
Consider the language below, on the alphabet $\Sigma = \{a,b,\$\}$: $$L = \left\{ x$y \mid x,y\in\{a,b\}^* \land \left|x\right| \ne \left|y\right| \right\}$$ I need to define a CFG for this language. I've tried couple of CFGs but they all failed in one way or another. I'd be glad for help.
$$L=\{0^m1^n \enspace | \enspace m \neq n\}$$ I saw that this exact question exists elsewhere, but I couldn't understand what was being said there. My question does not mandate the use of the Pumping Lemma as stated "elsewhere", but I am using the Pumping Lemma anyway. I want to present what I have so far, and for some...
I tried to solve the following exercise : What is the order of growth of the worst case running time of the following code fragment as a function of N? int sum = 0; for (int i = 1; i <= N; i++) for (int j = 1; j <= i*i; j++) for (int k = 1; k <= j*j; k++) sum++; and I found that the complexity ...
In my lecture notes, the definition of the class NP is given as: A language $L$ is in the class NP, if there exists a turing machine $M$ and polynomials $T$ and $p$ such that: For every input $x$, $M$ terminates after at most $T(|x|)$ steps If $x\in L$, then there is a "proof"(or certificate) $t\in\{0,1\}^{p(|x|)}$ su...
I am thinking of the equality "PCP(O(log(n)),0) = P" Say I have a deterministic polynomial time algorithm $A$ whose correctness I can't prove immediately. But say I create a probabilistic version of this algorithm say $A_P$ such that it uses log(n) random bits. Now if I prove somekind of (exactly what ?) expectation c...
That's my question, since it has two symbols but go to a single state, is DFA or NFA?
I've written a library which stores numbers as an array of nibbles. You set the digits and decimal places at compile time. I've written all basic math +-*/% but I'm not sure how to do exponentiation ($a^b$). Raising a decimal to an integer power is a piece of cake, but how do you do, e.g., $4.6345^{3.1425}$ from first...
I have written a math library which handles really big numbers with good precision. Each digit is stored in a nibble and a 'nibble array' makes up the number. There is no epsilon portion, as for currency calculation big brother is happy enough to loose penny fractions with int like rounding. My problem is $a^b$ . It's...
What's the difference between them - Physically based simulation, Physically based animation, Physical simulation for computer animation, Physically based animation for Computer graphics, Physically based modelling for interactive simulation and games and Cognitive modelling ?
LW R2, 0(R1) CMP R3, R2 CMP R7, R5 the LW instruction stalls the first CMP so the second one will execute first. Wouldn't this cause the flags register to contain the wrong value since it expects the second CMP to be the last one that updates the flags register? I'm not sure about this one: does an ADD instruction ALW...
Suppose we have digraph G, set of its vertices W and two (possibly equal) vertices s and f. I'm looking for an algorithm which will solve the following problem: whether there is path from s to f passing through all vertices from W; if yes, return any of such paths. By "path" i mean path in the most general sense: repet...
For an assignment we are asked the following(simplified) : A function F(a) has a non-negative integer as a result. This result is reused in the function itself. Like this, and where the first a is given: new_a = (c1 * (previous_a or first_a) + c2) mod c3 Write, in C#, a sufficiently fast and memory efficient algorithm...
There is that popular problem [1] [2] in the computer science that is finding minimum number of straight lines that covers a given set of points in 2D. Even though I have scanned many papers, none of them has a clear motivation for the problem. What is the use of solving this problem? Is there a paper that explains thi...
Trying to explain a problem, I thought of a variant of Turing Machines. It is unlikely to be new, but I do not recall ever seing it before, and I wonder whether it has been used or has a name. The idea is that the TM uses a "linked list" rather than a tape, so that the head can splice a new symbol position between two ...
I have read various explanations why a 1-bit branch predictor is wrong twice per loop, once at the beginning when it wrongly predicts against entering the loop and once at the end when it wrongly predicts against leaving the loop. Makes sense. What I don't understand is why the 2-bit predictor is better. It seems it ...