instruction stringlengths 35 29.1k |
|---|
For an array A = [a1, a2, a3, a4] of distinct numbers, I have built heap using binary decision tree by Incremental and In-place method.
Incremental method:
In-place method:
Is there a way to build heap using decision tree for inputs of size 4 that uses fewer decisions in the worst-case, compared to above methods?
Not... |
Suppose I have a probabilistic Turing machine for a language such that
$$ x \in A \implies \Pr(M \text{ accepts } x) \ge \frac{1}{n}$$
$$ x \notin A \implies \Pr(M \text{ accepts } x) = 0$$
I want to show that the above language is in $\mathsf{RP}$. In particular, I need a probabilistic Turing machine $N$ such that
$$... |
Definition: Well-Characterized also known as Good-Characterized is defined as follows:
Problem that have Yes and No certificates i.e., are in NP $\cap$ co-NP, are
said to be Well-Characterized. (Reference: V.Vazirani,
Approximation Algorithm)
Does exist any Well-Chracterized problem that is also being NP-Complete... |
I'm seeing seemingly contradictory information about this around. On the one hand, it seems that for undirected graphs, you need at least 3 nodes to make a cycle.
On the other other, I've also seen people differentiate between trivial and non-trivial cycles.
Let's say in your directed graph you have two nodes A and B w... |
I have completely understood how Aho Corasick works for finding one pattern in a text, and how to construct the automaton for a certain pattern. I have studied the CLRS book and watched this video. But the problem is that I cannot find any material on how to build an automaton for more than just one pattern. For examp... |
I am reading about/working on the knowledge representation using OpenCog framework http://wiki.opencog.org/w/OpenCog_Framework which essentially is special kind of probabilistic logic (s.c. PLN - Probabilistic Logic Networks) that smoothly generalizes crisp logic (by assigning strength and confidence to the crisp truth... |
My initial algorithm:
Compare element 0 with every other element, keeping track of how many elements are less than it.
Repeat for each element until an element that is greater than exactly (k-1) elements is found.
I assume this would take $O(n^2)$ in the worst case. Can a faster runtime be achieved without sorting t... |
I have a question about undecidability. And I hope you could point out where I am wrong.
The question is: to decide the following question as (A) recursive, (B) RE but not recursive, (C) not RE.
$L = \{\langle M\rangle|M \text{ is a TM and } |L(M)| \geq 3\}$
If we use $HP$ as halting problem and $\overline{HP}$ as the ... |
I want to predict language from the given regular expression.
Regular Expression: $$(b^* (aaa)^* b^*)^*$$
As per my assumption language may be like:
Let the string contain alphabet $\{a,b\}$ where every string contain number of $'a'$ divided/multiply by $3$.
Let me know whether my assumption is correct or not.
Thanks
|
I am working on a programming assignment to implement a Minimax algorithm and heuristic for the game Lines of Action.
The rules are pretty simple, each player alternates turns moving a single piece. A piece may move in rows, columns, and diagonals and it must move the exact number of spaces that there are other pieces... |
I try to understand how the relational division can be expressed by primitive operations of the relational algebra. So, I found this formula (I writed it such as I found it in the same format):
$A \DIVIDEBY B = A[X] \MINUS ((A[X] \TIMES B) \MINUS A)[X]$
But I can't get this. If we use $\TIMES$ (the Cartesian product) t... |
Problems which run in deterministic polynomial time given polynomial sized advice are in class P/poly.
Problems which run in probabilistic polynomial time given polynomial sized advice are still in class P/poly.
What about problems which have an expected randomized polynomial time given polynomial sized advice under ... |
Using Stirling's approximation, we have $\log_{2} (n!) = n\log_{2} n - (log_{2} e)n + O(log_{2}n)$. Most lecture notes I have come across say that $ n\log_{2} n - (log_{2} e)n + O(log_{2}n) = \Omega (n\log_{2} n)$. Can someone give a rigorous proof of the last line using the basic definitions of big-O and big-Omega?
Th... |
Fix a Gödel numbering, and write $\phi_n$ for the function coded by $n$. Rice's theorem states that if $P$ is the set of partial computable functions, and $A \subseteq P$, then the decision problem
Given $n$, does $\phi_n \in A$?
is decidable if and only if $A = \emptyset$ or $A = F$; that is, if the decision problem... |
You are given a tree of $N$ nodes with colors assigned to each node. You need to find for each node $X$, a value $AR[X]$.
$AR[X]$ = The sum of values of $CALC(X , i)$ for each $i$ from $1$ to $N$.
$CALC(A,B)$ = Count the number of non-repeating colors in the path from $A$ to $B$.
Can somebody suggest an efficient solut... |
We know (by Rice's theorem) that is it not possible to decide a non-trivial property of a given TM. We could say therefore that we cannot be sure at 100 percent that a given TM has a certain non-trivial property.
Therefore we cannot know if it is 100 percent impossible to show that a given TM has a certain non-trivial ... |
I just started with my "Algorithms" course. But my CS-background is lower than that of an average CS-student (I'm a data science student). Only had intro-2-prog course (Python/Java), that's it.
Cormen states on page 23: "...when working with inputs of size n, we typically assume that integers are represented by c lg n ... |
I'm currently in a course, and I for the life of me cannot figure out what my professor is doing. I could really use a working example, and I was hoping someone here might oblige.
Suppose we have this recurrence:
$$ T(n) = 2T(n/2) + \log n$$
How would we figure out running time for this, and specifically, how would... |
I am reading a paper and ran into this word Ontology-based, What does it really mean? I did searching about it but still ambiguous to me, can someone elaborate this concept with an example?
Thank you
|
I'm trying to construct a truth table from a finite state machine of flags in a NASCAR race.
Flag meanings: green=start yellow=caution red=stop black=get off white=one lap left checkered=finish line
In an example with a stoplight in class, the variable that makes the current state go to the next state on the stoplight ... |
For any string $s \in \{0,1\}^*$, let the ones' complement of $s$, denoted $1_c(s)$, be the string obtained by flipping all bits in $s$. For example, $1_c(001100) = 110011$. Now call a language $L \subset \{0,1\}^*$ ones' complement asymmetric or OCA for short, if for every string $s \in \{0,1\}^+$, precisely one of $... |
I am on studying a consistency model: weak consistency. weak consistency
This model was first defined by Dubois et al. (1986), by saying that it has three properties:
Accesses to synchronization variables are sequentially consistent.
No access to a synchronization variable is allowed to be performed until all previous... |
For instance, consider the following recurrence relation.
T(n) = T(n/2) + T(n/3) + T(n/4) + n
Would you use the substitution method for this?
|
I am a computer engineering student and trying to get the idea behind all these Artificial Intelligence Concepts and applications. I know little theoretically about machine learning and some high level brief introduction of artificial intelligence as a whole and neural network. What i am interested in is knowing the si... |
In StarCraft Brood War, a map's maximum dimension in either the X or Y direction is 256 cells. A map's dimension is required to be a multiple of 32. Each cell is 32 pixels in both directions (And probably some path finding limitations) and I assume this is the reason for the previous requirement. Thus 256*32=8,192. But... |
In chapter 2 of this book the map overlay algorithm, which takes as inputs two doubly connected edge lists, is explained. "Basically" a line intersection algorithm allows to update both the half edges records and the vertices records. After such step the detection of boundary cycles is applied, and later a graph is bui... |
There is a nice decomposition called trapezoidal to process point location queries given a set of disjoint generally curvilinear segments. I found the randomized algorithm for building this type of decomposition in Berg's book on computational geometry. Can someone point me out papers which report deterministic algorit... |
The Ethernet MAC address FF:FF:FF:FF:FF:FF is reserved for broadcasts. If all frames are naturally broadcast in a LAN, what is the need for a broadcast address?
|
In a layered approach to OS design, each layer can only access routines from the layers below itself.
For example, say I had two levels: memory management and the CPU scheduler
Where does the CPU scheduler sit in a layered OS design?
My understanding is that it must be above the memory management component, since the ... |
I'm learning about superscalar processors and struggling with it a bit. I wrote an assembly program and now must move it through in-order in-issue completion and I have a question about instructions as they move through the latter stages of the pipeline.
I have two instructions I1 and I2. I1 performs an operation on R1... |
I know, it is not possible to decide whether a context free grammar is ambiguous or not. However, I am having a really hard time preparing for an upcoming exam in which I'll have to give a prove of un-/ambiguity for a given grammar.
Up until now,
the first thing I'd do is to look for a word (via try and error) which co... |
I'm curious as to if there's any way to check (without having to run a 'whole' maximum-flow-algorithm) whether a given flow $f_e$ is the maximum flow of the flow graph $G$ in $O(|E|)$ time complexity.
I've thought about running one iteration of Ford-Fulkerson to see if there is an augmenting path from the source $s$ to... |
Suppose you have two large lists of integers of length $N$, and you want to find two pairs $(a_1, b_1)$, $(a_2, b_2)$ from the lists such that $a_1 + b_1 = a_2 + b_2$ (modulo the integer width). Say for example, that $N = 2^{32}+1$ and the integers are 64 bits.
Is there any efficient way to do this? I know that if yo... |
I made a SLAM (Simultaneous Localization And Mapping) using Extended Kalman Filter (EKF) and it works really good, but I want to see if it works better using Neural Networks.
For the EKF I used an initialization step, prediction step and update step,how can I change that to Neural Networks?
Thanks
|
There are already good answers from several perspectives regarding the "hardness" of $PSPACE$-complete problems, such as this: What is practical difference between NP and PSPACE-complete?
But what are the practical implications when we actually try to solve (decide) a $PSPACE$-complete problem on a deterministic Turing... |
Suppose we have a directed graph $G = (V,E$) represented with adjacency lists. Is it possible to convert $G$ into its undirected equivalent* $G'$, also represented with adjacency lists, in $O(|V|+|E|)$ time?
The obvious algorithm walks the adjacency list of each vertex $v$, and for each adjacent vertex $u$, inserts ed... |
A dominating set on a directed graph $G=(V,E)$ is a subset $D$ of $V$ such that for all $v\in V$ it holds that $v\in D$ or there is an $u\in D$ such that $(u,v)\in E.$
For a concrete problem (size reduction of endgame tablebases), I want to approximate the dominating set of a directed acyclic graph with the following ... |
Let's assume that we have a directed acyclic graph $G = (V, E)$, non-negative vertex weight functions $w_a(v)$ and $w_b(v)$, and a non-negative edge weight function $t(u,v)$. We want to divide vertices in two subsets $V_a$ and $V_b$, such that $V_a \cap V_b = \emptyset$ and $V_a \cup V_b = V$. The set of edges $E_{ab}$... |
I have a problem which I'm looking to see if there is literature on:
Consider three types of actors, a Director, Aggregator, and Follower. The Director talks to multiple Aggregators, the Aggregator talks to multiple Followers. The director gives simple commands to the Aggregator, who then can portion out the commands t... |
So in my APCS class today we played around with generating pi, and approximating to a user defined number of places. We used the Leibniz formula for π. As we began playing around with it we tried throwing in 2147483647, the largest value for an int, but noticed it wasn't going to finish anytime soon. I googled runti... |
I know ML is used in real horse-racing and other sports, where team/player history matters and can be used as a predictor for future games.
What about for "simulated" games, where the outcome is decided by probability?
Here's an example of what I mean:
Suppose there are 3 tracks T1 to T3, and 12 horses H1 to H12. Ever... |
I am reviewing the document" Learning occupancy grid maps with forward sensor models, S.Thrun, 2008" (http://faculty.iiit.ac.in/~mkrishna/ThrunOccGrid.pdf)
i am really confused about formula (26), which is merged by formula (22), (24), (25) in an "intersection of probabilities" computed in (22),(24),(25). So, it should... |
I'm a student, so I apologise if this is an idiotic question: Is there a fundamental reason/limitation, such as $P \not = NP$, that prevents computers from being able to do mathematics (posing conjectures, proofs, etc.)? Why or why not?
I have heard arguments that computers will never be able to do mathematics close to... |
Infix, prefix (polish notation) and postfix (reverse polish notation) are all forms of arithmetic operations. As I understand it, infix is what we use in maths where the rules of BODMAS (Bracket, Order, Division and Multiplication, Addition and Subtraction) are used to decide what order the operations are used in. I ca... |
I have a task to search through an array of items. I want to narrow the search down to some partitions. I thought of hash tables, but the difference in my case is that the "hash-function" is not unique; in my case, it rather should be called "partition-function".
Here's a fizz-buzz example:
[-1]:1,2,4,7,8,11,13,14,16
... |
I am studying some page replacement algorithms.
I found an interesting algorithm called "New" algorithm.
From page 17 of this slide (https://web.stanford.edu/class/cs346/2015/notes/Lecture_One.pdf)
The algorithm guarantees that each relation has a working set by subdividing the buffer pools.
I want to read the publishe... |
There is a grid of size WIDTH * HEIGHT.
X fruits are randomly distributed on the grid.
Each player is randomly placed on the grid.
The game runs for X / 2 turns.
Each turn, a player can move left, up, right, down or not move at all. At the end of each turn, the fruits on each player's square are added to their score, r... |
I could use some help coming up with the best way to solve this problem. I've been curious as to how something like this would work, as the worst case seems way too bad.
Problem
Given a group of students and the courses they are enrolled in, and a schedule with 8 class blocks in it, how could you place them in specific... |
I attempted this question on hackerrank. It seemed simple enough, and my program ran on small inputs. But my approach was "naive". And failed for more computationally intensive inputs. Here is the question:
Problem Statement
You are given a list of size , initialized with zeroes. You have to perform operations on the ... |
I have a polyhedron defined as a set of connected voxels (from a 3D array). I'd like to get a representation of this polyhedron by its polyhedral surface (since it's going to be much sparser). Can I get that in quasilinear time? Do I need my set of voxels to be represented in a particular form?
I don't even know the an... |
Some of Conor McBride's works, Diff, Dissect, relate the derivative of data types to their "type of one-hole contexts". That is, if you take the derivative of the type you are left with a data type which shows you how the data type looks from the inside at any given point.
So, for instance, if you have a list (in Hask... |
I'm trying to create a TM that changes all $a$'s to $b$'s and all $b$'s to $a$'s in a given string and then halts on the first blank space it encounters. What I have is:
$$ \langle q_1,a,b,q_1\rangle \\
\langle q_1,b,R,q_2 \rangle \\
\langle q_2,a,L,q_1 \rangle \\
\langle q_2,b,a,q_2 \rangle \\
$$
I'm new to Turing ma... |
I have two recurrences:
$T_1(n) = 2 T_1(n-1) + n$ if $n > 1$, $1$ if $n = 1$
$T_2(n) = 2 T_2(\frac{n}{2}) + n^2$ if $n > 1$, $2$ if $n = 1$
Does this mean $T_1$ is better than $T_2$ because it has less operations to do?
Edit: I looked at the master theorem and found out that the 2nd one has an $O(n^2)$ runtime.
|
A set of functions from a universe U of keys to n buckets is universal if for every pair of keys in U, say x and y, such that x != y, the probability of h(x) = h(y) is less than or equal to 1/n, for a random function h in the set of functions.
Say you're given a prime number p, and a random integer n, such that p is gr... |
I wrote a simple C++ implementation of the revised simplex method that recomputes the LU decomposition of the basis from scratch on each iteration. I have to solve problems with many variables but few constraints (say, 50 constraints and 5000 variables or more), so I thought that was ok.
Then I decided to implement a b... |
What is the significance of reversing string $v$ in the following? Can't the string $v$ contain exactly what is in the string $v^R$, since you are just choosing from the alphabet $\Sigma^*$? I don't fully comprehend this question.
Consider the language
$$L = \{uabcv\mid u,v\in\Sigma^*\}$$
over the alphabet $\Sigma... |
Could someone explain to me which function grows faster?
$f(n)=\log(\log^an)$ or $g(n)=\log^a(\log n)$
|
If you have a language $L_1 = \{ w | w \in \{a,b\}^* \}$. Then does the language $L_1^R$ (the reversal of $L_1$) have the exact same elements as the language $L_1$?
My Logic: Since $L_1$ can contain a string as well as the reversal of the string (ex. $L_1 = \{ababba, abbaba\}$), then $L_1^R$, over the same alphabet, c... |
Given alphabet $\Sigma=\{a,b\}$, is the language
$$L = \{ w \mid w\text{ contains an equal number of substrings }aa\text{ and }bb \}$$
regular?
My initial though was no, because the language $L' = \{a^nb^n\mid n\ge0\}$, is not regular, and is of the same general form as $L$. However, I am confused about how $aa$ and $... |
How do I prove or disprove the following statements:
$$(a) ∀n ∈ \mathbb N, ∃k ∈ \mathbb N, ∀x ∈ \mathbb R , \lfloor nx \rfloor − n \lfloor x \rfloor ≤ k$$ and $$ (b)\exists k \in \mathbb N, \forall n \in \mathbb N, \forall x \in \mathbb R, \lfloor nx \rfloor − n \lfloor x \rfloor ≤ k $$
I've also been given the followi... |
A message I sent to a CS professor:
So I have a question about computer science in general.
I would like to build "stuff" in the future, not just program my whole life. I'm not sure if I did right by majoring in Computer Science instead of an engineering field. I could always get my masters in Software Engineering but... |
For quadratic hashing, i.e an open-addressed table with the hash function of the form -
$h(x, i)= (h'(x) + c_1i + c_2i^2) \mod m$
Setting $c_1 = c_2 = 1/2$, and $m$ to some power of 2, leads to a hash function
$h(x, i) = (h'(x) + 1 + 2 + ... +i) \mod m$
I have read that the load-factor of a quadratically probed table s... |
In triangulating a simple polygon, using the concept of sweep line helper vertices etc, the very first step is sorting the vertices of such polygon. Apparently this very step can be done in $O(n)$ (where $n$ is the number of vertices). I'm trying to work out why... Assume there's no degenerate case (for any pair of poi... |
Assume a well-founded relation $<$ over a set $S$ and a property $P$ on $S$ such that:
$P$ holds for all minimal elements of $S$.
For every $b \in P$ and $a < b$ we have: if $P(a)$ then there exists $c < b$ such that $P(c) \Rightarrow P(b)$.
Question: does it follow that $P(c)$ holds for all $c \in S$?
|
Often, I see people using networks like AlexNet, GoogLeNet, etc to train it on their dataset. These networks are trained or pretrained with a specific dataset, and people fine-tune it to their dataset.
However, is this really suitable? What if the custom dataset had a lot more images than the original or is detecting c... |
Since Knapsack give Optimal solution as LP so is it also a LP or not ?
|
I'm writing about a problem that could be caused by race conditions between multiple threads, or OS-level processes on the same machine or different machines, or VM-level processes like the Erlang VM has.
In this context, the fact of parallel execution is the important part; the language or memory-sharing model is irre... |
Given a grammar as follows:
$\left<stmt\right> \rightarrow \left<id\right> = \left<expr\right>$
$\left<const\right> \rightarrow A | B$
$\left<expr\right> \rightarrow \left<term\right> \times \left<expr\right> | \left<term\right>$
$\left<term\right> \rightarrow \left<factor\right> + \left<term\right> | \left<factor\rig... |
I'm confused by the running time of the following algorithm. I've been told it's $O(n^3)$, but there are only two loops. How can that be?
for(int i = 0; i < s.length(); ++i) {
for(int j = i; j <= s.length(); ++j) {
String sub = s.substring(i, j);
if(isPalindrome(sub) && sub.length() > maxCount) ... |
Suppose I am trying to construct a simple AVL tree:
Upon inserting 'B' the tree becomes imbalanced. How do I exactly know that I need a LR or RL rotation without making any guesses?
From what I heard is that if you insert at right side of tree and it becomes imbalanced then you need a LR rotation and vice-versa. I wan... |
I have two series of tuples
$$
A = \{(x_0,t_{01},t_{02}),(x_1,t_{11},t_{12}),\ldots,(x_n,t_{n1},t_{n2})\} \\
B = \{(y_0,tt_{01},tt_{02}),(y_1,tt_{11},tt_{12}),\ldots,(y_m,tt_{m1},tt_{m2})\}
$$
where $m \neq n$ and $t$ and $tt$ are both time observations. $t_{i1}$ and $tt_{j1}$ are both the start of some epoch for arbi... |
The purpose of performance profiling is to measure program performance. One part of your PA1 assignment asked to measure performance of your d-smooth algorithm to verify if the running time of the program corresponds to the desired $O(n \log n)$. Assume that you have performed an experimental analysis of an algorithm, ... |
Let $M$ be a square matrix and $S(M) = \sum_{i<j} m_{i,j}$ the sum of the elements in the upper triangular part of $M$. Is there an efficient algorithm to find a permutation matrix $A$ that minimizes $S(A M A^{\top})$
|
I am trying to find the weakest precondition and invariant of this while loop. I have read and am trying to understand the concept of calculating preconditions based on postconditions. I was wondering if someone could explain it to me.
while i < j do
i = i + 1;
j = j - 1;
end
{i = j or i = j + 1}
|
Implement a one-bit ALU which takes two one-bit operands $a_0$, $b_0$, and produces a one-bit output $z_0$. The ALU has a two-bit control input $cont_0$, $cont_1$, with codes as shown below.
|$cont_0$|$cont_1$ |selects
|--- 0 ---|--- 0 ---| AND
|--- 0 ---|--- 1 ---| NOR
|--- 1 ---|--- 0 ---| OR
|--- 1 ---|--- 1 ---|... |
In the book Introduction to Algorithms of Cormen 3rd edition page 1041 about of Closest Pair of Point divide and conquer algorithm, Is there an error? It's said: "...Create an array Y', which is the array Y with all point not in the 2$\delta$-wide vertical strip removed...", it should be: "...Create an array Y', which ... |
Some language A ⊆ Σ∗
is called complementary if A ≤m complement of A. How can I show that there exists an
undecidable complementary language?
|
This is a distributed systems problem, but perhaps the graph theory gurus can help me.
I need an algorithm that that tells me which nodes to remove from the graph to completely remove connectivity.
See example:
The most intelligently thing to do would be to remove the bcasts nodes:
Can you help me? One way to solve... |
So basically, automated language-oriented programming. I've tried finding info on this concept, but have had some trouble, probably because my brain is having a bit of trouble grasping the subject while thinking about it. It could be better defined as metaprogramming going to a deeper level- rewriting the programming l... |
Assume there is an array $A$ of $n$ elements. $A$ contains every number from $1$ to $n$. We are given an array $B$ of $n$ elements. If we move each element $A[i]$ left by $B[i]$ places starting from $i = 0$ until $n-1$, in the end array $A$ will be sorted in increasing order, i.e. it will be $A = [1, 2, 3, ..., n]$. Gi... |
The perceptron model describes a linear classifier. Often people use the term "multilayer perceptron" to describe a feedforward neural network that uses perceptrons. This terminology simply sounds wrong to me, since this type of network does not necessarily behave like a perceptron; that is to say - it may act as a non... |
so I'm working on a variation of the knapsack problem which includes a constraint on the number of each item from each category in addition to a weight. For instance, we have a number of books each given a genre (1 of 3 genres), and our goal is to maximize the total weight as well as include at least G books from each... |
In my opinon the Language recognised is this:
$(a + b)^* (ab)^ω$
but the solution provided is: $(a + b)^* (a + b)^ω$
Did I missunderstand the acceptance condition or is the solution wrong?
My reasoning is:
As far as I understood a Muller Automaton does accept a run if all the set of all infinitely often visited states... |
I aim to gain more intuition with regards to the role of a hidden layer in a neural network architecture. And further to understand whether my classification problem is a linear one or not.
Here is what I have: I have a input of size 128 which is the output of the FFT of a multi-tone signal. Bellow you can find one inp... |
I was going through the following paper: http://www-formal.stanford.edu/jmc/recursive.pdf
In the last part of the second section (at the end of page 7) he speaks about the inadequacy of lambda notion for naming functions described recursively.
The right hand side of the following expression
$$\text{sqrt} = \lambda((a,x... |
Im currently enrolled in an AI course and we are starting with state space search problems. My professor always seems to ask, given a certain problem, what is the estimate size of the state space? It's been 3 years since ive taken a course in discrete math which is the type of question I am asking.
How can I use things... |
I have got some difficulties to solve this algorithm problem.
I have been given a set of n points on a number line. Those points are not sorted in the set. For any two points $(a, b)$ in the set, their distance is calculated as $|a-b|$. Now I need to calculated the kth largest among all possible distances of the n poin... |
I was wandering if $L = \{\langle G \rangle \mid \ G \text{ is a context free grammar and } \mathcal L(G) = A \}$ is decidable where A is a some regular language. Is
$L' = \{ \langle G \rangle \mid \ G \text{ is a context free grammar and } \mathcal L(G) = \overline A \}$ decidable ? I feel like $L'$ should be decida... |
I have a very large amount of objects that look like this:
DataDict = {
id1: {"a": true, "b": true, "bc": true, "hgf": true},
id2: {"bcwe": true, "nKNNn": true, "mjj": true, "AAt": true},
id3: {"h": true, "a": true, "mjj": true, "ABwAU": true},
id4: {"wvzy": true, "zzba": true, "abc": true, "a": true},
...
}
or ju... |
Having difficulty grasping the concept of how a language and a regular expression are related. For example:
(In all cases, the alphabet is $\{0,1\}$)
The language $L = \{100,10,011\}$ ------> Regular expression.
So far, I have:
$(0+1)$ since you can have either $0$ or $1$ in the first part...but...I'm not sure what w... |
For languages A and B, let the shuffle of A and B be the language
$ \{w| w = a_1b_1···a_kb_k,$ where $a_1···a_k ∈ A$ and $b_1···b_k ∈ B,$ each$ a_i,b_i ∈ Σ^∗\}$.
Show that the class of regular languages is closed under shuffle.
Approach: If A and B are regular, then there exists an NFA R and T that recognizes them. I was... |
How to use algebra in operations that involve asymptotic notation?
Like for example:
$C_1(n)= O(n)$
$C_2(n) = O(n^2)$
Is $C_2(n)/C_1(n) = O(n)$?
|
(all automata sizes are expressed in number of states in this question)
There exist NFAs of size $n$ for which the smallest DFA recognizing the same language is of size at least $2^n$.
Let $\Sigma$ be a vocabulary, and let's consider $n$ regular languages $L_i \subseteq \Sigma^*$ respectively recognized by $n$ DFAs $D_... |
Suppose that we have the above graph. The graph is directed and is unidirectional; that is, we can only traverse it from top to bottom.
We want to update the count of the nodes such that the count of any given node indicates the sum of the count of the node itself and the previous nodes, avoiding any duplicate nodes.... |
Consider this question ( 18.2-4 of CLRS) which states that:
Suppose that we insert the keys ${1,2,...,n}$ into an empty B-Tree with minimum degree 2. How many nodes does the final B-tree have?
My approach:
We add each element one by one. We'll need 3 elements at first (namely 1,2 and 3), after which the $4th$ eleme... |
It's said that constant references within a program are replaced by the value at compile time, where as, variable references will need to be looked up at run time - making them slower.
Yeah, it sounds faster, but won't they ultimately both be locations in memory (that will have to be looked up), with the difference bei... |
Can we transform a CNF to ILP without introducing new variables?
My question can be seen as a follow up to Express boolean logic operations in zero-one integer linear programming (ILP) as the solution proposed in that post introduces additional variables.
Also, my current understanding is that each 0 value in the truth... |
Given a DFA $A = (Q, \Sigma, \delta, q_0, F)$ with $n$ states and a homomorphism $h: \Sigma \to \Gamma^*$. It is easy to see that the family of regular languages is closed under homomorphisms using regular expressions or by construction of a grammar.
My problem now is to analyze how many states are needed for a DFA $A... |
Is there a special term for a cycle containing a single vertex and edge? I feel like I read "self-cycle" somewhere, but can't find where.
|
Let image $x$ be an original (non-warped) image. Let $I_1$ be $I_1'$ having suffered some projective transformation and possibly some noise.
Suppose we have computed SIFT descriptors for both images.
Can you explain how RANSAC is concretely used to find the homography that aligns image $x$ and $y$?
More concretely, I u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.