instruction stringlengths 35 11.4k |
|---|
0 0
1 1
1 0 2
1 0 0 4
1 0 1 5
1 0 0 0 8
1 0 0 1 9
1 0 1 1 11
1 0 0 0 0 16
1 0 0 0 1 17
1 0 0 1 1 19
1 0 1 0 1 21
1 0 1 1 1 23
1 0 0 0 0 0 ... |
Let $A$ be an array of size $n$, and $f(i, r, a_r)$ be the number of indices $k$ such that $a_k$ = $a_r$ and $i \le k \le r$.
Example to clarify:
Imagine the array: $[1, 2, 3, 2, 2, 3, 4, 5]$. $f(0, 3, a_3)$, for example, would be equal to 2, because there are 2 elements in the array that appear before $a_3$ (which ... |
Some chap said the following:
Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin.
That's always taken to mean that you can't generate true random numbers with just a computer. And he said that when computers were the equivalent size of a single Intel 8080 mi... |
Given a rooted tree with $n$ weighted nodes and a number $1\leq k\leq n/2$, what is an efficient algorithm for finding a subset of the nodes having
$k$ elements
no node being an ancestor of another
maximal sum of the weights (among all subsets fulfilling the previous two conditions)
Edit: Comments suggest dynamic pro... |
Is it possible to write a 1-tape Turing machine in order to simulate a deterministic PDA? How would this be done?
|
Is the following problem in P?
Does a graph $G$ have $3$-colouring, where each colour is used exactly $|V|/3$ times?
I believe it is as we are trying to sample three sets (one for each colour) of vertices without replacement, giving a running time of $O(|V|^5)$. The first set is for three colours, the second for two an... |
My question is exactly what the title says. If I have that $f(n)=\omega(h(n))$ and $g(n)=o(h(n))$ hold, then does $f(n)=\Theta(g(n))$ hold as well? My intuition says that the second part is false, but I couldn't put this idea on paper.
|
How do I solve the following recurrence relation?
$$
T(n) = 1 + \sum_{j=0}^{n-1} T(j).
$$
I thought of solving it by generating its recursion tree. I found that the height of the tree would be equal to $n$ but wasn't able to find the cost of each level.
|
In my college course notes, we are given two examples.
Example 9.1.1:
$$ M(K, \Sigma, \delta, s) $$
where
$ K = \{q_0, q_1\} $
$\Sigma = \{a, \# \}$
$s = q_0$
$ \delta = \begin{array}{|c|c|c|c|}
\hline
q & \sigma & \delta(q, \sigma) \\ \hline
q_0 & a & (q_1, \#) \\
q_0 & \# & (h, \#) \\
q_1 & a & (q_0, a) \\
q... |
I'm having a rough time understanding the Rank Selection method for Genetic Algorithms. Here is what I think it does:
Tour1's Fitness: 0.87
Tour2's Fitness: 1.22
Tour3's Fitness: 1.03
Tour4's Fitness: 0.58
We rank them using their fitness:
4) Tour2 -- Highest rank (N)
3) Tour3
2) Tour1
1) Tour4 -- Lowest rank (1)
... |
Say we have a function called GenBiasedBit. This function returns 1 with probability p (where p is an unknown real number between 0 and 1 exclusive) and returns 0 with probability 1 − p. How could I write a Las Vegas algorithm (called GenUnbiasedBit) that returns 1 or 0 with equal (nonzero) probability, using calls fro... |
Say that I have a superscalar processor and I am given the latency, issue and capacity (in clock cycles) for different instructions.
What is the general formula for latency bound and throughput bound? (I will convert to cost per instruction and billion instructions per second)
This field seems to be too niche to find i... |
The question:A directed graph is doubly connected if every two vertices are connected by a directed path in each direction. Let DCG = {| G is a doubly connected graph} Prove that DCG is NL-complete. (You may use the fact that PATH is NL-complete.)
PATH = {: G is a directed graph with a path from s to t}
My attempt:
to ... |
I want Regular Expression for language L defined over {a,b} and L does not contain substring 'bbb'. I tried something but could not get proper answer.
|
I'm studying for an exam and came across this question. I feel like it's much simpler than I am making it out to be, but I'm not sure.
Suppose we have a corpus in which Zipf’s Law holds. If the most frequent term occurs one million times, and the next most frequent term occurs 250,000 times, how often should we expect ... |
In "The Complexity Theory Companion" Hemaspaandra and Ogihara define an oblivious oracle TM as an oracle TM where the queries are dependent on the input and not on the oracle. They then show how to turn an oracle $\mathbf{NL}$ machine into an oblivious one. I wanted to know whether this construction will work for other... |
Parsing s-expressions is almost trivial. This is true for both automated processes (and thus implies ease of implementation of such processes) and for a human readers of printed s-expressions. It is the latter property that is the subject of this question.
The main cause for this simplicity is the one to one correspond... |
I was presented with the problem of breaking the unit cube $[0,1] \times [0,1] \times [0,1] $ into tetrahedron shapes. The first two pieces are easy, but it's not so easy to visualize after that. I found:
$\{ (0,0,0), (1,0,0), (0,1,0), (0,0,1) \}$
$\{ (1,1,1), (1,1,0), (1,0,1), (0,1,1) \}$
What remains is a triang... |
I have a set of 3 elements and need to generate a randomized sequence containing each element n times with the condition that one element can only occur m times in a row.
So with elements [0,1,2] n = 4 and m = 3:
[1, 2, 0, 0, 0, 1, 1, 2, 2, 2, 0, 1] valid
[1, 2, 0, 0, 0, 0, 1, 2, 2, 2, 1, 1] invalid
The only solution... |
Imagine this game. I pick a permutation $p$ of $1..n$ and give you an oracle. When the oracle is queried with any sequence of $n$ numbers $\in 1..n$, it masks each number by applying some unknown bijection $f$ and then permutes the masked values using $p$. Your goal is to repeatedly query the oracle to recover $p$ with... |
I am working through the Russell and Norvig AI book and came across the following on the top of page 706.
The section concerns Decision Tree pruning and testing a given attribute against the null hypothesis. The example at hand deals with a binary decision tree and $p_k$ denotes the number of positive ("yes") responses... |
Yesterday I found a question here, that asked, if the value of the flow across the edges of the MinCut is at capacity.
I think the question has been deleted.
But I want to confirm that for the edges that are on the MinCut, after the MaxFlow is found, their flow values will either be zero or equal to their full capaciti... |
This is an exam question from my algorithms and data structures course.
You imagine an hash function with h: U->{0,..m} (this is from the original question, but i think m-1 would be correct) and n values to hash.
You want to keep the expected number of collisions below or equal to 1.
How do you determine m in dependenc... |
What would be the complexity of the following recurrence?
$$T(n) = 2T(n-1)$$
|
How can we construct an algorithm which finds $\mu$ that minimizes $\max | x_i - \mu |$ in a linear time for an array of numbers $[x_1, x_2, \ldots, x_n]$?
I take $g = \max_{i\in \{1,\ldots,n \} } x_i$ and $l = \min_{i\in \{1,\ldots,n \} } x_i$, and $\mu = l + \frac{(g - l)}{2}$
Is it true and why it minimizes the func... |
In theory operating system is a special program run by itself without help so that also mean normal program can still run by itself mean that the need for api is not must have so finally can we have an os without api ?
|
The following program implements a simple algorithm for binary multiplication:
-- Numbers as infinite streams of bits, least significant bits first
data Bits
= O Bits
| I Bits
-- Increments a number
suc :: Bits -> Bits
suc (O xs) = I xs
suc (I xs) = O (suc xs)
-- Adds two numbers
add :: Bits -> Bits -> Bits
add (... |
Entropy is the randomness collected by an operating system or application for use in Cryptography or other uses that require random data. The formula for Entropy is $$H(p_1, ..., p_k)=-\sum_{i=1}^{k} p_i\log_2(p_i)[bit]$$
So if I were to calculate the Entropy of a coin toss. it would be
$$H(\frac{1}{2}, \frac{1}{2})=-... |
An Associated cache and one million word main memory are divided into 256 word blocks. How many blocks are there?
|
I have seen many problems in graph theory and in other related fields which admit a sublinear (in input size) running time $\mathcal O(n^{1/2})$ algorithm, where $n$ is the input size. I am not sure but to me it seems that fine grained complexity may be one possibility to prove that there is no algorithm with running ... |
I've been trying for hours to figure out, how to form a CFG describing this language $L$:
$$L=\{ w\in\{a,b\}^* \mid w\text{ is of the form }a^nxb^{n+2}\text{, where }x\text{ is a string of length }3\text{ in }\{a,b\}^* \}.$$
The problem I'm having is related to the first $n$ of $a$'s. I can't wrap my head around how c... |
I'm looking for some pointers on proper mathematical (FP?, category-theory?) terminology.
My apologies if the below is somewhat imprecise; I suppose the precision is precisely what I'm looking for in the answer.
Say you have a particular Abstract Syntax Tree. Now you also have some editor that allows you to annotate ar... |
Is there any automaton (or automaton translation) as expressive as LTL that can only read disjunctions of atomic propositions per each transition? Standard LTL-to-automaton algorithms allow the automaton to read conjunction as well as disjunction of atomic propositions.
|
I'm looking for a optimization problem on planar graphs which is APX-hard, which means that it doesn't admit a PTAS (approximation scheme). It would be even better is the difficulty of the problem does not depend on some weight value but only on the structure of the graph (because in this case it's probably possible to... |
In the book Handbook of Data Structures and Applications, section 5.2.5, (copy of the relevant section available here) about leftist queues, the author(s) state the following:
For the complexity analysis of of the initialization operation, assume, for simplicity, that n is a power of 2. The first n/2 melds involve max... |
I want to create an algorighm (with dynamic programing) similar to 1/0 knapsack problem but, I have one extra condition isVegetable or isFruit.
Assume we have N food items where we know number, weight, value, 0 || 1 where 0 means isFruit and 1 meas isVegetable. We have two conditions, one is max knapsack weight and se... |
Here is a lower bound proof for the comparison-based sorting problem:
Any comparison-based sorting algorithm can be considered to work by putting elements into their final positions one by one (Take the last time one element is put into its final position.).
To put the element $e$ which is the $i$-th one being put int... |
I am trying to find the relation between the vertical displacement of an object to the depth of the object.
Say, there is an object in an image and as the center of gravity of this object moves vertically upwards, we know that it is moving away from the camera.
We know at the same time, that the dimension of the image... |
In a modern instruction set like x86-64 there are many many many ways to accomplish the same task using a series of old simple instructions all the way up to the complex SIMD instructions. If one wanted to determine the semantic equivalence of a series of instructions, could this be done rationally or must it only be d... |
I'm trying to understand how A* works on some simple examples, and something struck me as odd. I could fairly easily come up with situations in which A* "failed". Here is an example:
Take a 2x2 grid, in which you can only move in one of 4 (orthogonal) directions (no diagonal movement). Denote the node at (0, 0) by A, t... |
On a 2d plane, there is a large circle centered at $(0, 0)$ with a radius of $R_{{o}}$. It encloses $\sim 100$ or so smaller circles distributed randomly across the parent circle otherwise with known radii and positions with respect to the origin. (It is possible that some smaller sub-circles are partially or entirely ... |
Run-Length Encoding is the simple form of lossless data compression in which compression in which runs (execution) of data are stored as a single data value and count rather than as the original run (execution).
Now the definition is there but what's an intuitive way of thinking about this?
|
The number of parameters a function has (and thus the number of arguments it can take) is known as arity. What is the name for the number of values a function returns? I'm not asking for the "size" of a function's return values. A function returning a tuple returns a single, composite, value.
|
I have no cs background (algorithm and data structure), but need to find a data analysis related job since my major is math / statistics. However, (I am trying to avoid software engineering related jobs) no matter which position I applied, from finance to bioinformatics, almost every technical interview involves hash t... |
On page 383, section 10.2. of the Algorithms for Planning as State Space Search chapter of the textbook Artificial Intelligence: A Modern Approach, the following passage appears:
In this passage, the authors write that in the air cargo example they use there are $50^{10} \times 200^{50+10} \approx 10^{155}$ states.
I... |
I'm trying to improve my skills in analysis of algorithms. I think Sedgewick's "introduction to the analysis of algorithm" is a good, I'm reading carefully the first chapter, at least I'm trying. And the following is mentioned:
The first, popularized by Aho, Hopcroft, and Ullman and Cormen,
Leiserson, Rivest, and St... |
In this figure x,y,z are the nodes on which rotation is performed and T1, T2, T3, T4 are the subtrees.
I have understood how the rotation is working and have no trouble with that. The problem I am having is determining the final balance factor of nodes in the tree.
In the first case before rotation, the balance of fac... |
Background
Good-Turing (GT) smoothing is used in language models to estimate the counts of words in the test set that have not been seen in the training set.
In GT smoothing, $N_c$ is the count of things observed $c$ times (so a count of a count). As an example, the sentence "Sam I am I am Sam I do not eat" has unigra... |
I'm currently preparing for an exam in compiler construction. The course is mainly about optimization in the backend of the compiler. For the optimization we have to do data flow analysis by hand.
In one example I do not understand how gen and kill sets are determined. My solutions differ a lot although I stuck to the ... |
There is a theorem that states that arithmetic is undecidable: i.e. $Th(\mathcal N)$, the set of all sentences in the standard arithmetic structure $\mathcal N=(\mathbb N,+,\cdot , 0,1)$ where the symbols are interpreted in the standard way, is undecidable.
Godel's first incompleteness theorem states that there does ... |
I came across this problem that asks you to implement a regular expression matcher with support for '.' and '*', where
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa", "a*") → true
isMatch(... |
We have given array of $n$ integers in the range $[1, k]$. We want to design algorithm that can modify the array and also find the length of the shortest subarray containing at least one of each integers in the range $[1,k]$. $k$ can go up to 50, but $n$ can be large number, up to 100000.
I know that the offline versi... |
Given a digraph $G$ and $f, g : E(G) \mapsto \mathbb{R}$, how would you find a cut $(X,\bar{X})$ with $s \in X$ and $t \in \bar{X}$ such that $\sum_{e \in \delta^+(X)}{f(e)} - \sum_{e \in \delta^-(X)}{g(e)}$ is minimized?
$\delta^+(X)$ is the set of edges going out of $X$ and $\delta^-(X)$ is the set of edges going int... |
Given a graph $G$, I want to find a shortest tour visiting each vertex. Different to the classical formulation of TSP, my tour needs to be divided into several subtours, each upper-bounded by a certain length. We can imagine that the salesman needs to return to the starting point to refill its car. The problem is to fi... |
I have to build a simple publish-subscribe system in say C++ for example that can handle multiple subscriber. I have never done anything like that although I have made HTTP server and client, but not a publish subscriber system so I thought to ask few questions here first. I know I am reinventing the wheel but I need ... |
Given an directed acyclic AND-OR graph, where each non-terminal nodes are labelled as either AND or OR. The terminal nodes are the nodes which have no outgoing edges. Children of a node are the vertices all the outgoing edges of the node points to.
A solution graph for a node $S$ on an AND-OR graph $G$ is defined as a ... |
I have the phrase "abracadabra" and I want to encode it through the Huffman method. I first took the frequencies of each letters;
$$a=5$$
$$b=3$$
$$c=1$$
$$d=2$$
$$r=2$$
But I'm not sure as to how the diagram should look like. I made a few and some of them are correct. Also what determines the direction the branches ta... |
I was reading up on finite automata and I came across an interesting fact near the end of the Wikipedia page.
The classic example of a simply described language that no DFA can
recognize is bracket or Dyck language, i.e., the language that
consists of properly paired brackets such as word "(()())".
Intuitively, ... |
Because os is a special kind of program so does that also mean a normal program can run without os ?
|
Wondering how to represent a map object such as the following mathematically:
var foo = {
a: 10,
b: 'bar',
c: true
}
You could say that it was a function like this:
foo(x, y, z)
where $x$ is an integer, $y$ is a string, and $z$ is a boolean. But the question then is how to say the names of the keys a, b, c. Som... |
I have a directed graph, which can be cyclic, where each node contains a value.
Nodes are not labeled, and different nodes can contain the same value.
The outgoing edges of a node are ordered, or labeled, (1, 2, 3, ... N), where N is the number of outgoing edges from the node. (That is, it's a k-ary tree, if such a te... |
We know that the halting problem $A_{TM}$ and the diagonal language K are mapping reducible to each other. Furthermore both are complete with respect to the mapping reduce relation.
I would like to prove that any r.e. language is mapping reducible to K directly without reducing to $A_{TM}$. How can this be done?
|
I know that the answer is no but I'm not sure why. Here's where I started. We know that all data with length $n$ Bits and minimum $1$ Bit can be compressed, either lossless or lossy. But how do I continue? Why is it impossible to compress all the data without loss?
|
Wondering what algorithms look like for implementing a complex JOIN query handler. Taking a look at this paper Building Query Compilers they talk about Query Graphs and Join Trees and Cost Functions for determining how well join trees are when the engine figures out how to organize the steps in the query.
What I'm part... |
I'm doing some Automata Theory exercises through a book and I'm trying to solve the exercise below but I can't figure out how to solve it.
Construct a regular expression that describe the following language given the alphabet $\Sigma = \{0, 1\}$,
$$A = \{w \in \Sigma^ * : |w|_0 = |w|_1 \}\cup \Sigma^*\{00,11\}\Sigma^*.... |
The top two competing entropy coders at the moment are Arithmetic Coding (AC) and Asymmetrical Number Systems (ANS).
A very interesting difference between the two is that AC is FIFO and ANS is LIFO. That is, in AC the first symbol you encode into the bitstream is also the first symbol you decode. However with ANS the l... |
Working on some cs theory and solving a problem on computationally [=recursively] enumerable languages:
A language $A\subseteq \{0,1\}^*$ is co-c.e. if and only if there is a decidable language
$B\subseteq \{0,1\}^*$ such that, for all $x\in\{0,1\}^*$,
$x\in A \Leftrightarrow (\forall w\in \{0,1\}^*) \langle x,w\r... |
Calculating hashes for nodes in an acyclic graph is well known using a Merkle tree.
With some simplifying assumptions, a simple algorithm will also calculate hashes for nodes in a cyclic graph... but it runs in quadratic time, making it impractical to use except for very small graphs.
Is it possible to do better?
Graph... |
In a doubly-connected edge list (DCEL) data structure, each vertex v stores a pointer to one arbitrary half-edge, v.inc, which has v as its origin, that is, v.inc.origin == v. However, there may be multiple half-edges which have v as its origin.
How do I access or iterate all half-edges which have v has their origin?
|
I have an example question from a textbook where it asks to prove that $\Sigma_k DTIME(2^{n^k}) \neq DSPACE(2^n)$.
There isn't a solution provided in the textbook. I've been working with a solution involving padding but I haven't been able to come up with a solution.
Any tips would be appreciated! Thanks in advance.
|
How do I calculate the time complexity of the following method? Would you please provide explanation? I know it's going to involve sqrt(n) * <something>. I Just don't know what that <something> is.
public void timeComplexity(int[] arr){
int n = arr.length;
int sqrt = (int) Math.sqrt(n+1);
for(int i=2; i<sqr... |
I'm implementing Parberry's algorithm for closed Knight's tour problem.
Brief idea of the algorithm: split the board in $4$ parts, find the tour on them recursively then delete $1$ edge in each part and add $4$ edges that
will connect each part with two adjacent parts.
At the end of page 5 (of the pdf viewer) the aut... |
Consider an undirected network $G = (V,E)$ in which edge $e$ $\in$ $E$ fails after (deterministic) time $t(e) > 0$. Network failure occurs at the first instant in which $G$ is no longer connected. Let $m = |E|$ and assume the values $\{t(e): e \in E\}$ are distinct.
You wish to determine the instant $\tau$ at which th... |
The time complexity of Fleury's algorithm is $O(|E|^2)$ because for each edge I have to check whether it is a bridge or not and that takes $O(|V|+|E|)$ time. But, instead of that if I store my bridges in a hash table by a traversal at the beginning and then print the Eulerian tour (checking for each bridge in $O(1)$ us... |
I have a problem that is similar to the interval scheduling algorithm but it involves priorities. My data sets consist of the following data:
Cars with the start and end time of parking, along with their one or more attributes (e.g. electric vehicle, motorcycle, handicapped).
Parking spots along with zero or more attr... |
Let us assume we have a program of size $k$ that solves any instance of SAT of size $N < n$ in $poly(n)$ time. For every input of size $N \geq n$ the program is allowed not to solve it.
Then we might imagine an infinite sequence of programs of sizes $k_0 \leq k_1 \leq\ ...\ \leq k_i\leq\ ...$ which solves SAT up to the... |
I am working on a mapping reduction problem. Define the union of two languages $L_1,L_2\subseteq\{0,1\}^*$ to be $L_1 \cup L_2 = \{x0\mid x \in L_1\} \cup \{y1\mid y \in L_2\}$. I want to prove that $L_1 \le_m L_1 \cup L_2$.
I was reading about the mapping reduction. According to mapping reductions, for any $w \in \Si... |
Consider the following pseudocode:
int divide(int l , int r){
if r - l > 3 then
mid = (l + r) / 2
divide(l , mid)
divide(mid + 1, r)
return merge(l, mid, r)
else
return bruteforce_solution(l, r)
}
If merge function takes $O(n^2)$ time, then total complexity can be found ... |
How we compute the computation complexity of an exponential function like $a^x$ where $a,x \in \mathbb{Z}$ with $|a|=l$ bits and $|x|=m$ bits?
Can anyone please explain using big notation?
|
From R.Sutton's book, the eligibility trace update rule is:
$$
E_t(s)\leftarrow\gamma~\lambda~ E_{t-1}(s)+\mathbb{1}(S_t=s)
$$
I wonder why do we need both $\gamma$ and $\lambda$ to assign credit to most recent states.
|
I've been reading about count-min sketch and I'm interested in the performance of this data structure when doing conservative updates. To my understanding from the Wikipedia article, conservative updating means that when you see an item, instead of incrementing all the counters you only increment the counter(s) that ha... |
I need to proof if that it's true or not. $ (G^R)^* = (G^*)^R $
If $G$ is a CFG and $ G = \langle V, \Sigma, \delta, S \rangle $ where
$ V $ = Set of Variables or Non-Terminal Symbols
$ \Sigma $ = Set of Terminal Symbols
$ \delta $ = Set of Production Rules
$ S $ = Start Symbol
By def.
$$
G^R = \langle V \ ,\ \S... |
It is well known that the problem of counting the satisfying assignments of SAT, namely the problem #SAT, is #P-complete.
It is also suspected (somewhat less widely) that even deciding SAT should take time $2^{n-o(n)}$ according to the strong exponential time hypothesis.
I was wondering if there are any hardness resu... |
Consider a standard enumeration of Turing machines ($T_0, T_1, T_2$, ...).
Then, let language A be defined as $A = \{n \in\mathbb N | T_n(\lambda) \downarrow\}$.
I need to reduce it to the halting problem (let's call it $K$). So, I want $K \leq_m A$ (mapping reduction).
I know that mapping reduction is based on the ide... |
Let $T=(\mathcal{V},\mathcal{E})$ be an udirected acyclic graph and $|\mathcal{V}|=n$. Let $\mathcal{V'}$ be $\mathcal{V'}\subset \mathcal{V}$ where $|\mathcal{V'}|=2m\leq n$. There are $2m \choose 2$ pairs of nodes in the set $\mathcal{V'}$. For each pair of nodes $(w,w')$ in the set $\mathcal{V'}$, there is a unique ... |
Converting the following NFA to Regular Expression.
Quick question:
Do I have to add a new initial state as Q1 is accepting an incoming edge with 0+1 from itself?
Method used:
State elimination method
|
I've search on Google but still don't understand. I've read about it into arm book, but they don't define it.
Could you explain me what is it, where is it used, what's the point to have it and, if you can, its used into arm chips.
Thanks.
|
I am preparing class materials for the applied statistics class for Ph.D. students and want to present them with examples of bad statistics in different fields of computer science. I am especially interested in the examples form the sub-fields represented in our department:
CHI
MIS (with focus on qualitative methods a... |
I want to calculate the Entropy of the phrase "Eile mit Weile". I found the probability of each letter as the following
$$P(e)=\frac{4}{12}$$
$$P(i)=\frac{3}{12}$$
$$P(l)=\frac{2}{12}$$
$$P(m)=\frac{1}{12}$$
$$P(t)=\frac{1}{12}$$
$$P(w)=\frac{1}{12}$$
Then I used the formula for entropy
$$H(p_1,...,p_k)=-\sum_{i=1}^{k... |
Firstly, I am trying to understand the meaning of LCA in DAG. I read a definition somewhere-"Define the height of a vertex v in a DAG to be the length of the longest path from root to v. Among the vertices that are ancestors of both v and w, the one with the greatest height is an LCA of v and w."
In a graph like this 1... |
How can I prove that if $T(n) = \sqrt{n}T(\sqrt{n}) + n$ then $T(n) = \Theta(n\log\log n)$?
I tried to define $T(n)$ by $G(n)$, prove about $G(n)$, and then to return to $T(n)$, but it's not working..
|
The number of computations of an algorithm is $n'm\sum_{x=0}^{n'-m} 1/(m+x)$. What is the complexity of the algorithm ?
Thanx for help.
|
I'm wondering if its possible to express the time complexity of an algorithm that relies on convergence using Big $O$ notation.
Is it fair to say that we can't reason about an algorithm's scalability based on input size if we also have to rely on convergence - unless there's some facet of the algorithm's manner of conv... |
Why does the circuit value problem run in log space on an alternating Turing machine? It is claimed to be so in my university's lecture notes. Also, it is claimed that monotone circuit value problem has the same space complexity on an alternating Turing machine.
I think it requires at least linear space because it need... |
You are given an unsorted array of all the integers in the range $0$
to $n = 2^k -1$ except for one integer, called the missing number.
Find a divide and conquer algorithm to find the missing number in time
$O(n)$. If you wish, you may use the fact that an algorithm
$median(A)$ exists that can find the median ... |
Historically, what has happened is the following:
There is a "mechanical" structure, most importantly, arithmetic, which operates according to a set of well-defined rules that a stupid computer can easily follow. e.g. a computer can easily calculate $5349\cdot 5345=...$
There is a "mechanical" proof-system, most impor... |
Does there exist a computable function $f:\mathbb{N}\rightarrow \mathbb{Q}$ such that:
For all $t\in\mathbb{N}: 0\le f(t) < X$
$\lim\limits_{t\rightarrow\infty} f(t) = X$
Where $X$ is an uncomputable real number.
The only reference to this question I have found was the answer to this question: https://math.stackexch... |
So in the book that I'm reading it says at a time only the data of one register can be on the data bus and only one register can load the data. the first part i get but what about the second part?
why can't we just turn on the load parameter for both of the registers at the same time?
I'm studying for computer architec... |
Could a standardized ternary (base-3) system be more efficient than the binary (base-2) system? Binary is efficient for processing using logic gates, but can be bulky when using for file storage or file transfer. I am interested in the feasibility of a ternary system both for file storage, file transfer, and computatio... |
I took an extremely interesting intro to CE course, learning about transistors/memory/logic gates up to LC-3 assembly. Something that was really interesting to me was learning about how a processor's frequency is its speed, determined by the clock signal (if anyone can point to a link of how a clock cycle is made/works... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.