instruction
stringlengths
35
29.1k
Suppose we have the predicate $\qquad A.p.q ≡ (∀i \mid p≤i≤j<q : X.i≤X.j)$ which says that $X[p..q)$ is ascending. Apparently, the predicate holds for empty segments, is prefix closed and is postfix closed. I would like to prove that the predicate above is indeed prefix closed, but I am not able to; that is, I am unabl...
The XOR swap is a well-known in-place algorithm to swap two values, by XOR:ing them bitwise. It goes as follows: a = a ^ b b = a ^ b a = a ^ b Now, I was thinking to myself if I can find a way to help with my intuition regarding this algorithm. And here's what I thought of: Bitwise XOR is the same as bitwise addition ...
I'm more or less familiar with the landau symbols, most specifically in computer science for complexity, however I was wondering if someone could clarify a bit for me. I'll just mention that I know that technically the correct notation is to say $f(n)$ is an element of $O(f(n))$, not $f(n) = O(f(n))$. Loosely, my under...
How to decode gamma code ($\gamma$ code): 1110001110101011111101101111011 and get the gap sequence? Detailed information about Gamma codes ($\gamma$ codes) with brief example of decoding can be found here. But in their example there is only case when gamma code ($\gamma$ code) consists of one digit only, how to deal...
Why does reduction from vertex cover to subset sum use base-4? 30.13 Subset Sum (from Vertex Cover)
Suppose I have a large distributed task running on a cluster system where part of the workload is compute bound and part depends on network performance. Data transfer is not completely homogeneous between processes - some communication pairs are more or less sensitive to bandwidth and latency than others. We've profil...
PS: MIPS architecture This is a model of a memory RAM of 4GB: it has 4,294,967,295 addresses, and each address has 32 bits. Can somebody tell me why the load word instruction needs an offset to the address? My book says that the offset must be multiplied by 4, but for me, I could simply give the address of the array, ...
I am considering the following class of algorithms: The algorithm has access to some probabilistic oracle (procedure) $f$ in addition to input. The answer of procedure $f$ (we may assume it is boolean) may be incorrect with probability at most $p<1/3$. The error of different calls to $f$ are independent (thus we may i...
There is a complete graph $G$ with $n$ vertices and each edge has a distinct weight. Is there an efficient (not necessarily optimal) algorithm to select $k$ vertices from the graph $G$, such that the total cost of the min-spanning tree of the selected $k$ vertices will be highest? In my case, $n$ is around 1000, and $k...
Can we algorithmically infer the number of comets that orbit the Earth, based upon periodic observations of them, if we cannot tell the comets apart? In more detail: The problem There is an unknown, fixed number of comets, numComets that pass by Earth and are visible from the ground. Each comet takes a fixed number ...
Here is the scenario: There are three chefs(A- main chef, B and C- assistant) working together to prepare a diner set. The sequence of the event is as following. Start: The three chefs enter the kitchen together with the ingredients. Preparation: They prepare the utensils and the ingredients(e.g cleaning and cutting)....
I'm researching the travelling salesman problem and looking for data regarding the current state of affairs regarding solutions and performance. So far the only data I've states that the current record for optimality is held by 'Concorde' which found a solution for a graph containing 85,900 cities. I've also found benc...
I want to know if there is an algorithm for this problem. I have a list of points given as (x,y) values and a given distance. I want to draw a line through the set of data points so that the size of the set of points that is within the given distance from the line is maximized. That is, this line Does an algorithm fo...
The Berman-Hartmanis conjecture discusses one-way functions (functions with hard to compute inverse functions). As a step to solving the conjecture, if one-way functions could be reduced to a canonical or universal one-way function from which all one-way functions could be derived, this would be a major plus... In a si...
I'm trying to solve a constraint programming problem using a SAT solver. I have set of constraints in the form of propositional logic statements, which are converted to CNF using Tseitin transformation. From the nature of my problem I know that there are redundant constraints. For example, I have a rule: $$AND\:(OR\: (...
At pp. 7-8 of Ker-I Ko's Computational Complexity of Real Functions (1991), the following is stated for one dimensional cases: Let $INV_1$ be the operator that maps a one-to-one function $f:[0,1]\rightarrow [0,1]$ to its inverse function $f^{-1}$. Then $INV_1(f)$ is polynomial-time computable for all polynomial-time c...
I am wondering if it is possible to have a program that interprets programming code and is capable of turning that code into an optimized circuit. Is this possible, and if so, does it exist?
Most modern compilers split their syntax analysis into a lexical phase that is followed by a parsing phase. The lexical phase is given by a regular expression, while parsing is guided by a context-free grammar. What class of languages can be recognised this way? Context-free languages, or can we get into context-sens...
Are the integer factorization and PRIMES known to be in LOGSPACE? Recently, it has been shown by researchers that PRIMES is in P. But this does not say anything about LOGSPACE since it is not known if LOGSPACE = P.
Given two sequences $A$ and $B$, we want to check if $A$ is a subsequence of $B$ where the elements of $A$ appear in $B$ consecutively and in the same order. Example 1. input: $A = (4 , 6 , -5), B = (2 , 4 , 6 , -5 , 4)$, output: Yes Example 2. input: $A = (2 , 6 , 4), B = (2 , 4 , 6 , -5 , 3)$, output: No — alth...
Given two symbols $\text{a}$ and $\text{b}$, let's define the $k$-th Fibonacci string as follows: $$ F(k) = \begin{cases} \text{b} &\mbox{if } k = 0 \\ \text{a} &\mbox{if } k = 1 \\ F(k-1) \star F(k-2) &\mbox{else} \end{cases} $$ with $\star$ denoting string concatenation. Thus we'll have: $F(0) = \text{b}$ $F(1) = \t...
In a bipartite graph, how can we find the total number of ways of getting a maximal matching? The cardinality of both the sets in the bipartite graph may not be the same. So two matchings are said to be different if they have at least one distinct edge.
I am studying database functional dependency. It says if A can functionally determine all other attributes, it is considered to be a key. What if 2 tuples are exactly the same, can we still say A is a key? To me A cannot determine an unique tuple.
Considering how often we do: variable = variable + another; variable = variable - another; variable = variable * another; variable = variable / another; variable = variable & another; variable = variable | another; variable = variable ^ another; we then made the following language shortcuts: variable += another; varia...
Given a set of $n$ point in a plane, find the maximal number of colinear points (the points residing on the same straight line). The crudest algorithm is to compute the slope and intercept of each pair of point, assuming infinite precision, find maximal number of appearance of the same pair of parameters. Is there an ...
I am teaching myself algorithms with the online lecture notes by Jeff Erickson and fails to solve the following problem (Problem 21 of Lecture 1). (a) Describe an algorithm that sorts an input array $A[1 \ldots n]$ by calling a subroutine $\texttt{SQRTSORT}(k)$, which sorts the subarray $A[k + 1 \ldots k + \sqrt{n}]$ ...
I wonder what is the fastest way to check whether the intersection of a set of half-spaces is empty. Right now I'm using a linear programming formulation (with Gurobi as solver) to check if there is any feasible solution to a linear program constrained with a lot of linear inequalities. Is it possible to perform the f...
As I understand it NP requires a solution to be verifiable in polynomial time. Can you provide examples of solvable problems not verifiable in polynomial time ?
True or False? Say some data structure can perform $x$ operations in amortized $O(x)$ time. Then for a big enough $y$ it can perform $xy$ operations in worst case $O(xy)$ time. My attempt: $x$ operations in $O(x)$ amortized means $O(1)$ expected time for $1$ operation. Then for $xy$ operations it'd be $O(xy)$ amortized...
Problem statement: Given a graph G(V,E) which is not acyclic and may have negative edge weights (and thus may possibly have negative-length cycles), how does one detect if the graph has a zero-length cycle, and no negative-length cycles? Background information: The question came up when I tried to implement in code the...
As I have read in book and also my prof taught me about the asymptotic notations The general idea I got is,when finding asymptotic notation of one function w.r.t other we consider only for very large value of $n$. So from here my confusion is- $2^n=O(3^n)$ and $\log_2 n=\Theta(\log_3 n)$ First relation is clear to me a...
In Computational Complexity A Modern Approach, one claim says that if $f$ is computable in time $T(n)$ by a bidirectional TM $M$, then it is computable in time $4T(n)$ by a unidirectional TM $\tilde{M}$. How to work out the constant $4$? In my opinion, in addition to "go over the edge" operation, one transition in $M$...
Given a sorted array A, we have to find the position of an element m in it. (It is also given that the element exists in the array.) However there is a constraint. Like in a game you have 3 lives. If you probe any element x > m in the array you will lose one life. You can probe as many elements you want which are small...
Is string matching and replacement, as an operation on strings or on formal languages, considered in formal languages? For example, the family of regular languages, or the family of context free languages, ..., are closed under certain string operations. I would wonder if these families or some others may be closed u...
This is taken from OPERATING SYSTEMS: INTERNALS AND DESIGN PRINCIPLES by WILLIAM STALLINGS Consider a 32-bit microprocessor composed of 2 fields: the first byte contains the opcode and remainder an immediate operand or an operand address. What is the maximum directly addressable memory capacity? Now the answer should b...
Characteristic (average) path length is defined here: https://cs.stackexchange.com/a/7538/20256 I want to establish upper and lower bounds on the CPL for a graph of $n$ vertices, and any positive number of edges, such that each vertex has a degree of at least 1 (i.e. the graph is connected). Assume that the graph is un...
Assume that we want to develop a warehouse management system, which picks up plastic boxes and stacks them on a pallet. A pallet has a maximum of 5 vertical box stacks and the maximum height of a box stack is 1400 mm. There are 3 box sizes with varying heights (other dimensions are the same). The heights of the boxes a...
A cryptographic function is homomorphic on some operation if that operation is preserved in the encrypted data. Such a function is homomorphic on addition modulo if the following holds for some cryptographic function $E$: $ E(x)\cdot E(y) = E(x+y\mod N) $ and on xor: $ E(x)\cdot E(y) = E(x \oplus y) $ This is called a...
Suppose you had a set $P$ of people. Every person $p_j \in P$ is familiar with atleast one other person $p_i$ (familiarity is symmetric). Is there a subset $S$ of people such that for $|S| \ge k$, no two people in $S$ know each other? Show that the problem is NP-Complete. Clearly this resembles the Maximum Independent ...
In the context of this statement, what does 'a & b are terminals' mean? Stacks and queues can be used for determining whether a particular input string is in the language or not. L = {a^nb^m | m,n >= 0, m >= n, and a & b are terminals} Sample strings in L : abb, aabb, aabbb Sample strings NOT in L : aab, ba
I hope this question is appropriate for this forum. In this summer I am giving a 3-day workshop on machine learning and neural networks for advanced and very enthusiastic high school students which all know at least one programming language. Typically a day consists of 2 hours lecture in the morning and later the stude...
I have a large list $L$ of numbers and I need to count instances of elements $a,b,c \in L$ such that $a +c = 2b$. A brute-force approach would be to check all possible triples $(a,b,c)$ and this will run in $L^3$ time. Can I do any better?
I have a (stupid ?) question about complexity theory. It's about a "proof technique". I want to compare 2 models of computation. I want to prove that for each langage recognized in polynomial time by a machine of the first model, there exists a machine of the second class that recognizes the same langage in polynomial ...
Consider two codes that do the same thing, in the same time and memory order, But they don't do it exactly the same way. Is there any Idea for a program to declare those codes as the same? For Example: Change Vars 1 a = a + b; b = a - b; a = b - a; Change Vars 2 int temp = a; a = b; b = temp; or consider two bubble s...
How come computer science books are so relaxed about specifying which set variables/values belong too ? I've read several books on algorithms like CLRS's Introduction to Algorithms, Sedgewick's An Introduction to the Analysis of Algorithms etc. How come these kind of books are so sloppy about telling which set value...
I am trying to implement a BTree in a pointer-free language as a proof-of-concept. However, a question came to my mind: every time I need to split a node, I need to do a deep copy of all the nodes in the (new) left sub-tree and right sub-trees, thus (I think) destroying the advantages of using a BTree. If I had pointer...
Suppose I have a large list of numbers that I want to divide into equal-sized buckets so that every bucket contains only larger numbers than buckets to its left. Numbers within each bucket don't need to be sorted. For example, for the input [64, 72, 57, 47, 5, 4, 64, 21, 64, 65, 36, 43, 81, 44, 19, 87, 17, 86, 73, 21...
So suppose that there is an undirected graph with edge connections known. Now in first-order logic there is quantifier $\forall x$. Then does this automatically refer to vertexes, or can we use relation like $v(x)$ to say that $x$ is a vertex?
This is am example of a RAM address in the MIPS architecture (32 bits) I can imagine the RAM as having 32 pins just to inform the RAM address I want to access, so I can access each of these words in the image (because I saw in this vídeo). I think, then, it should need another 32 pins to inform what's the word in that...
In the halting problem, we are interested if there is a Turing machine $T$ that can tell whether a given Turing machine $M$ halts or not on a given input $i$. Usually, the proof starts assuming such a $T$ exists. Then, we consider a case where we restrict $i$ to $M$ itself, and then derive a contradiction by using an i...
The harmonic representation of boolean functions such as XOR or AND has been studied in different course note lectures that can be found on Google. http://cs.mcgill.ca/~hatami/comp760-2011/ http://www.cs.cmu.edu/~odonnell/papers/analysis-survey.pdf What is the state of research on the representation of boolean function...
I was reading about decision trees and this is what I understood: We build decision trees by choosing an attribute and building subtrees (which are also decision trees) as children of the node representing that attribute. This means that as we go down, in building a decision tree, the no. of training instances that we ...
It seems to me that recursive equations can always be presented as inference rules. For the forward direction, an example is addition over Peono numerals (built from $O$ and $S(\_)$) $$ \begin{align} add(O, m) & = m \\ add(S(n), m) & = S(add(n, m)) \end{align} $$ which can be also presented as $$ \frac{ }{add(O, m)...
i have a directed graph. Basically, i have to find how many edges i need to change to opposite direction to make a path between 1 and n. So, i tried solving it by making the graph undirected and marking the directions as -1 or +1 and then going through all paths and finding which paths has minimum -1(s). I store graph ...
So in Neil Immerman's book http://books.google.co.kr/books?id=kWSZ0OWnupkC&pg=PA113&lpg=PA113#v=onepage&q&f=false, 3-colorability problem in descriptive complexity fashion is expressed as following: $\exists R \exists Y \exists B \forall x \left[(R(x) \vee Y(x) \vee B(x)) \wedge (\forall y) (E(x,y) \rightarrow \neg(R(x...
Suppose I have two stacks $<a_1,a_2,...a_m>$ and $<b_1, b_2,...b_n>$ and a third stack of size $m+n$. I want to have the third stack in the following manner, $$<a_1,b_1,a_2,b_2,...a_n,b_n...a_m-1,a_m>$$ for $$m>n$$ This was easy to do if the two initial stacks were not size constrained. But if the two stacks are size c...
From my understanding(correct me if I am wrong) when I read data from RAM memory it is copied into processor cache and than it is copied into register to be used by the processor. When I create data (like variable) is it first created in register and than copied to cache and from cache to RAM or is it directly created ...
The regularity condition of case 3 of Master Method says that $af(n/b) < cf(n)$, for $c < 1$. How to devise a recurrence relation that satisfies all other conditions of case 3 except the regularity condition?
I am using a transmission system that uses a Bloom filter (this part is out of my control). I want to send a small amount of data (32 bits) using this system. For each bit [0,31], I add its index to the Bloom filter if the corresponding bit is set. The Bloom filter is then transmitted without error and the recipient te...
I have the following question: Let $a,b,c,d$ be four natural numbers with $a \leq b$ and $c\leq d$. I have written a program that produces a list, which has as entries all 2-tuples $(x,y)$ with $x\in [a..b]$ and $y \in [c..d]$. Now, I have a new list, let's call it list_1. It consists of elements indexed by the $(x,y)$...
Let $M$ be a matrix of height $h$ and width $w$. Each entry of $M$ is an integer. There is a snake that starts from the "left side" of $M$, and its goal is to reach the "right side" of $M$. To get from one side to the other, i.e. to move from column $c$ to column $c+1$, the snake must choose an integer from both. Whate...
I'm trying to implement a feedforward neural network using a graph. The thing is: I haven't found any example in which is used a graph data structure. So far the examples I've found used arrays. Can anyone please point me in the direction of some literature on the topic or some tutorial?
A partition function computes the number of ways an integer $n$ can be represented as the sum of $m$ other integers. For some value $n$, we have a partition function $p(n)$. These were studied extensively in mathematics by MacMahon, Hardy, Littlewood and Ramanujan. Rademacher provided a way to approximating $p(n)$, imp...
Suppose I have a matrix $A$ with its entry $A_{ij}$ denoting some kind of distance between class $i$ and $j$, is there a feasible algorithm for computing a binary coding for all the classes, such that the Hamming distance between code word for $i$ and $j$ is (roughly) proportional to $A_{ij}$? A related question is tha...
Can anyone shed some light on how the VC Dimension affects the sample complexity bounds of infinite hypothesis classes with real-valued outputs in PAC learning, or how to calculate the sample complexity bounds of said classes with some other measure of the class's 'complexity'? I'm studying machine learning theory, par...
Can't seem to figure out the IP formulation for this. Question Suppose there are $n$ people connected in a circular fashion as demonstrated by the diagram. Individuals need to send packages to each other but can clearly only pass the packages in a clockwise or anticlockwise direction. Each person has at most one packa...
We have $16$ words of given length, let's say $W_1,...,W_{16}$ and I want to make an one dimensional matrix that will contain all the possible sums of $W_i$'s, for example: $W_1,W_2,...,W_{16}$ $W_1+W_2,W_1+W_3,...,W_1+W_{16}$ $W_2+W_3,...,W_2+W_{16}$ and so on, all the pair sums... then all the three sums $W_1+W_2+W_3...
I need to compute the permanent of a 10*100 matrix. All the entries are either 0 or 1. All I know is that I can compute the permanent of all 10*10 submatrices and then sum it to get the desired answer. But this involves 100C10=10^13 operations which is too much in my case. Is there a better algorithm for this task?
I was solving this question. It is as follows Joe picks an integer from the list $1,2,\cdots,N$ with a probability $p_i$ of picking $i$ for all $1\leq i \leq N$. He then gives Jason $K$ attempts to guess his number. On each guess, Joe will tell Jason if his number is higher or lower than Jason's guess. If Jason guesse...
when was the field of computer vision created and what are the disciplines that gave birth to it? I would appreciate it if you could give some web references that have the answer.
Suppose I have an application with two threads, which both use the same resource. Normally, a synchronized block keeps these threads from messing with the resource in a way the user doesn't expect. I understand why you do this, but I need an explanation how it is done, especially on the following part. How come acquiri...
Good programming practice distinguishes between specification (at the API level) and implementation. I would have thought that this same distinction would be found in type theory. Perhaps I just don't understand what I'm reading, but I don't see it. Apologies if I'm completely off (and corrections appreciated), but it ...
What would be the requirements for programming languages that are used for quantum computers? Do standard procedural languages with their constructs be sufficient, and succinctly capture the computing capabilities of a Quantum Computer? To illustrate, languages such as Assembler would most likely be closest to the hard...
Earlier, I asked a question defining disruption in Genetic Algorithms. Given that definition, I'm still confused on how to answer the following question. True or false? For 1-point and 2-point crossover, the schemata which have bits that are close together on the string encoding are more likely to b...
I found this question on the net and I'm wondering what is the process for answering such questions? I assume there is some formula that works for all graphs? 1.a. Consider the undirected graph with vertices $A$, $B$, $C$, $D$, $E$, $F$ and edges $AB$, $AC$, $BD$, $CE$, $DF$ and $EF$ (i.e., the graph is the 6-cyle $AB...
Can I use breadth-first search for topologicallly sort vertices and finding strongly connected components in a graph? If yes, how can I do that? If not, why? I tried with a simple acyclic graph of 3 vertices, gave the start and finish time as we do in DFS and then sorted them in non-increasing order. There was a confli...
Let $f:\Sigma^{*}\to\Sigma^{*}$ be a computable function and let $L$ be a recursive language. Is $f(L):=\left \{{f(w)|w\in L} \right\}$ recursive? Here, I see clearly, that $f^{-1}(L)$ is recursive (simply by applying $f$ on an input $w$, and then see if $f(w)$ belongs to $L$). My intuition tells me that $f(L)$ should...
In the paper "Heterogeneous-Race-Free Memory Models" [1], the authors state that a program consisting only of atomic is race free in SC-DRF but it is not in HRF-direct. I am not able to understand why this is. Can anyone explain how this can happen? [1] Derek R. Hower et al., "Heterogeneous-Race-Free Memory Models". In...
The Eulidean distance function $d$ of $x$ and $y$ is given by: $ d(x,y)=\sqrt{x^2-y^2} $ Let us assume that $x$ and $y$ are fixed-point numbers, or $x,y$ are element of some subfield $f_n$ of $F_p$. We could even assume that $x,y$ have precision $n$ decimal digits. Any facilitating representations of rational or real v...
I am working on aggressive driving behavior android application. This will be implemented via supervised learning, wrong actions will be recognized and added while driving the car. To check aggressive turns i am using centripetal force. When exceeds set force, wrong action will be detected. I want to check if the acce...
we know this definition: Given a binary tree, Width of a tree is maximum of widths of all levels. Let us consider the below example tree. 1 / \ 2 3 / \ \ 4 5 8 / \ 6 7 For the above tree, width of level 1 is 1, width of level 2 is 2, width of level 3 is 3 width of l...
Why an evaluation of Turing machine efficiency is equal to the algorithm which is implemented by this machine and vise versa? For example, we can say that efficiency of merge sorting algorithm is O(nlog(n)) and therefore Turing machine which implements this algorithm will do O(nlog(n)) steps. Why is this conclusion cor...
Suppose we have a circular linked list that has nodes $1$ to $n$. L is a pointer that points to node 1 (with label $1$). Note i has a link to i+1 and we have a link from node n to node 1 because the list is circular. Now we have following pesudo-code: Int SO(LIST *L) { While ( L->Next != L ) { L->Next = L->Next...
What's the language of following grammar? $G: S \to S_1B$ $S_1 \to aS_1b$ $bB \to bbbB$ $aS_1b \to aa$ $B \to \lambda$ any hint or solution?
We know $L_1=\{w_1 w_2 \in (a+b)^*\mid |w_1|=|w_2|, w_2 \neq w_1^{\;\mathrm{R}}\}$ is a context-free language. Can anyone help me produce a PDA or give me any hint how I can quickly understand why this is context-free?
The paper by Spielman and Teng, Smoothed Analysis of Algorithms: Why the Simplex Algorithm Usually Takes Polynomial Time (JACM 51(3):385–463, 2004), won a Gödel award in 2008. Since then, has there been a monograph or substantial survey paper written on the subject? The best I could find was a book chapter in Algorithm...
For Hoare's partitioning algorithm quicksort is implemented as such quickSort(array, first, last) if(last > first) pivot = partition(array, first, last); quickSort(array, first, pivot); quickSort(array, pivot+1, last); but Lomuto is quickSort(array, first, last) if(last > first) ...
I recently faced this problem in a programming contest: Given 3 square matrices N x N of size N up to 1000. All elements in 3 matrices are from 0 to 9. Check if matrix A x B equals to C, mod 10. In other words, return the result of expression (A x B) mod 10 == C. For example: $\qquad A = \begin{bmatrix} 0 & 5 & 8 \\ ...
Probabilistic algorithms often have a parameter that allows one to tune the error rate, typically by running the algorithm repeatedly. This often gives an error rate of something like $2^{-k}$ for $k$ iterations. This is a fine situation to be in, because $2^{-k}$ can be made as close to $1$ as you like without having ...
I know that they both have reference bit, but I only understand the Second Chance but not the Clock Page-Replacement algorithm. could anyone help me understand?
My field of research is not Database or AI. But I have some problems to solve, and would like to know which branch this kind of problems belong to, and what are the results. The main question is: given a table of data, there are lots of possible queries that can be made. But some queries are meaningful, some are meanin...
There is a classic puzzle book game very similar to a crossword puzzle, except a list of words is given and then a $N \times N$ square board made up of unit squares is given, with some squares blacked out just like a cross-word, and some squares have a letter already pre-written in them. The goal is to write each word ...
Is ```sii``sii the smallest Unlambda program that doesn't halt? In other words, what is the smallest non-terminating combinator term in SKI augmented with $C$ (call/cc) and $D$ (delay)? Is it $SII(SII)$?
I am trying to use the genetic algorithm to optimise a multi-layered neural network for image classification (i am using a subset of the MNIST handwritten digit data set as my initial dataset, but eventually would like to make it more general). my neural network is represented by connection weight matrices with inputs ...
I've been solving some exercises recently and it appears my answer was wrong for this particular example. The task is to convert this NFA into a DFA: My attempt is this: Now the tool I'm using (Exorciser) says that there is still nondeterminism in the automaton (even though it's equivalent to the original). I don't s...
The complexity of the below program is given to be O(n!) double foo(int n){ int i; double sum; if(n==0){ return 1.0; } else { sum=0.0; for(i=0;i<n;i++){ sum+=foo(i); } return sum; } } But I could determine its complexity as O(n!). Can anyone explain how is it coming to be O(n!)? Is it Θ(n!...
Could anyone suggest other page replacement algorithms that are applicable to the real world aside from FIFO, Second Chance (Clock), Enhanced Second Chance and Random?
I was just thinking about this: Does the BIOS execute on the CPU? If so, how does it handle multiple CPU architectures/instruction sets? If not, what does it execute on?
Many (and I suspect all) abstract data types in CS correspond to some math concepts, and even share the same names, for example, set, map, record/tuple, .... As abstract data types, what do queues and stacks correspond to in math? For example, some special paths in graph theory? Have stacks and queues been treated mat...
I have read some books and wikipedia, which seem to give not completely consistent definitions and notations. I try to understand the concepts, regardless of what they are called. Here are what I have figured (please correct me) and would like to ask : a (abstract) data type is a set $D$ of values, together with some ...