instruction stringlengths 35 29.1k |
|---|
0
I am learning about the instructions-set in my computer science course, and I am wondering if it is possible to split an instruction into more than four sub-instructions.
Thank you
|
Caveat. You have to show this specifically by showing there exists an infinite set that is pairwise distinguishable with respect to L.
This question was on a quiz which we had 12 minutes to complete (this wasn't the only question!) I can see that this isn't a regular language but I cannot come up with any set that is p... |
Is there a formal definition of a 'Quantum Turing machine'? I am mainly interested in how the tape position would move.
https://en.wikipedia.org/wiki/Turing_machine
https://en.wikipedia.org/wiki/Quantum_computing
|
The Graph Isomorphism Problem is a classic in Computer Science.
In its decision version $(DGI)$, we are given two graphs $G$ and $H$ and we are asked if there exists an isomorphism between the two. In its function version $(FGI)$, we want to produce in output the found isomorphism (if it exists).
It is a (in)famous ope... |
Could one use the Radix Sort to find the Longest Common Subsequence problem? I am new to algorithms and was wondering if the string was converted to a list and then one was able to apply Radix Sort and instead of sorting able to search for the longest common subsequence by matching up the positions. Or would this be an... |
I am looking for the fastest algorithm (in practice) to multiply two polynomials $f(X)\cdot h(X)$ in $\mathbb{F}_p[X]$. The prime $p$ is roughly $256$ bits but the integer $p-1$ might not have any large smooth divisors. The polynomials are of degree less that $2^{30}$.
In the absence of large $2$-power roots of unity i... |
In several explanations of coinductive definitions (for example, in the answers to What is coinduction?), we're told that while an inductive definition gives us the smallest set with a specified set of properties (the constructors), coinduction gives us the largest set such with a specified set of properties (the destr... |
In CLRS it is stated that the class $\mathcal{H}_{p, m} = \{ h_{ab}:\mathbf{Z}_p \to \mathbf{Z}_m \mid a \in \mathbf{Z}_p^*, b \in \mathbf{Z}_p\}$, $h_{ab}(x) = (ax+b) \mod p \mod m$, $m < p$ prime has $p(p-1)$ members. However, I don't see why some of these functions couldn't turn out to be the same. I've investigated... |
Let $ A $ be an array of $ n $ integer arrays with unknown lengths and $ s \in \mathbb{Z} $ a given number. I want to find the number of combinations of numbers from each array, such that their sum is $ s $. In set theory terms, if I have $ n $ tuples, $ A_1, A_2, \ldots A_n $, I want to find all $ (a_1, a_2, \ldots, ... |
I am trying to find the language generated by this context-free grammar
S → aSb | bbY | Yaa
Y → bY | aY | ε
I understand that one way to solve is this to find set of strings that satisfies this grammar, But I don't see a common pattern in those strings.
Some of the strings that belong to this language are
aa,bb
... |
This and this agree that there will be near 100% false positive rate with Bloom's filter should number of elements in the set ($n$) be greater than the number of bits in the filter ($m$).
E.g. if $n=100$, $m=10$ with a single hashing function $k=1$, then we get a probability of false positives worth:
$$\begin{split}
p ... |
I am wondering about this small question, why aren't these regular expressions equal?
$(a+b)^* a^*$ and $(a^* b)^* a^*$
|
The expected running time, $T(n)$, of quicksort when the pivot is chosen uniformly at random satisfies $$ T(n) \leq \mathcal O(n) +\frac{1}{n}\sum^{n-1}_{i=0}(T(i) + T(n - i)),$$
which leads to the known bound of $\mathcal O (n \log n)$.
Suppose we consider the following procedure to discard bad pivots: after sampling ... |
Why isn't it possible to have P=NP, but not all problems in P are in NP-hard? The diagram of the various classes would look something like:
We have P=NP, but not all problems in P lie inside NP-hard. The intersection of P and NP-hard is still NP-complete.
Lander's theorem seemed relevant, but it holds when P != NP whi... |
Why do you think the Immediate type instructions are limiting its immediate values to only 12 bits, while upper immediate type instructions can handle immediate values of 20 bits.
|
I am new to Hough transform, though I have some basic idea about it. I am currently trying to fit the best line to a cluster of points $\left(x_i, y_i\right), i = 1,2,\cdots , N$, where there are many outliers, as well. The true points have very low noise. So, the main issue is to correctly identify outliers and rejec... |
I started wondering this after reading about the x86-SSE instruction rsqrtss being faster (and more accurate) than the Fast inverse square root. I have also read about other specialized hardware instructions that replaced staple software algorithms for better performance. Can a specialized hardware instruction generall... |
Some sources state that an algorithm that solves the SAT problem not only needs to decide whether a given existentially-quantified formula is satisfiable or not, but, additionally, in the case where the formula is satisfiable, it does need to provide a satisfying assignment. Is this true or not?
I am bit confused, sinc... |
I'm taking a Theory of Computation class and we went over the proof to show that for any NFA there is an equivalent DFA, which I understand the proof fully in this case. But if it were in reverse, for example, "For any DFA, there is an equivalent NFA," how different would the NFA -> DFA proof be to the DFA -> NFA proof... |
My minimax graph search has considered three options at the root level of a graph.
The first option, A, yields a solution with cost 10.
The second option, B, was not fully investigated. It has a solution with cost 20, and the lower limit to any possible solution is 15.
The third option, C, was also not fully investiga... |
I'll start with some definitions to simplify the rest of the message.
Let's denote $f_0 = b, \ f_1 = a, \ f_n = f_{n-1} \cdot f_{n-2}$, where $\cdot$ stands for concatenation of two words. We call $f_n$ the $n$-th Fibonacci word. Let's also denote $f := \lim_{n \to \infty} f_n$ (the Fibonacci word). Let $s_{k}$ be the ... |
Subset Product Problem is $NP-Complete$. Given a promise that the product contains exactly 1 occurrences of each of its prime factor is the problem still $NP-Complete$?
Seems to be the case but couldn't find any references. Can someone confirm?
|
Let's say we have some distinct sets each containing a number of line segments.
I want to choose the minimum number of sets such that I will obtain a line from 0 to L with the largest gap being X long.
For example, let's say we have the sets A, B, and C as given below. L is 45 and X is 4.
If we take A, there is a gap f... |
Is the problem of communication with a pre-shared database studied? If yes, what field studies it, or which researchers work on it?
Let there be two parties that want to share multiple yet-to-be-defined messages. These parties want to compress future communication as much as possible. For that, they first define some p... |
Apologies for the vague title. This decision problem has applications to graph coloring but I have not found a name for it in the literature.
I am trying to improve my algorithm for a decision problem. The problem input is a graph and hypergraph which have the same vertex set, $(V, E, H)$ where $V$ is the set of vertic... |
In two unsorted arrays (say $A$ and $B$) such that all items of $A$ belong to $B$ ($A \subset B$), find the smallest item in $B$ that doesn't occur in $A$ in linear time.
No hashing or linear time sorting is allowed.
I can solve this question when $A$ and $B$ are sorted.
However, the question states $A$ and $B$ are u... |
Description
This is an exercise for Formal Language course, I'm asked to find a grammar for language:
$L = \{ 0^i1^ic0^j1^j | j = i+1 \}$
As an example: 01c0011 can be generated using this language, so does 0011c000111.
What I've tried
The difficulty is around the j = i + 1 controlling, I've tried something like this:
... |
There's this problem that I was solving and even though I have an O(n) solution but still trying to make sense of the pattern.
The problem being: determine the number of pairs of the same numbers. For e.g for an array [1,2,3,1,2,1]. The 4 possible pairs include:
[1,1] // index (0,3)
[1,1] // index (0,5)
[1,1] // ind... |
Suppose that I have two random processes. Process $X$ has probability 0.5 to be in state A and probability 0.5 to be in state B. Process $Y$ has probability 0.4 to be in state A and probability 0.6 to be in state B.
State B has two substates: $B_1$ and $B_2$. For both processes, the two substates are equally likely.
No... |
I used a vector to determine the collision between a line and a circle. Here's the way I thought of it in the beginning.
1.
When the ball collides with a straight line,
it finds a normal line passing through the center point.
2.
Take the coordinates before the ball collides and move
symmetrically with respect to the no... |
So, I have a set of 2D points with real valued positions.
I want to find a set of N adjacent unit squares that contains the most points possible.
If it's easier, this could be a set of N adjacent (or overlapping) disks.
Any idea how I could do that?
Thank you :)
|
During the run of Ford Fulkerson algorithm if we label each vertex with d(v) where it means the shortest path distance from source to vertex v in residual graph. Is it possible that for some vertex this value decreases at any execution stage? I tried to find such an example, but it seems the vertices are getting away a... |
There is a classic linear algorithm to find every cut vertex (AKA articulation point) in a graph.
I have a usecase that does this computation after every time a non-articulation-point is inserted or deleted. An articulation point is never deleted (but may become non-articulation then deleted later).
Is there some incre... |
Suppose that $X\in\mathcal{X}$ is data in abstract space and $Z\in\mathcal{Z}$ is random noise vectors in latent space over a defined prior $P(Z)$ (e.g., Gaussian).
Then, let $G$ and $D$ denote generator and discriminator. In a generative adversarial network (GAN), we train $G$ to generate samples $G(Z)$ through advers... |
Can I define a complexity class $\mathsf{C}$ by giving a language $L^\prime$ and stating that $L^\prime$ is $\mathsf C$-complete? Specifically, a language $L$ is in $\mathsf C$ if there is a reduction from $L$ to $L^\prime$.
If so, are there any common (i.e., well-studied) complexity classes that are usually defined th... |
Let $X=x_1,x_2,x_3,\dots,x_n$ be set of $n$ distinct keys. I read this posts about Randomly build binary search trees like this and now I encounter the following question in my mind, suppose we generate a random permutation $X'$ from $X$ and we insert first half of $X'$ in empty binary search tree $T$. Also we sort s... |
Since strings are finite by definition, then it follows that languages are enumerable because they are finite string sets and we know that finite string sets are enumerable. Turing Machines are enumerable, because each Turing Machine has a finite string description. Therefore:
If all languages are enumerable, and we k... |
I'm trying to randomly allocate N indistinguishable items over B indistinguishable bins with unlimited capacity. Each allocation should occur with equal probability. An allocation identifies the number of balls in each bin, and two allocations are equivalent if you can obtain one by permuting the other.
At first, I th... |
I am working on a project for the prediction of preeclampsia, and one of the algorithms to be used is the convolutional neural network. I am a beginner in machine learning, and I am struggling to find out "whether is it applicable to use the convolutional neural network for numerical data. without the need to convert ... |
Hello Folks,
I am facing hard time in understanding this, basic question which says, how many possible finite automata ( DFA ) are there with two states X and Y, where X is always initial state with alphabet a and b, that accepts everything?
What i understand is:
Number of possible inputs possible: (a,X), (a,Y), (b,X),... |
I'm trying to solve this recurrence relation:
$T(n) = T(\frac{n}{2}) + T(\frac{n}{5}) + T(\frac{n}{10}) + c_1n$ ; n > 1
$T(n) = c_2n$ ; n = 1
My first thought was to combine the fractions and solve through the Master Theorem. Would this approach be enough to calculate a tight bound, or are there any other approaches ... |
Are all non-context-free language infinite?
|
I am looking at a problem where I have an assembly/collection of items, V, and my goal is to issue an ID to this collection, such that:
this ID uniquely identifies V, aka a change in V results in a change in the ID of
V (much like a hash function),
given V, I can generate the ID and,
given the ID I can work out which ... |
With the purpose of proving my problem NP-hard, I'd like to reduce from a SAT variant (which of course should remain NP-hard) in which not two parameters are present (typically $n$ clauses and $m$ variables) but only one, so $n$ clauses and $f(n)$ variables, for some function $f$.
I've tried to look up 3-SAT (SAT with ... |
Our test log files are stored in .asc format. Each file contains around 5000 rows of these Logging Strings as shown in the image. I would like to reduce the size of these files.They are around 4-5 MBs each bringing the total folder size for one test run around 700-900 MBs. The files are output from the system in only .... |
I have multiple functions as shown in the image. For a fixed x value, I need to distribute it into f, g, and h functions for getting the maximum output (y).
In other words, having a fixed x value, find a, b, and c in which these conditions are satisfied:
a + b + c = x
a >= 0 and b >= 0 and c >= 0
f(a) + g(b) + h(c) h... |
we say that a constructive axiom is an equality axiom $u = s$ :
whose left member $u$ is a pattern,
whose right member $s$ is any term whose variables are all appearing in $u$.
and yet we say of $suc(i + j) = i + suc(j) $ is not constructive, Ok, and
this $dump(push(e, s), t) = dump(e, push(s, t))$ is constructive.
B... |
For the purpose of this post, let $k$-SAT be SAT with exactly $k$ literals per clause, as opposed to the more common meaning of at most $k$ literals per clause.
With the purpose of proving some problem NP-hard, I'd like to reduce from a $k$-SAT variant (which of course should remain NP-hard) in which each variable occu... |
For example (and this is not my use case), imagine there is a set of 50 000 random natural numbers represented in decimal with 8 digits (in the range 00 000 000 to 99 999 999). We could index the set with an index for each digit position (i.e. an array of pointers to all numbers ordered by their fist digit, another one... |
On the one hand it does not belong to NP problems because it simply is not solvable and is undecidable and on the other hand it is an NP problem because there are claims that it is NP-hard and therefore can be reduced to NP and is an NP problem.
My question, does the halting problem belong to NP?
|
The binary expansion of a given real number can be encoded as an amplitude using the inverse QPE. Together with Amplitude Amplification, I wonder if this could indicate that the (some weakened?) trichotomy of the real numbers is physically effective.
I think the crux of the question is that these assumptions that
"th... |
What is the asymptotic relationship between $\frac{1}{n}$ and $\frac{1}{2^n}$?
The answer here mentions that both functions are $O(1)$ (because they are always $\leq 1$) but not $\Omega(1)$ (because the functions will not be always greater than any constant $c>0$, as both are eventually 0).
Thinking of it using limits:... |
I am trying to recognize a particular language,
L= {a^n b^k | n<=k<=2n}
and according to me it should not be CFL, as i can see two comparision i.e. firstly number of a is compare to keep count less than equal to k, and secondly for count of b that should be less than twice n.
My question then how it is still CFL??
Than... |
In "Introduction to Algorithms" by Cormen et al. the Potential Method is explained. For example, we have the following representation for the amortized costs of the i-th operation with respect to the potential function $\Phi$:
$$\hat{c_i} = c_i + \Phi(D_i) - \Phi(D_{i-1})$$
The book also states that for each $i = 1,2,.... |
Given a sentence like this, and i have the data structure (dictionary of lists):
{'cat': ['feline', 'kitten']}
A feline was recently spotted in the neighborhood
protecting her little kitten
How would I efficiently process these set of text to convert the word synonyms of the word cat to the word CAT such that the... |
Introduction
This is a heavily updated question I have asked on this forum previously. I have understood and corrected the earlier errors and mistakes I made, and after doing that it still seems I have a problem. I would also like to state that I am not looking for a different proof of the halting problem, and I am not... |
I'd like to know how a computer can determine the beginning and end of certain file components (attributes, headers, frame/packet/segment headers etc.) when these components can be omitted or added in optionally, on top of being of variable length, and how it can even recognise files and protocol packets within an ocea... |
Suppose we have an undirected, connected graph $G$ where vertices have positive integer weights. Let $\bar{v}$ be a given vertex in $G$. Take a spanning tree $T$ of $G$ rooted at $\bar{v}$ and define its cost as the maximum total weight among all proper subtrees. (Since weights are positive the proper subtree(s) with m... |
There must be a complexity class C that includes exactly the problems that can be solved in exponential time and having access to a truly random coin (which in turns implies that you will be able to use an exponential number of random bits). I searched for a class like like this in the Complexity Zoo but I only found P... |
I was shown these diagrams in the context of search algorithms. The green tile shows the initial state, and the orange tile shows the goal state. I am told that each option shows a path each search method would take to reach the goal state.
This one is apparently breadth-first search:
This one is apparently bidirectio... |
When we defining a Functor instance in Haskell, it should satisfy the following two laws:
fmap id = id
fmap f . fmap g = fmap (f . g)
But I found these two articles that say the second Functor law can be derived form the first:
The second Functor law is redundant
The free theorem for fmap
The proof in these article... |
I am writing a scientific paper in which I describe some algorithms (using pseudocode) that have point clouds as inputs. In these algorithms, I need a mathematical structure to represent a point cloud. I need this mathematical structure to permit to access the $i$-th point in a point cloud. I have read some papers that... |
there are 3 kinds of TMs
a Halting TM on all inputs prints finitely many symbols on it's output tape and halts
a Circle-free TM on all inputs prints infinitely many symbols on it's output tape
a Crashy TM is neither Circle-free nor Halting (if a TM reject any input it's Crashy)
"the kinds of TMs" problem is to find ... |
I'm struggling with question 7-38 from Skiena's Algorithm Design Manual:
Let G be a directed graph. We say that G is k-cyclic if every (not necessarily
simple) cycle in G contains at most k distinct nodes. Give a linear-time algorithm to determine if a directed graph G is k-cyclic, where G and k are given
as inputs. J... |
I have the following diagram showing a case of merge sort:
I am trying to find the value that would be in the box with the red cross when applying merge sort in ascending order.
It seems to me that it would be $71$. If we start at the bottom-right, we have $[30, 71]$ for the first array. We then have the sorted arrays... |
First of all LPL is Leaf path length & IPL is internal path length. While i was studying algorithm analysis for average complexity of binary search , i saw that inequality. Before that, i proved by induction for any full binary tree T, LPL(T) = IPL(T) + 2*I where I is the number of internal nodes . Now after that i tri... |
Suppose we have an array of $n$ integers. Suppose that we pick one of these elements uniformly at random and call it $x$. Suppose that $\log n$ elements are also sampled (uniformly at random) from the $n$-size array and we call $A$ this sampled array. What is the probability that $x$ lies in the middle third of the sor... |
In lecture the following was mentioned in the context of matchings in bipartite graphs:
Let $U$ be a finite set and let $\mathcal{S}$ be a family of subsets of $U$.
For $u \in U$ let $r(u) := \lvert \{S \in \mathcal{S} \mid u \in S\}\rvert$ and let $n := \lvert \mathcal{S} \rvert$ and $N := \sum_{S \in \mathcal{S}} \l... |
Recently, I study the instruction set of riscv32 and face a order as "mulh" which tends to multiply two 32-bits signed integers and store the high 32 value into the register.
And here comes the problem, there are two integer src1 and src2, I want to implement these instruction in C language by using shift operation but... |
Why don’t operating systems save process state (registers, page tables, pages) by writing state to storage in blocks? Wouldn’t this allow for a seamless restoration of state when the process needs to continue? Specifically, in graphics intensive processes (ie video games), wouldn’t this make load time way quicker?
|
I have been thinking a bit about error correcting codes, in particular the following problem:
Consider the problem of transmitting a single real number $x \in [0,1]$ over a lossy connection, where each bit sent has a i.i.d probability $p < 0.5$ of being flipped during transmission.
For a given number of transmitted bit... |
Back here with some more doubts, i wanted to understand, how can we formally or may be easily calculate time complexity for such question without getting into "DRY RUN", i mean is there any way for it? and for below question i am getting O(loglog(n/2)) which is not right!
Thankyou in advance for sharing your wisdom :)
... |
After going through the resource list, is the following a way to explain ford fulkerson concisely ?
Graphs is represent is a 2D matrix with flow capacity as a tuple in each cell.
while exists (P_residual = residual graph path from S to T obtained via BFS )
modify actual and residual graph with P_residual by
1. ... |
I'm studying for an exam and have run into a problem that I do not understand. The main program starts two threads that execute the following program concurrently, whenever both threads terminate the program will print the result of counter. I am assuming that the maximum value of counter will be 10? But what will the ... |
Suppose we modify the Knuth-Morris-Pratt string-matching algorithm to scan the pattern right-to-left a la Boyer-Moore, and consequently apply the shift rule on the right side of the cursor instead of the left side. The quantity $\text{sp}_i(P)$ is now defined as the length of the longest proper prefix-suffix of $P[i\do... |
Ford Fulkerson 1956 uses words like "arcs" and "chains". What do they mean ?
Arc = path and chain = edge ?
|
Exercise 9.2.3(c) of the book by Hoffman, Motwani, Ullman states
In fact a definition of the RE-but-not-recursive languages is that they can be enumerated but not in numerical order
How do we show this equivalent to the following definition? RE-but-not-recursive languages are those, that are accepted by a TM, but do ... |
I had earlier asked the question What is a witness string? I unable to understand the concept
From the answers I got, it seems that a witness is more or less the answer. For e.g. in the padlock example given in the accepted answer, the witness is the padlock combination which can be easily verified to be true or false.... |
In the worst case, the Traveling Salesperson Problem (TSP) is mostly accepted to take exponential runtime in terms of $|V|$ and $|E|$ (the number of vertices and edges respectively). But for many real-world TSP problems, while $|E|$ and $|V|$ may be large, you often have many other properties of the graph that one woul... |
I understand that if $A$ is NP-hard, and $A \leq_{T} B$, then $B$ is NP-hard.
Is the converse also true? So if $B$ is NP-hard, and $A \leq_{T} B$, then $A$ is NP-hard?
Why (not)?
|
Wikipedia states that the time complexity of the General Number Field Sieve (GNFS) is
$$\exp\left( \left(\sqrt[3]{\frac{64}{9}} + o(1)\right)(\log N)^{\frac{1}{3}}(\log \log N)^{\frac{2}{3}}\right),$$
where $N$ is the number to be factored.
The same site also mentions that quasi-polynomial time is
$$\mbox{QP} = \bigcup... |
I have a graph data structure that has some source points (the red ones) and some destination points (the blue ones). I want to find the shortest path from every source point to its nearest destination point, or to its nearest source point that is already connected to a destination point by a shortest path.
Please see ... |
Let $G$ be a graph and $G_s$ its $s$-subdivision, i.e. the graph obtained from $G$ by subdividing each edge $s$ times.
Why is the treewidth of $G$ the same as the treewidth of $G_s$?
(Subdividing an edge $s$ times means that we replace $e = (u,v)$ with a path from $u$ to $v$ of length $s+1$, i.e. $u, x_1, x_2, x_3, ...... |
The problem reads as follows:
Write a regular expression for the following language on {0, 1}:
$\bullet$ all strings not ending in 01.
The solution my teacher gave is
(0+1)$^{*}$(00+10+11)+0+1+$\lambda$
So if I understand this correctly I could produce a string like
0001 right? Which ends in 01 which is what we DON'T w... |
this question is related to this question but it's different
there are 3 kinds of TMs
a Halting TM on all inputs prints finitely many symbols on it's output tape and halts
a Circle-free TM on all inputs prints infinitely many symbols on it's output tape
a Crashy TM is neither Circle-free nor Halting (if a TM reject an... |
Is there an algorithm that help to build a linear order on a set of states of automaton (without output signals), such that this order is compatible with a transtion function of automaton?
Let A = (X, S, δ) be an automaton, where X is a set of states, S is a set of input signals, δ: X × S → X is a transition function. ... |
I have the logical formula
$$
A \Leftrightarrow B \Leftrightarrow C
$$
In order to make the truth table I'm not sure wheither I should interpret it as
$A \Leftrightarrow B \Leftrightarrow C$ or $A \Leftrightarrow (B \Leftrightarrow C)$
Here is my first truth table:
$A$
$B$
$C$
$A \Leftrightarrow B \Leftrightarrow C... |
I am trying to prove that an undecidable language $L$ is not many one reducible to its complement.
The problem goes as follows:
Formally prove that $L \not\leq_m \overline{L}$ for any undecidable $L$. ($\overline L$ is also denoted $L^c$.)
How would I go about proving this? I am unsure how to prove mapping reducibili... |
Chapter 2.3.2 Analysing divide-and-conquer algorithms of Introduction to Algorithms, fourth edition, by CLRS, says the following:
A recurrence for the running time of a divide-and-conquer algorithm falls out from the three steps of the basic method. As we did for insertion sort, let $T(n)$ be the worst-case running ti... |
Enumerator programs appear quite often in even an elementary computer science textbook without a formal definition. It does not seem to fit the standard definition of a computable function (through mu recursion, Turing machines or lambda calculus), which takes a single input and a single output.
What's a standard liter... |
Show that the formula $\bigcap_{i=1}^n (X_i \leftrightarrow Y_i)$ cannot have an equivalent disjunctive normal form with less than $2^n$ clauses.
I am puzzled on what approach to take -- whether to consider the equivalent boolean functions or some depth trees or some specific example of $X_i$-s and $Y_i$-s in order to ... |
I am studying the concept of heuristics in search algorithms, and the $A^*$ search algorithm in particular. I am told the following:
Greedy search minimises estimated path-cost to goal.
But it's neither optimal nor even always complete.
Uniform-cost search minimises path-cost from the start.
Complete and optimal, b... |
I am working on parameterized complexity and started exploring on various structural parameters. The problem I am working on is known to be W[1]-hard parameterized by treewidth of the input graph and I am wondering if there is any known relationship between treewidth and maximum degree of the input graph. Could anyone ... |
Looking at the tree on the left it seems that the triangles represent leaves of the avl tree. To arrive at the balancing of -2 besides the node y the right subtree must have 2 nodes while the left subtree has a maximum of 4 nodes. Thus 2-4 = -2. However what does the h indicate?
|
The problem:
Given a set of measurements $x_1, x_2, ..., x_n$ and corresponding labels $y_1 <= y_2 <= ... <= y_n$ that designate the desired ranking, count the number of pairs that are actually ranked correctly by $x$. In other words, compute
$$
R((x_k, y_k)_{k=1}^n) = \sum_{i \in 1,...,n-1} \sum_{j \in i+1, ..., n} I(... |
I found this PDA online that accepts all non-palindromes over {0,1}. However, I can't seem to understand how it would accept, say "01011", and not accept "101101". Can someone help me understand how "01011" reaches the final state, and why "101101" doesn't by running through the states with me?
Source: Source
|
For the given figure, let's consider vertex v3. For v3, v0 has a higher partial order,v1 & v2 has the same partial order, and v4 & v5 have lower order than v3, e.g., higher: {v0}, same: {v1,v2} and lower: {v4, v5}. I am looking for an algorithm to recognize these three sets. Is there any proven algorithm to find them?
... |
I am still quite confused on how to properly handle in answering the intersection and equality of two FAs in terms of table form and manipulating its transformation. It is a bit challenging at times when I encounter new FAs to compare. It would help a lot if there would be a proper way and tip to understand the questi... |
So I have a problem that is ,I have an integer array and first I define an interval as a good interval iff, within the interval every integer appears an even (including zero) number of times. I want to find the number of good intervals in a given integer array. For example, if array = [7, 7, 1, 5, 5, 1], the good inter... |
A company is able to earn x dollars per day without any machines. However, there are n machines available for purchase. The i-th (0<=i<n) machine costs v[i] and can bring an extra profit of m[i] per day to the company. Each machine can be purchased only once, but the company can buy multiple machines on the same day. I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.