instruction stringlengths 35 29.1k |
|---|
There are $n \leq 10^6$ kinds of cake layers, and for each kind we have a machine capable of baking it in one unit of time and nothing more. Now, a cake is a sequence of layers, more specificly a permutation of numbers $\{1,2,...,n\}$, and before doing one of layers in a cake all previous ones must have been done.
Give... |
I want to proof the P-Hardness of a language. Why is it enough to make a reduction-proof from an other, already P-Complete known language?
|
Is it true that a password consisting of the alphabet, even of common known names is much harder to find for a computer program than a short password, even though it uses numbers and other characters?
|
I have often read that Hindley-Milner extended to allow polymorphic recursion is undecidable. However is the term used what is actually meant? Or do people actually mean semidecidable when they mention that?
I ask this before I've recently found a paper where such a type system is presented and an algorithm based on th... |
Can we define a grammar for the following language?
$$L = \{a^n b^n c^{n+m} | n,m>=0\}\,.
$$
I can define one for this:
$$L=\{a^nb^n|n,m>=0\}
$$
S --> aSb | λ
or this one:
$$L=\{b^nc^{n+m}|n,m>=0\}
$$
S --> Ac
A --> bSc | Sc | λ
but I can't solve the first one, any hint?
|
More precisely: The input is set of $M$ sets (most likely stored sequentially on disk) that contain partitions of the set $\{1..N\}$. I want to efficiently (as far as memory and time complexity goes) represent this structure. Let's call this hypothetical structure $S$. I need the structure to support just a single func... |
Question: Given an $n$-bit natural number $N$, how to compute $\lceil \sqrt{N} \rceil$ using only $O(n)$ (bit) additions and shifts?
The tip is to use binary search. However, I could not achieve the required complexity (I got $O(n^2)$).
What does it mean by using only $O(n)$ (bit) additions and shifts:
This is an ex... |
Many years ago I read a GC survey paper that was updated every few years with advances; I tried to find such a paper today to point a questioner on Stackoverflow at.
However all I can find is very old survey papers that don’t include current thinking on items like hardware assistance.
|
For enumerating the minimal feedback vertex sets of a graph Schwikowski and Speckenmeyer show an algorithm "GENERATE-MFVS" in their publication "On enumerating all minimal solutions of feedback problems". It is said that it runs in polynomial time but uses exponential space in a dictionary.
insert F_q into Q and into D... |
I am currently bushing up on my data structures and basic algorithms, part of that is the Binary Tree.
I do understand the algorithms, and how to implement a binary search tree and such. I do so how smart it is that we can do lookups in O(log n) time.
I am however having a hard time finding an example of when I would u... |
I am trying to solve this particular problem from Automata Theory by Ullman, Hopcroft, it is as shown below:
Let $A$ be a $DFA$ and $a$ be a particular input symbol of $A$, such that for all states $q$ of $A$ we have $\delta(q,a)=q$.
Show that either $\left\{a\right\}^*\subseteq L(A)$ or $\left\{a\right\}^*\cap L(A)=\... |
I've seen two different concepts referred to by the term "function":
A small part of a program specified by the composition of constants and other functions as paramaters, such as the "functions" in Lisp
A set of tuples, as referred to in formal logic, which is not necessarily computable
The first concept is very fun... |
I understand the assumptions that have to be true about a property or set of properties in a Turing machine description for Rice's Theorem to apply.
But then what? If a set of Turing machines have an undecidable property, is the language itself necessarily undecidable? Or only if you can find a reduction from a known-... |
Let's consider the following problem (buckets/pails of water problem) (This problem may be known with different name. If does, please correct me).
Let $B=\{b_1,...,b_n\}$ be a set of $n$ buckets. Suppose each bucket has a maximum capacity $c_i \in \mathbb{Z}$. This also can be written as a maxium capacity function $f:... |
Can you explain to me how you get the Big O notation for the runtime of the following snippet of code?
for x = 1 to n
{
y = 1
while y < n
y = y + y
}
Can you explain the steps on how you get the big O notation for it? Also why doesn't it matter if there a bunch of statements inside a for loop when calcu... |
When I want to vocalize a hexadecimal number like 0x41, so I say "forty one in hexadecimal", "four, one in hex" or what? Or do you always have to calculate and say "65 in hexadecimal notation"? I feel like that would complicate communication if I just want to tell someone what numbers I see on the paper in fornt of me,... |
I was following the textbook by David Mackay: Information theory inference and learning algorithms.
I have question on asymptotic equiparition' principle:
For an ensemble of $N$ $i.i.d$ random variables $X^N=(X_1,X_2....X_N),$ with $N$ sufficiently large, the outcome $x=(x_1,x_2...x_N)$ is almost certain to belong to ... |
I am struggling in finding the name of this game (in order to find research papers related to it in the literature).
Given an initial word $X$ and a target word $Y$, what is the minimum number of (letter) flips needed for $X$ to reach $Y$ assuming $X$ and $Y$ having the same number of letters, we flip only one letter ... |
I know that in the case of a 16 bit word, if we have x - 115 in decimal, the smallest x that would cause overflow would be (32767 + 115 + 1)= 32883 because it would represent a number that is larger than the largest positive integer we could represent in a 16 bit word.
However, I was wondering what would the largest va... |
Say I have a full application written in Python. Is it feasible to convert the source code into C? If such a tool doesn't exist, why doesn't it? What are the constraints?
I ask this since I have been wondering why people use C for microcontrollers when they could write their code uber-fast in Python when prototyping an... |
If $\Sigma^*$ is the set of ALL strings including the empty string, then what can its complement possibly be? The empty set?
|
Must the states of a finite state machine be worked off sequentially or could you understand the different shaped parts of the key as input and the position of the pins as states?
If not all the input is right: failure state = stays locked
If all the input is right: end state = lock opens
I was inspired by this (German... |
Let $\Sigma_n = \{0, 1, ... , n-1\}$. Suppose $L \subseteq$ $\Sigma^*_n$, and let
$\qquad\displaystyle\mathcal{B}(L) = \{ x \in L : x = \textrm{lex}\max L_m, m \in \mathbb{N}_0 \}$,
where $L_m = L \cap \Sigma_n^m$ and $\mathrm{lex}\max$ denoting the lexicographic maximum.
For example, $\mathcal{B}(\{0,1\}^*) = 1^*$ a... |
I have tried to Use the Bailey–Borwein–Plouffe formula to calculate pi to 3 digits as a test trial, and recieved the digit 4, which is technically correct, as 4 is the 3rd digit of pi in base 16. I would like to get the digit in decimal, as that is the current standard for numbering things in most places, as you don's ... |
Ok so I understand how $\mathrm{ATM} = \{\langle M,w \rangle \mid \text{$M$ is a TM and $M$ accepts $w$}\}$ is undecidable.
Is this because $w$ is a variable?
What if the parameter is fixed?
Consider $\mathrm{BTM} = \{\langle M,w \rangle \mid \text{$M$ is a TM and $M$ accepts the string 101}\}$.
BTM is decidable right?... |
I could use a priority queue supporting the find-and-delete-min, and lazy-increase-key operations. The last term is my "invention". It should go like this:
The keys are held somewhere outside of the queue and get increased very often (more often than any other operation). Finding them is not the job of the queue. Ideal... |
Imagine you load this data as a 4-byte word into a register R. What is the value in R on a big endian machine and what is it on a little endian machine if you interpret the bits as a signed integer encoded in 2s complement
On a big endian machine the register R would be something like this
not considering the last s... |
Consider the following problem:
Input: a directed graph $G = (V,E,\omega)$ where $\omega : E \longrightarrow \mathbb{Z}$, two vertices $v_1, v_2 \in V$, and a weight $k \in \mathbb{Z}$
Question: Does there exist a walk from $v_1$ to $v_2$ with weight exactly $k$?
The weight of a walk is simply the sum of all edges in t... |
I'm not exactly sure what this question is asking me to do:
Show that the set of binary integers (given as strings over $\{0, 1\}$) that are divisible by $3$ is regular, by giving a DFA that recognizes it. Leading 0s are allowed. The empty string should be accepted. Briefly explain your answer.
Is this asking me to c... |
How to check if all subarrays of the array contain at least one unique element for NlogN complexity, where N is the length of the array?
For example:
3 1 2 1 2 5 6 - doesn't satisfy the property (1 2 1 2 has no unique elements)
1 2 1 3 1 4 1 5 - satisfies the property
|
I have been trying this Towers of Hanoi question since last week but never able to come with the right approach towards the solution.
The setup is the standard Towers of Hanoi, except that moving the smallest disk costs one unit of time, moving the second-smallest disk takes two units of time and so on.
What is the tot... |
What´s the technique behind the way google earth overlaps polygons on top of pictures(like the ones users assign to streets and houses) ?
It seems to be aware of perspective, and I don´t remember seeing it covered on books on computer vision.
Thanks,
Rafael
|
While studying the dynamic programing algorithm for the maximum independent set problem in trees I thought about the following simple alternative algorithm. I tried to prove it's correctness but I do not know how to attack the proof.
The algorithm iteratively finds a two vertices $u,v$ of the tree which have maximum di... |
In trying to write pseudocode for it, this is my attempt:
I'm just trying to write a pseudo-code for it and explain the run time.
So far this is what I have:
k-merge-sort(L)
{ if length(L1) <2 return L1
else
{ split L into L1, L2, L3
A1 = k-merge-sort(L1)
A2 = k-merge-sort(L2)
....
... |
For example can an approximation algorithm call a subroutine which is solving a NP-Hard problem? (like say its trying to find the longest path in some graph as an intermediate step) Is that allowed?
|
Solutions to the critical section problem exhibit three properties: mutual exclusion, progress, and bounded waiting. When do we say, or do we at least say, that operating system-implemented semaphores and monitors possess all these three properties?
An example would be bounded waiting on semaphores. In bounded semaphor... |
How does the search operation for a red-black tree work and how does it take $O(\log n)$ time, where $n$ is the number of items? I know a red-black tree takes $O(\log n)$ recolorings and $O(1)$ rotations, but I was specifically interested in a good description of its search operation.
|
When a process inside a monitor with Mesa semantics finishes, another process can acquire the monitor. Now there can be starvation here when there is a thread with a lower priority.
Are there monitors of Mesa-semantics type that don't cause starvation and thus have bounded waiting?
|
This is not homework, but from a past exam. I do not know how to solve this one at all. Can anyone please take the time and show me how to do these? Thank you.
Prove that $5^n \in O(6^n)$, but that $5^n \notin \Theta(6^n)$. (Doing this shows that $6^n$ bounds $5^n$ from above, but that $6^n$ is not the tightest such b... |
Suppose that you have a DFA $M=\left(S,\Sigma,s_0,\delta,{s_f}\right)$ with $s_f\neq s_0$.
Suppose further that, for all $a\in\Sigma$, $\delta\left(s_0,a\right)=\delta\left(s_f,a\right)$.
Show that for any non-empty word $w$ over $\Sigma$, we have $\delta^{*}\left(s_0,w\right)=\delta^{*}\left(s_f,w\right)$.
I know the... |
The function is this:
function max-element
if n = 1
return A[1]
else
x = max-element(A[2...n])
if A[1] > x
return A[1]
else
return x
So to create to recurrence relation i've done this, which i'm unsure of...
T(1) = 2, because the function will only execute the first if and return if n=1... |
I've come across that question :
"Give examples of two regular languages which their union doesn't output a regular language. "
This is pretty shocking to me because I believe that regular languages are closed under union. Which means to me that if I take two regular languages and union them, I must get a regular langu... |
I came across this question today on stackoverflow. It asks:
Find the largest, $2$nd, $4$th, $8$th, ..., $2^{\log n}$-th largest element in an arrary. Use $O(n)$ algorithm. $2^k$
I've come across this before and know how it can be done, but I've been been trying to find examples of algorithms that incorporate the abo... |
Is it the same as find minimum for a binary search tree?
I know recoloring runs in O(logn) and rotations are O(1).
Even if we are wanting it to find the 'k-th' smallest key in the red-black tree.
Could someone help me understand it in more detail? Thank you!
|
Let L = {ab,aa,baa}.
I need to find L^4. From my understanding, I union the set.
So:
L^1 = {ab,aa,baa}
L^2 = {abab,abaa,abbaa,aaab,aaaa,aabaa,baaab,baaaa,baabaa}
L^3 = {abababab,abababaa,abababba,....} ??
I concatenate L^3 with L^2 as I did above correct? And then I concatenate L^4 with L^3?
|
I am trying to create a dfa for L={w: every run of a's has length either two or three}
this is my attempt at the solution..i feel like I am missing something..?
|
I have to design a Non-deterministic Turing machine that accepts only non-palindromes in $NTime(n\log n)$.
I think this would be easy on a 2-tape DTM. Simply copy the string onto the second tape – $O(n)$ time – and then check both tapes (one from beginning and the second from the end) – $O(n)$ time again.
However, I ca... |
I am looking for a software, a library or an algorithm that can be trained to recognize about a dozen speaker independent voice commands. The commands will be very distinct phrases of 4-5 words each. They can be chosen to sound very different from each other. Additionally, the commands will be in more than two differen... |
Some CPUs have a flags register (ARM,x86,...), others don't (MIPS,...). What's the advantage of having a CMP instruction to update the flags register followed by a branch instruction instead of using a zero register and conditional branches to check for sign, overflow etc?
|
Let's say that lists are defined as
List a = Nil | Cons a (List a)
Then, in Haskell is List x the greatest or least fixpoint? I'm asking because the lfp should exclude infinite lists (but you can build them in Haskell), whereas the gfp should exclude finite ones.
|
When I read computational complexity I encounter problems like 3-SAT, set cover, knapsack. In the first two variables are discrete. In knapsack the weights and values are integer and all three problems have a combinatorial structure, what I mean is selecting a finite number from a finite set.
How about problems in cont... |
In a relational model,
a schema is something which specifies the name and data type of each field.
The word "schema" is also used in "conceptual schema", "physical schema" and "external schema".
What do "schema" mean separately in the above two cases? Are they
related?
Are they related to the "schema" in cognitive... |
There are several coding operations that (I suspect) most compilers will change into more efficient operations at the assembly or machine code level. I have several questions about whether or not the compiler does any of this work, and if it's even best for the compiler to automatically do so.
(Note: These examples use... |
Suppose we are given a universal set $U$ and a family of subsets of $U$, denoted by $F$ (elements in $F$ are subsets of $U$). We assume that all elements in $F$ can cover $U$, i.e., $U\subseteq \bigcup_{e\in F}e$. Consider the following max-cost set covering problem:
$\text{argmax}_{E\subseteq F} |E|$
s.t. $U\subseteq... |
Let's say I am building a time clock app. The employee can log into the interface and then enter time for multiple projects so that we can generate reports for billing as well as payroll.
A table in the database will record the time-in and time-out for each project as a row. A user should be able to sign out and back i... |
Using the Deterministic Finite Automaton (Q, Σ, Δ, q_0, F):
Alphabet: Σ is {(0 0), (0 1), (1 0), (1 1)}
Definition of Δ to strings recursively:
Δ*(q, ε) = q for all q ∈ Q
Δ*(q, xa) = Δ(Δ*(q, x), a) for all q ∈ Q, x ∈ Σ*, a ∈ Σ
Given a string, s ∈ Σ*, we define left(s) and right(s) to be the numbers represented in cust... |
looking for some help, or at least if I'm going the right direction...
Are there functions $f$ and $g$ such that $f$ is $O(g)$ and $g$ is $O(f)$ and NO constants $c_1$ and $c_2$ exist for which $f(x) = c_1 \cdot g(x) + c_2$?
I want to say that there is not, because the definition of big O states that if $f(x)$ is $O(... |
Given numbers $n,k\in \mathbb{N}$, we consider $\mathcal P$ to be the set of all possible partitions of $n$ balls into $k$ bins.
Alternatively, $\mathcal P$ is the set of all $k$-ary vectors in $\{0,1,\ldots,n\}^k$ such that the sum of the entries is exactly $n$.
For example, if $n=4$ and $k=3$, we get:
$$\mathcal P =$... |
$ G $ and $ H $ are the generator and parity check matrices respectively of a linear block code.
Let $ G_1 = G(:, 1:n-s) $ (Matlab style representation of sub matrices). That is, $ G_1 $ is equal to the first $ n-s $ columns of $ G $, and $ G_2 = G(:, n-s+1:n) $. Let $ H_1 = H(:, 1:s) $ and $ H_2 = H(:, s+1:n) $, wher... |
Can anyone tell me how using cosine similarity to see the correlation between two documents actually shows you if someone is plagiarising the other? I understand how cosine similarity works but don't understand how using this shows how closely related they are when the cosine deals with vectors and angles. How can this... |
I'm reviewing the definition of recursion and in my notes are two questions about a recursive problem. One question asks about the base case, the other one about the small version of the problem, I always get confused about which is which... can you help me to find a way to better understand these concepts?
The example... |
The answer for this question is 81. But I count figure out why. Can someone explain to me how does this work. Thank you.
|
I often heard that "program = algorithm + data structure".
But I notice that
It seems to me that a data structure is (or may be) just a data type or extension thereof. Is it correct? But a data type is a part of a programming language, but a data structure isn't.
the operations/methods in a data structure actually im... |
This problem is based on an order picking problem with a forward area.
The problem description is as follows. We have a warehouse with a set of items $I$ and a forward area $F$ of size $k$. Each day, there is a set $D$ of deliveries. Each delivery $d_i$ is a set of items such that $d_i \subset I$ and $|d_i| < k$. The ... |
Someone recently shared with me the following problem (which I guess appeared in some kind of past coding contest):
Given $n$ points $P_i=(x_i,y_i)$ in the 2-dimensional plane, find the point $Q=(x,y)$ that minimizes the average distance from $P_i$ to $Q$.
In other words, we want to find $Q$ that minimizes the object... |
I was learning about Benes networks and was wondering why they formed bipartite graphs (and thus are two colorable) when one draws a constraint graph for them. The constraint graph is based on the intuition that we don't want two paths for packets to intersect because we want to show that the congestion is 1 (i.e. that... |
Why is it that if the edges of an undirected graph G can be grouped into two sets such that every vertex is incident to at most 1 edge from each set, then the graph is 2-colorable.
The reason that I am guessing this happens is because the graph is bipartite. But I was not sure about this... I was trying to show it was... |
In most 3d applications, the scene is projected onto a rectangular area. As the field of view increases, you see terrible distortions near the edges of the screen. Why do modeling engines limit themselves to a projection matrix when they cannot produce reasonable perspectives above 90 degrees? Why are these engines not... |
This fact seems obvious but I was unsure how to go about proving it very rigorous.
Let $|V| = n$ and $|E| = m$ for some connected graph $G$. Then consider the following proposition:
If a graph is connected then $|E| \geq n-1$, i.e. it needs at least n-1 edges.
The fact seems simple and maybe obvious but I was unsure ... |
Are there any known algorithms that correctly output "yes" to an NP-complete problem without implicitly generating a certificate?
I understand that it is straightforward to turn a satisfiability oracle into a satisfying-assignment finder: just iterate over the variables, each time asking the satisfiability oracle to so... |
Why does the empty clause is logically equivalent to a contraddiction:
$\square \cup \square \Longleftrightarrow \perp$
and why the empty cube is logically equivalent to a tautology:
$\square \cap \square \Longleftrightarrow \top$ ?
|
In purpose of load balancing I need to approximatively predict rendering time my graphics software (in the specific case it's Autodesk Maya) needs to render a task given an input file (.ma/.mb) and rendering parameters.
An intuitive way to do it is to render several frames from different parts of a scene and to extra... |
I have come across many amortized analysis using a potential function. They all look magical to me. Everything works perfectly but I never got the intuition behind how they come up with such a "magical" potential function which makes everything work. My question is can someone share their experience in developing a pot... |
Prove, using only the definition of $O()$, that $2^{\sqrt{x}}$ is not $O(x^{10})$.
I have been doing a few exercises on Big O and this is the first time I have encountered the variable in the exponent. I was wondering how to disprove this function. Any help would be appreciated
|
$\{a^mb^nc^n\mid m,n \ge 1\}$ intuitively seems like a non-regular language. It looks like the machine needs to remember the number of $b$s (which isn't limited). The pumping lemma can be used to prove a language is non-regular. In reference to the Wikipedia article linked (see "Use of Lemma"), every string I have trie... |
I've written a recursive function of a tree, and I would like to know what it's called! It's not quite the same as the height or the width of a tree, but it seems kind of like a width.
Assuming the tree $T$ is binary, we can define the function $f(T)$ as follows. If $T$ has a only a single node, let $f(T) = 1$. Othe... |
Consider the a butterfly network as defined on the following OCW notes on page 208. An explantation of it can also be found on the following page.
I was wondering if someone had a proof or an intuition on why there is a unique path from each input to each output on a butterfly network.
|
this is my first question in CS so I apologize if this question is off-topic.
If we use Newton`s Method for finding square root then complexity is $O(M(n))$ (using Wikipedia Notation: $M(n)$ is the algorithm to multiply two $n$-digit numbers).
I am interested to know whats the constant hidden in Landau notation in thi... |
Often I will encounter the use of - or even use myself - the value -1 as an edge case in otherwise integer data structures. For instance, as the value for "irreplaceable" in a Replacement Cost field.
This is especially useful where null is either unrecognised; semantically overburdened; or converted into empty when mi... |
How can I find out the time complexity for the brute-force implementation of matrix multiplication for:
Two square matrices ($n \times n$),
Two rectangular matrices ($m \times n$) and ($n \times r$)?
|
I was asked this question in an interview and struggled to answer it correctly in the time allotted. Nonetheless, I thought it was an interesting problem, and I hadn't seen it before.
Suppose you have a tree where the root can call (on the phone) each of it's children, when a child receives the call, he can call each o... |
Suppose you have a function quality(x) that returns the quality of a sequence of letters x. Given a string such as "howareyoutoday," what is the most efficient way to determine that the segmentation is "how are you today" (i.e. quality(how)+quality(are)+quality(you)+quality(today) is the maximum quality possible)?
I wa... |
In popular literature, complexities are usually used in a very imprecise manner, often to describe the runtime performance of an algorithm and denoted with "$O$". My question is about these Landau symbols.
Take Quicksort for example, which is often cited as being $O(n^2)$ in the worst case, but $O(n \log(n))$ in the be... |
Given a sequence of comparable objects $a_1, a_2, \ldots a_n,$ how quickly can we find the longest subsequence $s$ such that $s_i > s_1$ for $i > 1$? Or equivalently, how quickly can we find
$$
\underset{i}{\arg\max} \; \# \{j \mid a_j > a_i, i < j \le n \}
$$
Can it be done in less than $\Omega(n\,\lg n)$ comparisons... |
If we can achieve consensus, does it imply we can achieve mutual exclusion? Is there a difference?
Example : Paxos solves the consensus problem, can it also be used to solve mutual exclusion?
|
Imagine we have a multiple-choice exam with N questions.
Suppose we have a set of K answer sheets to the exam and their total scores (1 for a correct answer on a question, 0 for incorrect).
How much information can we extract from this set about the true answers to the exam, and what is the shape of the space of possib... |
I have been reading about Big O notation. People writing about Big O often use the terms $f(x)$ and $g(x)$. For instance, I often see people write things like $f(x) = O(g(x))$ or $f(x) \in O(g(x))$.
Obviously $f(x)$ is the running time of the given algorithm we are comparing against infinity, but what does $g(x)$ repre... |
As I understand, to show that a certain problem P is NP-hard we can reduce a known NP-hard problem, Q, to problem in P in polynomial time. To show that the problem P is NP-hard in strong sense, we can reduce a know NP-hard problem Q to problem P in pseudo polynomial time.
Is it possible to show that a certain problem P... |
I have already read different things about hamming distance, hamming code, detection and correction of memory errors, but I am still not understanding many things.
I know that the hamming distance between 2 codewords is the number of bits to be reversed to convert one codeword into the other.
I know that the hamming c... |
I was confronted with this problem in an online programming challenge and it has been bugging me since:
In the problem, you are given a list of 16-bit numbers, say
$a_0, a_1, ..., a_n$. An "XOR subsequence" is defined as the exclusive-or combination of every element in a consecutive subsequence of the list. The problem... |
I was wondering about a variation on the Stable Marriage Problem. Initially, we have two sets of entities, usually males and females, and they have preference lists ranking the other group, and through a series of proposals, we end up with a stable matching.
Thinking of it like medical schools and applicants, each med... |
I'm preparing for an exam about Trees. One of the questions that appear in Mark Allen Weiss' "Data Structures and Algorithms Analysis in C++" is:
Prove by induction that if all nodes in a splay tree is accessed in
sequential order, the resulting tree consists of a chain of left
children.
When I take a set a set o... |
I am new in writing recursive algorithm so I tried this problem from SPOJ but I could not formulate the recursive relation from where I can find the optimal solution. Can anyone help me to see the optimal solution of the problem below please.
There are N pilots working for his company (N is even) and N/2 plane crews n... |
How can prove that $2^n \nmid n!$
using binary representation for $n!$ and $2^n$.
|
Let L be the language containing all the pairs (G,v) where G is a directed graph and v is a vertex in G such that G contains a cycle that contains v and the number of different vertices that appear in that cycle is odd. Find the smallest class (NP, P or NL) that contains L.
Clearly L is in NP, I didn't manage to show... |
Given the language
$\{ <M> \mid\:$ M is a Turing machine and there is some w ∈ Σ* for which the computation M(w) takes more than 10 transitions$\}$
How can one prove that this language is decidable?
|
I know that the first instruction stored in BIOS is "mapped" to memory address 0, and that a signal on the reset pin to the microprocessor causes this instruction to be fetched, beginning the POST and all the chain-loading involved in the boot process.
I also know that there is a Memory-Management Unit (MMU?) at the ha... |
I am looking for an algorithm with time complexity in $\mathcal O(|V|)$ that determines whether a given graph $G=(V,E)$ is a caterpillar tree.
A caterpillar tree is a tree that has a path to which all nodes are connected by a maximum of one edge. So for every vertex v there is a vertex u on the path so that the discta... |
I found that Fundamentals of data structures (1982) by Ellis Horowitz and Sartaj Sahni draws my attention naturally, probably because of
their formal treatment of data structures, and
their choice of topics and
their way of organizing the topics into chapters and sections.
But the book was published in early 1980... |
I often heard that using data structures help to reduce (time or space) complexity of some operations.
I wonder if that is achieved at the cost of something else?
When solving a problem, is something still conserved, over all
choices of data structures and algorithms, just like the
conservation of energy? Such as som... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.