instruction stringlengths 35 11.4k |
|---|
Suppose we take all MSTs of a graph and build a new graph where each vertex corresponds to a MST of the first graph and two vertices are connected if their corresponding spannings trees differ by only one edge.
Is this second graph make of a single component?
I am guessing it is, but guessing is not prooving...
Becaus... |
What is the relationship between the number of clauses and the difficulty of a 3-SAT problem?
|
If the lower level cache contains blocks that are not present in the higher level cache or other caches then it is said to be exclusive.
It is exclusive because it is only there. How can there be cache miss when CPU is looking for it?
See img:
|
When analyzing the asymptotic running time of an algorithm where the tightest lower bound and upper bound are not the same, is it bad to denote the running time in theta notation? If an algorithm has a running time of $\Theta(n)$, is it safe to assume that the upper and lower bound are the same?
|
L ⊆ ∑* is a regular language. Show that L^+ (aka kleene plus) is a
regular language by describing how you can build a DFA or NFA for the
language.
I would build a NFA. That NFA must have exactly one starting state and one end state, where the starting state is never the end state.
The amount of characters of the ... |
Is the longest path in a (weighted) DAG always from a source to a sink? This seems correct to me by intuition, but I'm not 100% confident. Like, for example, if I had an array in which each index represented a node in topological order, and stored the length of the longest path with that node as its endpoint in the gra... |
I'm trying to prove $U = \{ \langle M, x, \#^{t} \rangle \vert M $ is a NTM that accepts $x$ within $t$ steps on some branch$\}$ is NP-complete. Showing it is NP is trivial. NP-hardness is the hard part. One way to do it would be to reduce a known NP-complete problem to $U$. Another way would be to find a general way t... |
I'm trying to understand the modification to the MCTS algorithm called Partial Expansion.
From what I've been reading it enables one to not require all child nodes to have been expanded before expanding grandchild nodes.
However, I'm having a hard time conceptually understanding this process and its potential benefits.... |
For two problems $A$ and $B$ and a Karp Reduction $R$ from $A$ to $B$, we call the reduction $R$ natural if, for any instance $I$ of problem $A$, the size of $R(I)$ (as well as the possible numerical parameters of $R(I)$ depends only on the size of $I$ and the sizes of $I$ and $R(I)$ are polynomially related.
We know t... |
The Voronoi diagram is a well-known data structure that helps solve various proximity problems. We have several nice algorithms that build this diagram for $n$ point in optimal time $O(n\log n)$.
I am interested to solve this problem for a set of simple, disjoint polygons and I am collecting information about known sol... |
As far as I know, a minheap is data structure whose parent node's value is less than child node and maxheap is when parent node is greater than child node. Here they have used minheap. But as the node closer to root have less length code than nodes below that level i.e., level 1 codes will have shorter codes than level... |
I'm trying to build a maze solver using A* algorithm. The maze is a grid with movement allowed in 4 directions (up, down, left, right). If there's a starting cell (x1, y1) and a destination (x2, y2), which of these should I make my heuristic?
Euclidean Distance
abs(x2-x1)
(x2-x1)^2 + (y2-y1)^2
abs(x2-x1) + abs(y2-y1)
... |
I am currently trying to prove whether the above language is decidable, partially decidable or fully undecidable. I am certain that this language is partially decidable and reducible to the halting problem. However, I am having trouble actually proving it.
Can anyone assist me with constructing the TM that decides this... |
I've been learning various disk scheduling algorithms in Operating systems. I wanted to know if there was any default scan order in SCAN, C-SCAN, LOOK and C-LOOK algorithms, like towards higher cylinders or lower cylinders ? Or are they OS-specific ?
|
Suppose that we have an alphabet Σ = {a}. My question is, is it possible to create a language with this alphabet, which is recursively enumerable, but not recursive?
My assumption is a no, i think we can construct a deterministic finite machine, which accepts every language, constructed with a single element in its alp... |
I imagine finding the closed form of an algorithm should yield fewer steps than the original. But in the case of a summation from 1 to n, I'm not sure if it actually does.
Here's the original sum
Sum(N)
total = 0
for x = 1 to N
total = total + x
ret total
Here's the closed form
Sum(N)
ret N*(N-1)/2... |
I've been reading Herlihy and Wing's paper Linearizability: A Correctness Condition for Concurrent Objects (ACM Transactions on Programming Languages and Systems, 12(3):463–492, 1990; PDF) and there's one piece of the paper that is a fairly small detail, but on which I'm stuck anyway. They define a sequential history a... |
How you define a search of text to find a string A, but exclude results that contains B only (which contains A), but not the both string A and string B?
For example:
String A : "Great Wall"
String B : "Great Wall of China"
Text 1: "The Great Wall"
Text 2: "The Great Wall of China"
Text 3: "The Great Wall of China is a... |
There are $n$ vectors, represented as $(d_x, d_y)$ pairs. Someone stands at point $(0, 0)$ of infinite euclidean grid. For every vector he can either move by $d_x$ in $x$ axis and $d_y$ in $y$ axis or ignore the vector and don't move at all. Each vector can be used at most once. He wants to get as far away from $(0, 0... |
TL;DR
What revolutions have there been in computer science, which entirely changed our view about the subject, due to 'one way of thinking' being replaced by 'a new (incompatible) way of thinking' (such as Einsteinian physics replacing Newtonian physics).
To explain a bit further:
I was trying to think about revolutio... |
The language that determines if two Turing machines are equivalent is not recursively enumerable because you can reduce it to the emptiness problem (does a Turing machine take no input).
Then for the complement of this language (ie. if two Turing machines are not equivalent) would you be able to reduce that to the non... |
A quick search on the role of compiler brings up the following:
A compiler is a special program that processes statements written in a
particular programming language and turns them into machine language
or "code" that a computer's processor uses.
However, I also read that every language needs to have a target ru... |
I have a graph like this one:
Each step from one node to another is a multiplication.
So for instance given the entry node TE and an entry value of 1.
TE = 1
TB = 1/10010
GB = 999/(10010*1000)
GE = (19990*999)/(10010*1000)
and so on.
I want to find the best path from TE to TE to return the highest value.
In this case i... |
Sorry for the long post. I tried to make it small but couldn't make it any smaller. Any help would be really appreciated. It would be great if you can explain from the basics.
In the book "Computer Networking A Top-Down Approach" the following is written:
One important characteristic of cable Internet access is that ... |
Are there any techniques for solving functional equations for unknown functions in lambda calculus?
Suppose I have the identity function defined extensionally as such:
$I x = x$
(that is, by writing down an equation for the expected behaviour of that function) and now I want to solve it for $I$ by doing some algebraica... |
Define a hypergraph as a set $V$ of vertices and a set $E$ of hyperedges, where a hyperedge is a non-empty subset of $V$. (This is a generalisation of an undirected graph, in which edges are allowed to connect any number of nodes, rather than just two.)
Define a cycle in a hypergraph as a cyclic sequence $C$ of vertice... |
In state diagram of DFA is it mandatory to keep a final state. I mean whether DFA is possible without final state or not?!
|
What are the largest classes which are low for EXP and NEXP?
For example: I am aware the class P, QP are low for EXP as well as NEXP. We also know that NP is not low for either of them.
Is class BPP low for EXP or NEXP? What is the largest oracle class we can provide to EXP (or NEXP) which doesn't increase its power? ... |
Is it hard wired CU or microprogramed?
|
Is there a variation of trilinear interpolation that works on a "cube" that has been distorted (by moving one or more of its corners by an arbitrary amount into an arbitrary direction)?
I know that I could use the inverse of the distance to each of the 8 corners as weights to get an interpolated point within the distor... |
As per the example given in this MIT OCW link URL https://ocw.mit.edu/courses/civil-and-environmental-engineering/1-124j-foundations-of-software-engineering-fall-2000/lecture-notes/sorting/
Why selection sort requires $O(N)$ time since the number of exchanges is at most N. Pls give example algorithm that prove this fa... |
What's the most effective algorithm to calculate LCM for 2 numbers where each of them has their own "shift"?
Example:
We want to find LCM for 25 + 5 as c and 30 + 10 as c
Then for the first case, the sequence will look like this:
25*1+5, 25*2+5, 25*3+5, 25*4+5...
And the second one:
30*1+10, 30*2+10, 30*3+10, 30*4+10..... |
A widely used example of reductions, is a reduction of $A_{TM}$ to $HALT_{TM}$.
How to show the opposite reduction, meaning of $HALT_{TM}$ to $A_{TM}$, if possible.
|
I have seen a proof that $E_{LBA}$ is not decidable. But is it at least turing recognizable? How to prove it?
NOTE: $E_{LBA}$ is defined as the emptiness problem for Linear bounded automaton
|
Given a graph $G(V,E)$ with $n$ vertices labeled $1,2,...n$ and $m$ positively weighted edges $(u,v,w)$ with the condition that $u<v,$ $\forall u,v \in G$, so the graph we are considering is actually a DAG. We need to find an odd path from $1$ to $n$ that have the smallest weight median. i.e when the weights on the pat... |
Can complexity theoretic reductions that lead to proofs of say NP completeness be formalized using an existing theorem prover such as Coq?
If so, can you provide an outline of how to formalize a simple reduction argument? I’d also appreciate pointers to the literature.
|
I have a list of configurations. Each configuration contains a number of parameters. The parameters have the same name but sometimes different values.
I now want a neural network, that can detect, which Parameters always have the same value when Parameter 1 has value 'A'.
I want to find out which Parameters are "relat... |
I'm having trouble understanding how the calculation of the constant $c$ in the Median-of-Medians-algorithm is build up ($cn$). The only calculation I found was on Wikipedia:
$$\frac{2g(g-1)}{g-3}$$
My question: Why is it exactly minus 1 or multiplied by 2 etc.? How did this term come together?
I do understand the othe... |
Recently I have learned about both the Strassen algorithm and the Coppersmith–Winograd algorithm (independently), according to the material I've used the latter is the "asymptotically fastest known matrix multiplication algorithm until 2010". As It can multiply two ( n * n) matrices in 0(n^2.375477) time.
As of now (... |
I have 2 images, called left and right images. I have some matched points $[c_l,r_l]$ and $[c_r,r_r]$ in both of them (these points are in pixel coordinates).
For a 3D point in the real world, they are related by:
$\lambda_l*[c_l , r_l,1]^t = W_l*[X,Y,Z]^t$
$\lambda_r*[c_r ,r_r,1]^t = W_r*[R|T]*[X,Y,Z,1]^t$
Here $W_l$... |
I want to reduce $L$ (stated above) to the Halting Problem in order to say that L is recursively enumerable but not recursive just like the Halting Problem, but is it enough to say that if I can solve the Halting Problem then I can solve $L$, because then I can feed into the Halting Problem the input $w_i$ twice, as bo... |
To prove the blank-halt problem is undecidable (does a given Turing machine halt on the empty input), it's a case of reducing the halting problem to the blank-halt problem and since the halting problem is undecidable, the blank-halt problem is undecidable.
However to prove the blank-halt problem is recursively enumerab... |
If I have DFA accepting
$\{w \in \{a,b\}^*$ s.t. on every odd position in $w$ there is a $b\}$
Would the empty word be accepted? Also, would the word $eb$ be accepted?
|
In this answer, it is told that the minimal $p$ value is $1$. One of the conditions of the pumping lemma is that
$|xy| \leq p$
Now if we try to split a string $01^p$, we might do it like this:
$x=\epsilon$, $y=01$, $z=01^{p-1}$
But this decomposition contradicts the above condition. If we arrive at a contradiction, the... |
The following theorem (from "The Design of approximation algorithms" by Williamson & Shmoys, pg 43) states:
For any $\alpha > 1$, there does not exist an $\alpha$-approximation algorithm for the
traveling salesman problem on $n$ cities, provided $P \neq NP$. In fact, the existence of an $O(2^n)$-approximation algor... |
I'm trying to find all the neighbors of a given cell in a voronoi diagram.
For example, given the following diagram, if I want to find the neighbors of the cell 1, then I should be able to return the points 2, 3 and 4.
Any hints on how to do so ?
[EDIT]
I didn't explained myself very well, I only have the image (pixe... |
It is well-known that the Merkle–Hellman knapsack cryptosystem can be solved using the LLL algorithm. In the Merkle-Hellman knapsack cryptosystem, we're trying to find a solution $x_i \in \{0,1\}$ such that
\begin{align}
\sum w_i x_i &= K,
\end{align}
where the $w_i$ are integer weights. Is it possible to find an appr... |
Ackermann's book "Solvable Cases of the Decision Problem" discusses decidable instances of first order logic, particularly monadic logic, and so called "equality formulas". However, the book is from 1954, the notation is terse, full of German letters, and presented in a very non-algorithmic way (which is unsurprising, ... |
Is the following language regular?
$$ \{ 0^m0^n : 0\le m\le n \}. $$
According to me, it is not regular. However, some of my friends are arguing that every string in $0^*$ can be divided into $0^m0^n$ satisfying the constrains between $m$ and $n$, hence it is regular.
Although I am absolutely sure that their reason... |
It is well-known that every non-trivial NFA of $k$ states (an NFA that does not accept all strings) rejects a string of length at most $2^k$.
But is this upper bound asymptotically tight ?
I found a rough sub-exponential bound in this strategy.
Let $p_i$ be an $i$-th prime.
On the singleton alphabet, $\Sigma = \{a\}$,... |
Interactive Proof System : An interactive proof system for a language $L$ is a two-party game between a verifier and a prover that interact on a common input in a way satisfying the following properties:
The verifier strategy is a probabilistic polynomial-time procedure (where time is measured in terms of the length o... |
Question no:$1$
"Any problem whose domain is finite is always Decidable"
lets take a TM,$M$ and finite domain of problem i.e. finite set of strings for eg. {$a,abaa,bba$}, Now the problem "whether $M$ accepts these set of strings or not is decidable or not?"
What I think is, this is Undecidable problem because, ... |
What is the minimal number of DFA states required to recognize binary numbers (encoded MSB to LSB) which are divisible by 6 and 8?
For divisibility by $6$ we required $6$ states.
For divisibility by $8$ we require $4$ states.
So in total, we need $6 \times 4$ states = $24$ states.
Am I correct? Can we do it with fewer ... |
I am trying to analyse a weighted multi-graph which represents a snapshot of a rail network for a particular day. As such, the vertices of the graph can be considered stations and the weighted edges represent the time taken to travel from one station to another.
For any particular vertex, there might be multiple edges ... |
Given an alphabet $\Sigma = \{0, 1\}$ and
a formal language $$L = \{ w \in \Sigma^* |\ |\mathrm{odd}(w)|_1, |\mathrm{even}(w)|_1 \text{are even numbers} \}$$
That means that the number of 1's in the odd and even positions of a given string are always an even number. I've tried using the Pumping-Lemma on a $1^{4n}$... |
I am having hard time to proving this problem
$C=\{\langle M \rangle \mid M \text{ is a Turing Machine , } L(M) \text { only contains two different strings}\}$
some ideas that i have tried are :
i have to prove if $C$ is not recursively enumerable. I know if $A$ is recursively enumerable, and $co\text{-}A$ is recursiv... |
I'm trying to solve the following problem:
There are N notes in an array (2<=N<=105) labeled 0..N-1, all of them initially set to 1. Then there follows Q operations to perform in the array (1<=Q<=105).
The task for each operation is:
Find the most frequent value between the inclusive range [A,B].
Add that value to all... |
I am reading RSA cryptosystem from Farouzan book on network security. The author has mentioned that RSA encryption is prone to chosen ciphertext attack. Then why is this algorithm still so popular?
|
I'm reading a computer science paper, this one: https://arxiv.org/abs/1608.03960. It uses certain notation in one of the illustrations (Figure 9, page 8 in the PDF version) that I don't understand how to interpret.
Attaching here as well for better visibility:
$$ \text{EXEC} ~ \frac{\text{cmd}_1 : \text{CMD} \quad A_p,... |
Is the following problem coNP-complete?
Inputs:
$p=$ a possibly non-convex multivariate polynomial over $\mathbb Z$
$k\in \mathbb Z$, an integer
Question:
Is $\forall x\in\mathbb Z: p(x)\geq k$?
|
L = { x^n y^n / x,y belongs to (a+b)^* , number of a's in x = number of b's in y and n > 0}
According to me it's regular because for any string $w$ belongs to $(a+b)^*$, we can divide the string into 2 parts $x$ and $y$ with $n=1$ .
Is my reasoning correct?
|
I am stuck on a question. Lets say there is a string that can be created from three alphabets a,b,c the condition is number of a<= number of b<= number of c. I can solve if there are a and b (two alphabets) but I am not able to solve for 3. Any help will be appreciated.
Thanks
|
I have an interval of intigers and I need to find all unique cuboids which have volume that falls within said interval.
I came up with a loop that goes over all uniqe combinations of 3 numbers (size of the cuboid) (1x1x1, 1x1x2, ...; also 2x1x1 is considered the same as 1x1x2) from 1 to the upper range of the interval.... |
$S$ is a set of $n$ elements with some unknown strict total order. The goal is to discover the greatest $k$ elements, where each step consists of comparing $m\ge 2$ elements at once (so if we compare $a, b,$ and $c$, we might get $b > c > a$). Any strategy for achieving this will have some worst-case number of steps $t... |
How do I go about designing a constant time algorithm which satisfies the following I/O requirements:
Input: an array $A$ of length $3n$, containing $2n$ values of the symbol $X$ and $n$ of the symbol $Y$
Output: a number $i$, such that $A[i]=X$
It is clear that the naive linear scan approach is $O(n)$. Is there any ... |
I read that pumping lemma is sufficient condition to prove non regularity of languages but not necessary condition.
I know the first part that it is sufficient is true but not able to understand why is it not necessary. Can someone please help me with this statement?
|
I came across a modification of the classic house robber problem where the robber cannot rob from $l(i)$ houses on the left of $i$th house and $r(i)$ houses on the right of $i$th house. The modified version will now be as follows:
You are a professional robber planning to rob houses along a street. Each house has a ce... |
Recently, I learnt about VC-dimension and how its boundedness assures PAC learnability on uncountable range spaces (let's assume that hypothesis class is the same as the family of concepts we want to learn).
My question is simple: What is/are the geometric intuition(s) behind the concept of VC dimension?
|
Rice's theorem: Any nontrivial property about the language recognized by a Turing machine is undecidable.
I know the proof but I am not able to understand the theorem. I think trivial properties are like :language recognised by Turing machine contain at substring "aab". where as nontrivial property means is language ac... |
I have a raster image with a number of arbitrary shapes (blobs). I am interested to find, for every blob, its immediate neighbors, i.e. those that are visible from it in a straight line. The search can stop after a few neighbors (say 3) have been found, by decreasing closeness.
I imagine that a growing process around e... |
I know it sounds a bit silly, but I got really curious. Is it possible to simulate a CPU in, let's say, Python? Some have argued that Minecraft, for instance, allows one to build turing-complete machines, but has some real research been made on this idea? Nested computers? How efficient could that be if made on assembl... |
A language $L$ is said to be sparse if there exist a polynomial $p$ such that $|L \cap \{0,1\}^n| \le p(n)$.
One trivial example is suppose language is over single alphabet $1$ then $$L = \{1^n | n \in Z^+\}$$
Question : What are the other non-trivial examples of sparse languages?
|
Consider we have an AVL tree.
Its left subtree A has disbalance coefficient has value +1 (meaning the right subtree has greater depth). Its right son has disbalance coefficient -1 (meaning left subtree has greater length).
If I understand correctly, we're looking for the most right vertex in the left subtree.
After de... |
I would like to know if there is a name for CFG grammars (or grammars in general) in which there is a fixed number of "distingushed" terminals or in which there is a terminal that appears a fixed number of times (in the generated strings).
For example:
$L(G) = \{ 0^a 1 0^b 1 0^c \mid a = b \text{ or } a = c \}$
In thi... |
$$L = \{ \langle M \rangle \mid M \text{ takes at least 2016 steps on all input } \}$$
My approach
As $M$ takes atleast 2016 steps, only tape cells 0,1,..2015 are significant. Now we have finite number of strings of length 2016.
As we have finite number of strings with finite length, we can simulate $M$ on each of t... |
I'm working with something that can modeled as the following type of (multi-)graph $G = (V,E)$, which I've been calling an "unlockable" graph. (There may be existing terminology for this.)
Let $G$ be a graph with the following additional structure. There is a set $K$ of keys, and edges may be "unlocked" or they may be ... |
I was under impression that when a Language (or problem) is not semi-decidable and not decidable then we can say it's undecidable and I think it makes sense also based on diagram.
However, in my assignment the TA struck out "undecidable" and wrote "not semi-decidable". Why is "undecidable" wrong if it's both not semi... |
Ternary search trees are very common in the text editing area. They could be used to implement Auto complete feature, spell checking, Partial-Match searching, Near-Neighbor Searching & many many other options.
The reason behind them being famous is their space efficiency compared to tries (Although tries are faster) & ... |
Given a TM M, will it ever reach any other state other than start state if it starts with blank tape ?
Is the above problem decidable ?
I think that if a TM really reaches any other state other than start state then we can check the transitions and find out. But if it doesn't at any point of time then we can't say that... |
My gut says it's true and I have tested it on a few examples. However, I can't prove it. I thought of using contradiction; suppose there exists another tree T' with smaller weight which has m edges not shared with the first tree. We can transform the first tree to second one in m steps by adding one of the m edges whic... |
Let $s = a^pb^{2p}$, now which one of those decomposition is correct:
$x=a^k$, $y=a^l$, $z=a^{p-k-l}b^{2p}$, where $k+l \leq p$
$x=a^{p-k}$, $y=a^k$, $z=b^{2p}$, where $1\leq k \leq p$
$x=\epsilon$, $y=a$, $z=a^{p-1}b^{2p}$
or are they the same? I've read in multiple answers that we don't get to pick the decomposition,... |
Conceptually, I know that reducing a problem $Y$ that's NP-complete to a problem $X$ implies that $X$ is at least as hard as $Y$, implying $X$ is also NP-complete. So if any NPC problem, say $Z$, can be solved in polynomial time, then that implies $P = NP$, since any other NP-complete problem can be reduced to $Z$ in p... |
Triangle removal problem states that, given an undirected graph G, can you pick a subset
S of vertices such that removing S will remove all triangles from the old graph and |S| <= k. I was trying to use reduce from vertex cover problem, but every construction I attempted has failed. Here's what I've done:
1) Add extra... |
It is well-known that dynamic arrays have an amortized $O(1)$ time complexity for adding one item, but a worst-case $O(n)$ complexity. This is because for particular values of $n$, there is no more room in the buffer, so the dynamic array allocates a new buffer and copies over $n$ items.
My question is, what would the ... |
My question is a request for literature or pointers that address the following abstracted problem. If I have a finite set (ex. {1..10}) over which I'd like to maintain several "partition maps":
m1 = {1..5}=1, {6..10}=2
m2 = {1..3,8..10}=3, {4..7}=4.
Afterwards I'd like to merge (generalize the operation, but use addi... |
I am working on pattern matching algorithm. Its working and using very less memory. For the comparison, I have to compare it with the Rete Algorithm. I have checked it in the thesis of the author, some of his paper and he has provided some complexities which are not based on then, nor does its efficiency is provided in... |
Can someone please tell me if complement of halting problem(L) is Co-RE or non R.E ?
I think that it is Co-RE as L' (L complement) is R.E but everywhere its given non R.E
|
$L = \{ \langle M \rangle \mid L(M) = \Sigma^∗ \}$
Is above problem R.E ?
I found an explanation in one of the websites and I have doubt in few lines of paragraph.
The explanation was
Now, given a halting problem $(\langle H \rangle, w)$, we proceed as follows: We make a new TM say $A$, which on input $x$, just simulat... |
What are currently the state-of-the art algorithms for this purpose? This is an area that I know absolutely nothing about. I'm basically interested in the following two things (which I assume go hand-in-hand):
Source separation
Locating sources
I'm basically trying to build some simple Raspberry Pi based robot that w... |
We are given $2n$ positive integers $a_1,a_2\ldots,a_n$ and and $$b_1,b_2,\ldots,b_n$$ as input.
The question is to find a permutation $O$ on $\{1,2,\ldots,n\}$
that minimizes $$\sum_{i=1}^n \left(a_{O(i)} \cdot \sum_{j=1}^i b_{O(j)}\right).$$
For example, take $n = 3$, $a_1 = 10, a_2 = 1, a_3 = 100, b_1 = 10, b_2 = 1... |
Logic in computer science (By Michael Huth,Mark Ryan, second edition, page 132) says
Every φ can, in principle, be discovered to be valid or not, if you
are prepared to work arbitrarily hard at it; but there is no uniform
mechanical procedure for determining whether φ is valid which will
work for all φ.
For me,... |
Do URI's, as defined in rfc3986, form a regular language?
How can I tell?
There's a BNF grammar provided, but I don't know how to check that it has a unique representation of every URI, or that it describes a regular language.
|
We have an array of $N$ positive elements. We can perform $M$ operations on this array. In each operation we have to select a subarray(contiguous) of length $W$ and increase each element by 1. Each element of the array can be increased at most $K$ times.
We have to perform these operations such that the minimum element... |
I have two variables $A$ and $B$, with $A$ being binary and $B$ is a real number where $B \ge 0$. My conditions are:
if B > 0
A = 1
else
A = 0
How to express this as a linear program? I have figured out one condition using the big-M method:
$MA \gt B$
which means that if $B>0$, then $A$ must be 1 to ... |
In "Towards a cubical type theory without an interval" Altenkirch and Kaposi motivate why it is hard to compute with univalence. They say:
For example, we can define the equivalence (not ,...) between Bool and Bool and thus univ (not ,...) : Bool =_U Bool, and then using it, define a boolean b:
coe : (A =_U B) → A → B... |
We have a large file that can't fit into internal memory. How do we randomly pick one line so that each line has the same probability to be picked?
And how do we randomly pick such n lines so that they all have the same probability?
We don't know the number of lines beforehand.
Any hint on where to start solving this,... |
I want to understand if there exists an algorithm which is wait free and operates on non-shared memory, asynchronously.
Finally I want to know how to derive the consensus number of this algorithm.
Googling did not work.
|
Suppose we have a bunch of bars, which can represent anything (time slots, paths, physical items...) and each of them has a start point, an end point, and an associated value.
Out of all the bars available, we want to choose the set which maximizes the total value but with no overlap between the start points and end p... |
I'm trying (in vain) to get a beginner's grasp of quantum computing, so doing a lot of reading. I've started looking at IBM's QISkit Jupyter Notebooks, and came across the one on MaxCut problems. In there, they give an example of how you could use quantum computers to solve the Traveling Salesman problem, for 4 cities.... |
I found this link: http://theory.stanford.edu/~tim/w11/l/qsort.pdf and it kind of theoretically describes how to approach finding expectation for the number of comparisons in a Quicksort.
Using this, how would I find and prove the expectation for an array of a concrete number of items, for example 5? (see the formula... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.