instruction stringlengths 35 29.1k |
|---|
I have tried to calculate average waiting time for the below details there are two answers I'm getting using two methods I'm not understanding which one is correct?
The time quantum is 2
This is the first method:
Process Id Arrival Time Burst Time
P0 0 5
P1 ... |
I can encode booleans in pure lambda calculus like this:
type Bool = forall t. t -> t -> t
true : Bool = \x y -> x
false : Bool = \x y -> y
Is there a procedure to optimize the following "dumb" function
dumb = \(b : Bool) -> b false false
to
dumb = \(b : Bool) -> false
I can imagine this is quite easy in Haskell w... |
Sometimes I read that an algorithm works on constant size alphabet and it is clear for me but what means that an algorithm works with a non constant size alphabet? I would like to see an example.
|
Suppose we have 2 lists:
List $G$: the goal, contains goal items each comes with a specific amount,
$$G = \{i_1 \times Item_1, i_2 \times Item_2,\dots, i_n \times Item_n\}$$
List $I$: a list that contains lists of items each also comes with a specific amount,
$$I = \{\{j_1 \times Item_1, j_3 \times Item_3\}, \{k_2 \tim... |
A $n$-item list can be verified as sorted by comparing every item to its neighbor. In my application, I will not be able to compare every item with its neighbor: instead, the comparisons will sometimes be between distant elements. Given that the list contains more than three items and also that comparison is the only s... |
Introduction
For those who did not read my prior question, I have created an algorithm that generates n^2 x n^2 Sudoku Grids. Out of those grids I remove elements to give only one solution. The algorithm follows an infinite language based on circular matrix shift of elements. It does so in such a way that allows valid ... |
Let $G_n$ be defined by
$$G_n = \begin{cases} 1 & n=0 \\
2 & n = 1 \\
3 & n = 2 \\
4 & n = 3 \\
2G_{n-1}-2G_{n-3}+G_{n-4} & n\geq4
\end{cases}$$
How can I prove that $f(n) = n$ is a bound function (or loop variant) for the above sequence?
|
Let's assume we have an operator
$$ \times: E^2\to E$$
of which we merely know that it is associative. Let's say a multiplication $e\times f$ always takes up a time of $M$ for all $e, f\in E$.
We're now given $n$ elements $e_1,...,e_n\in E$, and are tasked to calculate all $n$ products
$$\def\bigtimes{\mathop{\vcenter{... |
Given an oracle that returns both the length and the subsequence for the Longest Increasing Subsequence of a given input $A$ of $n$ elements $\text{LIS}(A,n)$, can one use a polynomial number of calls to it to find the length of the Longest Common Subsequence of two sequences $A$ and $B$ ($\text{LCS}(A,B)$)? If so, how... |
"Isomorphic" is defined as having the same shape of syntax trees and the same bindings of variables. However, the variable names might be completely different. In other words, it is to say that we have a graph isomorphism between the two expressions (the graph being the syntax tree with variable linking included as edg... |
Consider undirected graph with $O(n)$ nodes and $O(m)$ edges. We store the edges in adjacent list, so for each node we keep list of the nodes such there exist edge between those nodes.
Our search goes as follows: For each node in the graph (let it be i) we iterate over all pairs of nodes(let it be $n_1 \text{ and } n_2... |
I have done some projects using haar cascade(Ex.- Face-detection,Eye inside face detection,shoe detection etc), I also have some knowledge about it. I have trained my own models learning from youtube, this site etc.
Now I want to take it to the next level.
I want to detect facial landmarks, I have used different modul... |
There are $N < 3\times10^4$ 3D points. At least 50% of them lie approximately in the same plane, i.e. the distance between the plane and each point is at most $p$. Find such a plane.
Attempt: since the number of points in the plane is at least 50%, we can randomly sample 3 points from the set. They will all be in the... |
I want to implement the function $f(x,a,b) = a + x(b-a)$ where all the inputs are floating point (doubles, say), such that (a) $f(0,a,b)=a$ exactly; (b) $f(1,a,b)=b$ exactly; (c) $f(x,a,b) \le f(y,a,b)$ whenever $x \le y$; and preferably (d) it is accurate (correct up to rounding) for $0 \le x \le 1$.
Implementing $f(x... |
I was asked in an interview the following question:
We'll define the "Finishing the degree in three years" problem in the following manner:
Given a list of courses $C=\{c_1, c_2,\ldots, c_n\}$, where every course $c_i\in C$ is given a list $R_i\subseteq C$ of the precondition courses for this course, and also we are gi... |
I'm trying to determine the least shipping cost when you have a number of items (each with a weight and a price) that can be combined into the same package. The constraints are as follows:
There is a limit on the max price of the combined package (say $15)
The cost of the package is determined using the following tabl... |
I am trying to define the time complexity of Kruskal's algorithm as function dependant on:
the number of vertices V
the number of edges E
the time complexity of verifying, whether two edges don't form a cycle Ec(V)
the time complexity of connecting two sets of vertices Vc(V)
The edges are unsorted and I know the tim... |
I'm implementing the algorithm on page 316 of the book Introduction to Algorithms. When I look at the pseudo-code, I feel that there is something wrong between line 10 to 14. I feel it's missing a check. There is a YouTube video explaining this whole function (and it includes the pseudo-code plus line numbers): https:/... |
Consider the function
$$
f(n) = 2n^2 |\sin(\pi \cdot n/2)|.
$$
Which of the following classes does $f(n)$ belong to?
$$ O(n^2), \Omega(n^2), \Theta(n^2), \omega(n^2), o(n^2). $$
I'm working in this and so far I have been trying to use different methods but always get to a dead end.
|
the definition of 'atomicity' says that a transaction should be able to be terminated without being touched or manipulated by possibly concurrent running actions during its process. But does that also mean that a program should not run concurrent when it is supposed to be atomic?
let's say we have 2 program as an examp... |
Having 4GB byte addressable main memory in 32-bit system divided into block of size 1024 bytes.
If processor wants to access a memory location 0xFC347004. Corresponding block is found in cache.
Which index, within this block, will be accessed?
|
Define $T\colon \mathbb{N} \times \mathbb{N} \rightarrow \mathbb{N}$ by:
$T(k,n) = 2^{T(k-1,n)}$
$T(0,n) = 1$
$T(1,n) = 2^n$
$T(2,n) = 2^{2^n}$
And denote the W.C. (worst case) time of computing $f(n)$ as $WC(f(n))$
Can we find computable functions $f_i\colon \mathbb{N} \rightarrow \mathbb{N}$ such that computing $f_i... |
I'd like to find longest common substring (occurrences, start index) between one string and many others.
For example
source string - "abcdefghijklmncdop"
other strings - ["cd", "ghi",
"mn", "zw", "cdewxyz"].
Expected result -(original string, substring, index in source string) = [(cd,cd,2),(cd,cd,14),(ghi,ghi,7 ),.... |
There is a lot of information online on this specific topic, but I still don't quite understand how to delete elements from a B-tree.
For example, given the following tree, how would we delete 26 and 63?
Is there a general approach?
|
The shortest Hamiltonian path (solution) for a set of points in $\mathbb{R}^k$ (in Euclidean space) changes subject to $k$.
For example if for $k=1$, the shortest Hamiltonian path will be the sorted set of points, which can be achieved in $O(n\log n)$.
My question is what happens when $k$ increases - does the solution ... |
I am working through the Sipser Book (2nd edition) and came across this example, which I do not understand. In the book it states that this NFA accepts the empty string, $\epsilon$.
Could someone run me through why this is the case?
My understanding is that $\epsilon$ will move to $q_3$ which is not an accept state.
|
When performing an insertion/deletion on a red-black tree, how can be argued or proved that it requires at most one/two trinode restructuring(s) respectively?
My thoughts so far were: after inserting a node and two consecutive red nodes exist along a path from root to a leaf a restructuring is done followed by recolori... |
I understand that regular languages are languages which can be computed by Finite Automata however i am having some trouble understanding how one can identify a regular from non-regular.
I know that 0*1* is regular because the machine just needs to make sure the 0s and 1s are in order
I know that 0^n 1^nis non regular... |
Last night, I had a dream involving an intelligent spider which was only able to communicate by crawling around on a grid of words/phrases, like this one:
When I woke up, I wondered why some of the cells in the grid were empty. But it makes perfect sense! If the grid were full of words, like this one:
The spider wou... |
I know it's undecidable, but how to prove it?
Let me explain the problem clearer. The problem is not to check whether some given word can be generated, but whether ALL words are possible to generate in this CFG.
|
Given a context-free grammar and a regular grammar, check whether they are equivalent.
It's a fact that it's undecidable, but how could I prove it?
I want to clarify that my question is not about determining whether a CFG describes a regular language. In my problem I am given a CFG and a regular language and I need to... |
All proofs for the undecidability of the halting problem seem to be based directly or indirectly on self-reference.
def g():
if halts(g):
loop_forever()
My question is: how can the input of a TM contain the TM itself and its input?
If the description of the TM has states and transitions, then it has more... |
Suppose we have a constraint satisfaction problem that can be defined as its constraints in two different viewpoints $V_1$ and $V_2$. Moreover, there are two variables $A$ and $B$ from $V_1$ and $V_2$ respectively, such that the value $I$ for the variable $A$ in $V_1$ is equivalent to value $J$ for the variable $B$ in ... |
I have set integers that are normally distributed, and I'm trying to implement binary arithmetic encoding, as suggested in this post: Compressing normally distributed data
I'm running into trouble because the user remarks that we should try arithmetic encoding the quotient using a sequence of binary symbols. I don't un... |
Let $X$ be a regular language, I need to prove that either $\{G \mid L(G) = X\}$ or $\{G \mid L(G) = \overline{X} \}$ is undecidable using the following hint: Use reduction to absurdity supposing that both sets are decidable and concluding that UNIVERSALITY is decidable.
UNIVERSALITY problem is $ \{ G \in CFG \mid L(G)... |
Here sum of a geometric, where c is a positive real number.
$g(n)=1+c+c^2+...+c^n$
$\theta(1)$ if $c<1$
Any idea to solve this?
|
tl;dr: I have a problem where I have a Boolean circuit and need to implement it with very specific single-thread primitives, such that SIMD computation is significantly cheaper after a threshold. I'm trying to optimize the implementation.
Going into detail, the input is a combinatorial Boolean circuit (so no loops, sta... |
I am studying CSP and read the papers on it.I wanted to know the time complexity of Forward checking with Minium Remaining Value algorithm.
|
I have proposed an algorithm for a scheduling problem in a submitting paper. In the revision, the reviewer asked us to compare with another algorithm in the literature. Our algorithm is in MATLAB, and the comparing one is in C++, and the code is publicly available. We did not re-implement the C++ code, to avoid any dec... |
Agda is ruling out definitions like
data Bad : Set where
bad : (Bad → Bad) → Bad
Because "Non strictly-positive declarations are rejected because one can write a non-terminating function using them." (as one may read in Agda wiki). I know also that disabling strict positivity checking allows constructing inhabitant o... |
I have to create an NFA that accepts the following language L with no more than 15 states.
$L = \{a^n \mid n \geq 1$ and $n \mod105 \neq 0 \}$.
To me it seems that all multiples of 105 have the same properties:
sum of digits is divisible by 3
the last digit is 0 or 5
I would appreciate if someone could help me here.... |
I saw an image that describes the relations of P, NP, NP-Hard and NP-Complete which look like this :
https://en.wikipedia.org/wiki/NP-hardness#/media/File:P_np_np-complete_np-hard.svg
I wonder if the following is possible ? Which means, P = NP, but not all of them are in NP-Hard :
Edit : I want to add this : I'm no... |
I'm looking for an algorithm that can quickly generate an approximate real number solutions of an underdetermined quadratic system. My task is to explore its algebraic variety. I'm interested in a special cases of quadratic systems that arise from mechanics:
set of variables $X = \{ x_i, y_i, z_i | 1 \leqslant i \leqsl... |
I want to prove that, assuming Exponential Time Hypothesis is true, there is no algorithm that solves Independent Set in $2^{o(|V|+|E|)}$ time. I want to apply the following strong parameterized many-one reduction $f$ from 3-Sat to Independent set. Let $\psi$ be the input to 3-SAT with parameter $\kappa_{3-SAT} = \#var... |
I'm trying to understand the correctness of the bidirectional version of Dijkstras algorithm as mentioned here on slide 10:
https://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/EPP%20shortest%20path%20algorithms.pdf
For a contradiction, they consider an $s-t$ path $p$ that is shorter than the minimum sum... |
My problem is I don't have many issues with creating a Turing machine state table when given a string such as 01101, my issue arises when I am presented with a problem which requires the Turing machine to recognize the language {0n1n | n ≥ 0}.
I have found this guide on a similar problem however I cannot grasp what is ... |
Given a list of distinct positive integers, I am trying to find the largest subset that forms an arithmetic sequence with a given difference D.
For example, given D = 5, with the set of numbers 1, 5, 10, 6, 7, 8, 15, 11 the longest sequence would be 5, 10, 15
I have tried using sets to solve this but I can't find a sol... |
I'm reading the paper MST Construction in O(log log n) Communication Rounds in a Clique and trying to understand the correctness analysis, in page 5.
It shows by induction on k (phase number), that the spanning tree, for every cluster F (from phase k), is indeed an MST fragment of that cluster of vertices.
The claim is... |
I'm trying to prove a theorem and as a lemma I would like to identify an $NP^L$-complete language. I was thinking something like a machine that can decide $SAT$ equipped with an oracle for $L$ can decide every language in $NP^L$, but I'm not sure how to formalize this. Here's my attempt at doing so
$$ SAT^L = \{\text{s... |
For the next problem I can not think of how to find a solution with graph searches (I thought it was backtracking but my college professor told me that I should use graph searches, which I do not know much about, to solve it).
As input we obtain a matrix (3x4) of connections ("|" or "-") which we must decode in the lea... |
I read this sentence in a book:
In VLIW architecture, the compiler/and or assembly writer chooses instructions that can be executed in parallel.
What is the difference between assembly writer and compiler? Would an assembly writer also mean the same as assembler?
|
I'm trying to provide a Hennessy-Milner logic formula for CCS expressions that are not (strongly) bisimilar. An example with a sketch:
For each of the following CCS expressions, decide whether they are strongly bisimilar and if no, find a distinguishing formula in Hennessy-Milner logic.
$b.a.Nil+b.Nil$ and $b(a.Nil+... |
what are the difference between Randomized response and output perturbation?
The only one I can think of is that Randomized Response's output is not always perturbated while in the other case it is.
|
I have the following statement. I would say it's correct as it's either equal or higher than $\Omega(\log^{10}(n))$.
Because:
I know $\log(2^n) = n$.
By that I would guess the same goes for $\log(n^{10})$ unimportant if the number is higher or not. By that it should be n. With this knowledge we already know it's higher... |
Trying to solve this problem since 2 days. Still unable to figure out even a basic approach.
Given a number $N$ in binary ($1$ to $10^5$), we need to convert it to $0$ using only 2 operations. Given a binary value of a number with length $M$ ($0$ indexed), we can:
flip the $i$th bit from $0$ to $1$ or $1$ to $0$ on... |
As I understand, then logic (i.e. particular theory of logic with some theory's axioms and some possible assignments of the variables) describes some specific world (in the non-modal case) or some set of related worlds (in the modal case) and deduction just explores this one world (this set of related worlds) and disco... |
Say that you have cache lines with the size of 64 bytes and a set-associative or directly mapped cache. Let's also say that the word size is 8 bytes.
According to my understanding, we use a number of the most significant bits of a memory address in order to determine where in the cache to place the data. Am I correct ... |
I'm studying Cubical Type Theory and I see the word "Kan operations" (ref1, ref2, ref3, and there are many more), which is related to "adding a cap to a tube" (can be also explained as "given a path between a and b, and two paths that are between a and c/b and d respectively, we can use Kan operations to get a path bet... |
I've seen similar questions around here but I'm trying to address this problem with a slight change and maybe it makes it easier to solve.
I'm given a set of intervals $\{s_1,s_2,...,s_n\}$ where each interval has a starting point $b_i$ and an ending point $r_i$. Also, the set is not changing meaning no new intervals ... |
Below is my simplification of part of a larger research project on spatial Bayesian networks:
Say a variable is "$k$-local" in a string $C \in 3\text{-CNF}$ if there are fewer than $k$ clauses between the first and last clause in which it appears (where $k$ is a natural number).
Now consider the subset $(3,k)\text{-LSA... |
Let P(p) <=> for each x, comp(p,x) is defined.
Can anyone explain to me how to prove that P is not RE (recursively enumerable) ?
|
I'm searching an hash function for integer set equality that must be fast.
It must support update (adding an element already in the set must not change the hash) and union.
MinHash has these 2 properties but it is too expensive and I do not need all the feature of MinHash, in fact I don't need set similarity but only e... |
I am learning the MIT course Introduction to Algorithms.
The professor is saying
In particular, as an example, position 2 is a peak if, and only if, b
greater than or equal to a, and b greater than or equal to c. So it's
really a very local property corresponding to a peak.
My question is, if an array if full of ... |
I was asked to write an algorithm for the following problem, and discuss complexity:
There are p points of two colours, black and white, in an n*m grid.
Any cell in the grid can contain 0 or more points, of any colour.
We are looking for an axis aligned rectangle, having (0,0) as a corner, containing k black points,... |
I'm trying to find quads on stream from my webcam. cv2.HoughLinesP sometimes returns more lines then needed. How can I approximate them to contour of exactly 4 points that fits returned result best? I'd like to know the most common way to do this, it looks like an obvious question and I don't want to reinvent the wheel... |
This is the HMM model considered in the question
And this is the emission probabilities for the respective states. There are two emission values, bringing an umbrella and not bringing an umbrella.
Description of the question:
The question considered the initial state as sunny.
On day 2, the person brought an umbrella... |
I am learning from the MIT course Introduction to Algorithms.
The professor says:
Now, remember $\Theta(n)$ is essentially something
that says "of the order of $n$".
What does "of the order of $n$" mean? Are "of the order of $n$" and "Big O" the same thing?
Please provide the name of any widely recognized textb... |
I came across this problem,
Tiling with Dominoes
and initially I faced difficulty in understanding the logic behind recurrence relation, but after reading it from here , I understood it. But I had a doubt, why aren't we considering the below cases for the above problem?
In the solution only these cases are mentioned,
... |
Hello I want to prove the recursion depth of merge sort, which is $O(\log(n))$.
I think I can prove this by recurrence equation and the master theorem:
$T(N)=2 T(n/2)+O(N) $ however i need to get $O(\log(n)) $. Basically I want only to calculate the complexity of the deviding and remove the conquer part from this equa... |
Suppose I have the following from alphabet $\mathcal{X} = \{0 ,1\}$ to $\mathcal{Y} = \{0 ,1\}$. The channel simply does
\begin{align}
0 \rightarrow 0&\quad \text{with probability 1} \\
1 \rightarrow 0&\quad \text{with probability 1/2}\\
1 \rightarrow 1&\quad \text{with probability 1/2}
\end{align}
The classical ... |
There are $n$ (non-recurring) jobs where each job $i$ has an arrival time $a_i$ and a duration $t_i$. All the jobs share a deadline length $d$ (deadline for each job is $a_i + d$). The problem is to find a (non-preemptive) scheduling time $s_i$ for each job on a single processor/machine such that the total number of mi... |
I am trying to understand a proof from "Term Rewriting and All That" by Baader and Nipkow.
Well-founded induction (WFI) is the following statement:
$\forall x \in A(\forall y \in A(x \stackrel{+}{\to}y \Rightarrow P(y))\Rightarrow P(x)) \Longrightarrow \forall x\in A (P(x))$
Here is the proof I cannot understand.
Th... |
I have written the following C code which purpose it is to flip an unsigned number in binary representation and give back an unsigned number:
long flippingBits(long n) {
return (unsigned)(~n);
}
int main(){
long a = flippingBits(someNumber);
...
}
This code does work fine. What about this code?
unsigned l... |
You are given n jobs, m workstations and an n × m two-dimensional task matrix T of the time each job will spend at each workstation. Each job becomes available at a specified time and may be processed in only one workstation at a time. Each workstation may process only one job at a time. The goal is to assign a start t... |
Let L be a language over $\Sigma = \{a,b,c\}$ that contains all words, where the length $|w|_b$ (number of all b's) has remainder 1 if divided by 3.
MSO logic over words are definded as follow:
I want to express this language using MSO logic. But my problem is how can I count the b's to calculate the reminder? So it ... |
I am interested in finding a data structure that supports the following operations:
Insert Set: Insert a set into the data structure.
Decide Subset: Determine whether a given set is a subset of any of the inserted sets.
The most obvious way to implement this would be as a hash set of hash sets, but I think some perfo... |
Sir i recently started graph theory. I understood the reason why edge connectivity is less than min degree(remove all vertices incident to min degree vertex). I have doubt in 2nd part of proof when given graph is not complete graph. how to prove here vertex connectivity less than edge connectivity?
confused here. Pls c... |
Introduction
I've been developing interest in complexity classes and thought I was unable to prove my problem is NP hard, so I wanted to see if it was P-hard. I wanted to see if my puzzle solving is special. I have linked a previous question of mine to help clarify what is mentioned below. Explained here
Random Instan... |
i am learning this post about Big O, which gives this formula
$$\log n = O(n^{0.000001})$$
why is that?
|
First question :
Is the following formula a valid MSO formula?
$\theta(S, r) = \exists (e_1, t_1), ... ,(e_h, t_h) \bigwedge\limits_{(e_i, e_j) \in \rho(S,r)} \mathcal{R}((e_i, t_i), (e_j, t_j))$
So my main concern here is the fact one states there exists $e_1, t_1$ etc. but then goes on to not use these in the ac... |
I'm looking for an algorithm name to change the order of the levels of a tree. I've done something that works but there's a lot of code and the $ O(n) $ is very bad.
Here's an example, let say there are 3 levels. Each level representing something in a hierarchy project > budget > fiscal year
project = {a}
budget = {b, ... |
I was given the following problem which really baffled me, and I would like some guidance in solving it.
I want to make a data-structure which represents two sets $A,B\subseteq \mathbb{R}$, so that I can Insert an element to a set of my choosing in $O(\log n)$ (where $n$ is the number of elements existing in both sets)... |
Let us suppose we have a sequence of values $C(i)$ that represent some counter for a given $i$ for $i \in \lbrace 1, \cdots, n \rbrace$. Let us assume some uniform distribution $U$ where selecting any integer between $1$ and $n$ has equal probability. A simple process using this information is to loop for some fixed nu... |
On the haskell wiki there is the following example of conditional usage of the IO monad (see here).
when :: Bool -> IO () -> IO ()
when condition action world =
if condition
then action world
else ((), world)
Note that in this example, the definition of IO a is taken to be RealWorld -> (a, RealWorld) t... |
Consider the following special case of orthogonal range searching:
Given a set $S$ of $n$ points in $d$ dimensions, and rectangular queries with a fixed "upper-left" rectangle corner $(0,0,...0)$, report the total number of points inside the rectangle.
This is different in that all rectangles queried have a fixed corne... |
While studying instruction pipelining in MIPS processor, we make an assumption that registers read/write stages take only a half clock cycle, as this picture shows (half clock cycles are dotted in register operations):
So what is the purpose of this assumption? and why is the fourth instruction in this graph is consi... |
If G has a unique minimum spanning tree, does that mean the edge weights in G are also unique? if yes why and if no why?
|
In what circumstances should we prefer Glushkov's algorithm or Thompson's construction for the building of regular expression NFAs?
I understand the difference between them, and can follow the argument for each approach.
I understand that the result is an NFA in each case, but with a lack of $\epsilon$-transitions in G... |
How can I achieve this. Write a grammar for the language consisting of strings built only of the letters a and b. The strings may have any number of these letters, but the letter combinations bab must be in each string somewhere, and each string must start with a bb. For example, the strings bbababbbaa, bbbaaaababaa, a... |
I am learning compiler in my Uni. I have been through all major compiler techniques like top-down parsing, bottom-up parsing, Lexical analyzer, Symbol table, etc. I have a good understanding of them, but I am still confused about the course.
What is the point of learning all these things? What are their applications? ... |
Is there any problem that can be only solved with recursion, and not with iteration? (haven't been able to find anything online).
If there isn't any, is there a reason why?
Thanks in advance!
|
Since dependent sum type ($\sum_{n\in \mathbb{N}} P(n) $) is interpreted as ($\exists n\in \mathbb{N}:P(n) $) and dependent product type ($\prod_{n\in \mathbb{N}} P(n)$) is interpreted as ($\forall n\in \mathbb{N}:P(n)$), is it correct to say that an element of dependent product type represents a set(in a vague way) o... |
I am looking for a functional data structure that would work in this role.
Adding items to the struct happens often. Removing items from the struct happens as often as adding them but I have no way of knowing what order the deletion happens in. Over the long term addions will equal removal Rarely I need all items curre... |
Could someone help me with these 2 questions?
I do not understand the case 3
$T(n) = T(n/2) + n \log n$
$T(n)=T(n/8)+2 n$
|
Let's consider a tree with root $r$ ( not necessary binary) and to each node $i$ we associate a cost $\sigma(i)$ that can be negative, positive or zero. We want to select the set of nodes that minimize $\sum_i \sigma(i)$. Of course, the problem until now is easy :
If there are only non-negative costs the solution is ... |
this MIT course gives a formula about Big O
$$n^{0.999999} \log n = O(n^{0.999999} \cdot n^{0.000001})$$
going through wiki, i cannot find a similar Big O properties or usages.
how to compute $O(n^{0.000001})$ to get a quantity like $\log n$ ?
|
I have a 2D grid of infinite size that can either be 4-connected or 8-connected (as defined in https://en.wikipedia.org/wiki/Pixel_connectivity). I am implementing breadth-first search on this grid starting at a particular node. I search up to and including the nodes at depth $D$ with $D \geq 1$. The nodes at depth $D+... |
Can the worst case time complexity of quick sort be changed from $O(n^2)$ to $O(n\log n)$ by modifying it?
|
Per wiki
|f| is bounded above by g (up to constant factor) asymptotically
with this concrete example,
$$f(n) = \log n$$
$$g(n) = n^c = n^{0.000001}$$
Does "bounded above (up to constant factor)" means $f(n)$ is above $g(n)$
|
Given a start of a sequence of random numbers generated by some random number generator (of which we don't have the implementation), can we predict the next numbers in the sequence?
For example, having a series of random numbers like this
40 46 15 37 9 4
32 26 5 33 17 21
12 19 13 36 25 29
These are the output numbers ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.