instruction stringlengths 35 29.1k |
|---|
Construct a turing machine (TM) over the alphabet {a,b,0,1,#} that reads strings of the form (ab)^n with n>0. If the string w on the tape has this structure, the TM should overwrite all letters with the character 1 and go into an accepting state and if not, the TM should overwrite all letters with the character 0 and ... |
I have a set of $d$-dimensional hyper-rectangles with integer axes. These hyper-rectangles may overlap. The union of these hyper-rectangles forms a $d$-dimensional orthogonal polyhedra $P$.
I sort the $d$ dimensions in order. So there are dimensions $1,2,3,\cdots,d$. I want to express $P$ by a directed graph $G$ (inste... |
I am reading Algorithms by Dasgupta et al and the graph section provides an example graph and mentions that there are 4 orderings with one of them being B, A, D, C, E, F.
Are the other 3?
B, A, D, C, F, E
B, D, A, C, E, F
B, D, A, C, F, E
|
I'm reading The Algorithm Design Manual and this is one of the excersizes:
Prove or disprove the following statement:
$\Theta(n^2 ) = \Theta(n^2 + 1)$
I think this is untrue because the right side of the equation claims to have a multiple $c$ such that it is smaller than all the multiples of $n^2$, which is untrue.
B... |
I am currently working on CLRS 1.13. The idea is to use Stirling's
approximation to prove that
$${2n \choose n} = \frac{2^{2n}}{\sqrt{\pi n}} \left( 1 + O \left( \frac{1}{n} \right) \right)$$
Now directly replacing Stirling's approximation I arrive to something like:
$${2n \choose n} = \frac{2^{2n} \left( 1 + \Theta(\... |
I have a large (10 million+) set $X$ of data points in some high dimensional $\mathbb{R}^d$ ($d \geq 500$) space. Each data point is quite sparse, e.g. has around $10$ components. Every missing component can be seen as having value $-\infty$ for the purposes of this problem. Associated with each data point $X_i$ is a ... |
I'm having troubles finding information on how to solve/optimize a problem I'm currently facing, which probably means I'm either approaching it poorly and/or I don't know what to search for.
The question I think I need the answer to: given several sets of possibilities, what is the smallest number of sets I must select... |
how can I find the regular expression for this intersection ?
I've tried to find words but it did not help too much..
$$[\; (a+b)^* c^* (a+b)^* \;] \cap [\; (c+b)^* a^* (c+b)^*\;]$$
|
int P(int n)
{
if (n==1)
return 1;
else
return P(P(n/2));
}
How will this function P(P(n/2)) be executed and what will be the recurrence relation for this code?
Original image with the code
|
In the book - Computer Organization and Design: The Hardware/Software Interface [RISC-V Edition] by Patterson and Hennessy, CPI is defined like this:
The term clock cycles per instruction, which is the average number of clock
cycles each instruction takes to execute, is often abbreviated as CPI. Since different
instru... |
If I have two kinds of LinkedList $A$ and $B$.
$A$ is a move to front one which means:
>>> lst1 = 1, 2, 3, 4, 5, 6, 7, 8, 9
>>> lst1.contain(7)
True
>>> lst1.to_list
7, 1, 2, 3, 4, 5, 6, 8, 9
$B$ is a swap list, which means:
>>> lst2 = 1, 2, 3, 4, 5, 6, 7, 8, 9
>>> lst2.contain(7)
True
>>> lst2.to_list
1, 2, 3, 4, 5, ... |
Suppose I have some (increasing, nice asymptotics) function $f(n)$. Does there exist a complexity theoretic problem (e.g. PATH, 3-SAT, GO etc.) that can be solved in time $\Omega(f(n))$ on a deterministic Turing machine. In other words is there a problem proven to be an element of $\mathsf{DTIME}(f(n))$, but not $\math... |
I have to work on something , but I am making an error that I can not identify. Propably, it is going to sound simple to you but it's my first course on computer architecture and there is nothing in my slides or book.
"We are given a memory, where the smallest chuck of information that can be adressed is 1 byte, and we... |
I was studying shortest path algorithms and was met with an issue regarding Bellman Ford for the image below.
Following the graph, i see that node 3 has a length of 1 while node 2 has a length of 2. When computing the path from 1 to 8 which is the correct path between 1->2->6->4->7->8 and 1->3->2->6->4->7->8 ?
I can s... |
Suppose you have an $n\times m$ 2D array consisting of each $n$ rows of $m$ real numbers. What is the sequence of indexes $i_1,i_2...i_m$ such that $\sum_{j=1}^mA[i_j, j]$ is maximized, subject to the constraint that each run of a value in $i_1...i_m$ must be at least $r$ entries long?
A correct algorithm with time lin... |
We consider training one-dimensional open map of Kohonen with neurons in one-dimensional input space. We assume it is completed the phase of the device and the weights $w_i$, $i = 1,2, \dots, N$, are placed in ascending order. (As we know, this provision will not change in rest of the training.) At each step of the tra... |
I get $n$ numbers, where every number is an integer between 1 and 1000. If within given numbers are duplicates, I sum all of them to one number. I repeat it until I have only distinct elements. As a result I return number of distinct elements at the end.
How do I do it in additional space complexity $O(1)$ and time com... |
Let $n$ be a positive integer. On a circle are arranged $n$ points $A_1$, $\ldots$, $A_n$. We put some arrows from $A_1$ to $A_2$, from $A_2$ to $A_3$, etc., from $A_n$ to $A_1$. On each arrow are written a string ($\textit{name}$ - so that we could distinguish all arrows from each other) and a number. How can we find ... |
Given a random graph $G(n, p)$, where $n$ is the number of nodes and $p$ is the probability of connecting any two edges, it is known that $t = \frac{\ln(n)}{n}$ is a threshold for the connectedness of the graph: if $p$ is greater than $t$ the graph will be almost surely connected, otherwise disconnected. The farther yo... |
I am working on a chatbot designer interface. The dataset for the conversation flow consists of messages. Each message has a parent message and can have multiple possible next messages. The system displays one of the possible next messages depending on the reply. This makes it a complicated structure of parent-children... |
There's lots of answers on the proof but I didn't find anything that regarded my difficulty directly.
Question ( From " Introduction to Algorithms ( Cormen ) " ):
Answer ( Found on the net ):
I don't understand the case where $ A[j] = v $ when we prove the maintenance step for before the j+1-th iteration ( after ass... |
I have the following mixed integer programming (MIP) problem:
$$
\begin{array}{rll}
\text{Maximize } & z=k \\
\text{subject to }
& a_ik - m_i \geq 0 & (i=1,\dots,n) \\
& b_ik - m_i \leq 1 & (i=1,\dots,n) \\
\text{where}
& k \in \mathbb{R}_{\geq 0}, m_i \in \mathbb{N}_0 & (i=1,\dots,n),
\end{array}
$$
where $a_i,b_i$ ar... |
I'm pretty confused so I hope I don't mix up the different terms here.
The two's complement representation of decimal 0 is simply 000
The two's complement of 000 is 111
I imagine that complementing a number is equivalent to flipping bits in binary
The nine's complement of 000 is 999
This is what confuses me. Are ... |
I am reading Automata and Computability by Dexter C. Kozen and I am in the first chapter entitled Strings and Sets.
If we have a set $A=\{ab,b\}$ do we get to assume that the null string $\epsilon$ is also a member of that set? If we have another set $B=\{\epsilon\}$, does $A\cap B = \{\epsilon\}$ or does $A∩B=\emptyse... |
In boolean logic, why is the "opposite" of AND (&) equal to OR (|)?
For example, why would !(A & B) be equal to (!A | !B)?
I understand that not A would simply be !A, but why does AND change to OR?
|
I drew a Push-down Automata, accepting the following language:
$$
\{ xcy : x,y \in (a+b)^*, \#_a(x) > \#_{bb}(y) \}.
$$
Here $\#_{bb}(y)$ counts the number of times that $bb$ appears in $y$, with overlaps. For example, $\#_{bb}(bbb) = 2$.
My question here. Is it possible to reduce my PDA to less states? Thanks.
|
Let $G=(V,E)$ be a weighted undirected connected graph and $w: E \to \mathbb{R^{+}}$ a weight function so that there are no two edges that have the same weight, and $T$ is an MST of $G$ . Then in each cycle in the graph, the edge with the minimum weight belongs to $T$.
I either need to prove it in a positive way or gi... |
I've been trying to find a formula that helps us identify where an address can be depicted in cache. I remember my professor talking about some kind of division but I can't find it in my textbook nor internet (maybe I am not searching the right words). For example:
I have a cache that has $2^{14}$ blocks, each 32 byte... |
I'm trying to prove that $L=\{a^kb^ra^m|k,r,m\ge0 \text{ and } m=k+r\}$ is not regular and, although it's trivial to prove it via pumping lemma, I'm having troubles trying to find a way to prove it via closure properties (for example a union of $L$ and another regular language which may give a non-regular language).
It... |
I am a beginner at Java and this code example came up in class:
int horsepower = 15;
if(horsepower > 15)
if(horsepower <= 20)
System.out.println("There is a lot of horsepower");
else
System.out.println("The car super fast");
the output is nothing but I can't understand why.
I... |
For an alphabet $A = \{ a_1, a_2..., a_n \}$, the set of regular langages $L_r$ on $A$ are recursively defined by closed union, concatenation, and Kleene star's operator. I understood that languages ($A^*$) and regular languages (a subset of $A^*$) are different. Why do we need Kleene star, isn't concatenation enough f... |
Suppose I have a $n$-state non-deterministic finite automaton $F$ over alphabet $\Sigma$. Let $S(x)$ be the set of states reachable from the starting state by consuming string $x$.
I am interested for a given NFA to compute a $n \times n$ simultaneous reachability matrix $R$, such that $R_{ij} = [\exists x : \{i, j\} \... |
Suppose $L$ is a regular language over $\Sigma$ and we want to show that $$\frac{1}{2}L = \{x \in \Sigma^* \mid \exists y \in \Sigma^* (xy\in L \wedge |x| = |y|)\}$$ is regular. I thought of taking the set of even length strings over $\Sigma^*$ (given by $(00\cup01\cup10\cup11)^*$) and then interescting with $L$, which... |
Finding a clique $C$ in an undirected graph $G= (V, E)$ such that $|C| > |V|/2$ is in P or NP-hard? How can I prove it?
|
I noticed that in complexity classes, logspace class is defined but there is no logtime.
I was wondering how is that possible?
Normally, I would expect the opposite, It is possible to do a search query in an ordered list in time less than the time of iterating over all items (==> Logtime?). However you can't store a li... |
I have a grammar:
$G → id > id$
$| id < id$
$| G and id$
Does anybody know how I can do left recursive elimination on this one, when it doesn't have any extra non terminals?
|
Hello I am currently working on an implementation of MCTS and I ran into the problem that my tree traversal policy selects nodes with terminal game states. Furthermore how do I prevent selecting a Node that only has children Nodes with terminal game states ( and so on and so on )?
|
A theorem says if $f$ is a computable function and we can prove $x \in A \Leftrightarrow f(x) \in B$, then we can use reduction so $A \leq_m B$.
But i'm confused if should I prove if :
$(x \in A \Rightarrow f(x) \in B )\land (f(x) \in B \Rightarrow x \in A)$
Or
$(x \in A \Rightarrow f(x) \in B ) \land(x \notin A \Ri... |
I recently started learning about distributed computation on graphs (not to be confused with parallel computation with threads).
I have seen as a side note in a few lower bound proofs, a reference that says the proof could be shorter using the "linear lower bound theorem for the Equality problem", but I couldn't find t... |
Assuming we have a regular language $L$, how can we prove that $L'= \{ xz \mid \exists y : xyz \in L \text{ and } |x|=|y|=|z|\}$ isn't necessarily regular.
So far I can't come up with much for how to solve this. I was thinking we could solve this by either generating an example where $L'$ isn't regular or we could use ... |
I've got a very general question about the relational model and it's relationship to 1st order predicate calculus. It will probably seem very basic to most, I'm afraid, a consequence of me grappling with these concepts on my own for the first time. I would love it if someone could please clarify.
One often sees example... |
I recently read the Berry and Boudol's chemical abstract machine [1, 2]. I found the way they describe the semantic really nice and quite intuitive for a process calculus.
The aspect that really appealed me is that, in the chemical abstract machine (ChAM hereafter), configurations are multiset of processes (and process... |
I am curious about something pretty simple, though I have never heard, read and more sadly seen any example of it.
Take any image, represent it as a matrix, invert the matrix (assuming the inverse exists) and represent it as an image again.
This in some sense visualizes the process of inverting a matrix. It would be pr... |
In my Computability and Complexity class, we are focusing on P, NP,
NP-complete, and NP-hard problems and the one thing that keeps coming up
is the SAT problem, in the context of reduction from one complexity to
another or to explain certain concepts.
Why is SAT so ubiquitous in theoretical computer science?
|
Suppose that I want to enumerate all English language words of length 5.
If I've got nothing more than a check of whether an arbitrary string is an English word, I have to do 5^26 calculations.
However, suppose that I can check a partial specification to see if there are any words consistent with it.
By partial specifi... |
Assuming the input photo is focused on a person's face, if the person is wearing a surgical mask, most face recognition software fail to identify the subject's face.
Most facial landmark models are trained to identify at least the eyes and the tip of the nose (for example, dlib's 5 point landmark).
Is it possible to co... |
The Problem:
I'm trying to simulate part of the game tantrix which is a board game played with hexagonal tiles. Each tile has 3 lines of different colors that each start at one side of the hexagon and end at another side. a line is drawn between these tiles. Adding multiple tiles together one can make a line consisti... |
Recently, I've encountered the following problem:
Given a collection of sets $S_1 \dots S_n$ of elements $e_1 \dots e_k$ with element $e_k$ denoted privileged, and a $k-1$-vector $r$, choose at most $m$ of the $n$ sets to maximize the number of times the privileged element $e_k$ occurs in the multiset union of the chos... |
I am having trouble on the following algorithms question:
Given $f(n) = \sum^n_{y{=}1} (n^5\cdot y^{22})$, I am trying to find a $g(n)$ such that $f(n) = O(g(n))$.
I know that this means I need to find constants $c,n_{0}$ so that $f(n) \leq g(n)$ for all $n > n_{0}$.
I began by considering the expansion of $f(n) = n^{5... |
I am reading chapter 3 Decomposition of Graphs of Algorithms by Dasgupta, Papadimitriou & Vazirani and they show a pictorial representation of pre and post numbers with brackets for tree, forward, back and cross edges. I have pasted the image of the area I am unclear on.
I am assuming that u is the node/vertex we see f... |
Many times, I've wished to plug in my backup hard disks into my PC without the risk of any of the data being deleted, overwritten, or modified in any manner. Purely for "inspection" and copying over certain files from it.
But, unlike on the old floppies, there's just no hardware switch anywhere to enable "read-only" mo... |
The distance transform gives the distance of each pixel in a mask to the nearest zero.
E.g. lets take the Taxicab distance transform:
input distance
1 1 0 2 1 0
1 1 1 -> 3 2 1
1 1 0 2 1 0
I'm looking for a generalized distance transform where each each element in the mask also has a "weight" or "i... |
I am trying to devise a Las Vegas algorithm to solve Maximum Independent Set, but I don't know how to start.
Also, I want to devise a Mont Carlo algorithm for this problem.
I would appreciate any help.
Thank you.
|
I was reading about simulated annealing on its Wikipedia page, and was drawn to a particular example illustrating the annealing schedule. Below is the picture and its description:
Example illustrating the effect of cooling schedule on the performance of simulated annealing. The problem is to rearrange the pixels of a... |
I read following explanation from Dasgupta's Algorithms book for Median finding, this is the same philosophy applied in randomized quick-sort.
Here as per book terminology $S$ denotes array of integers, $v$ is pivot, $S_{L}$ and $S_{R}$ are left and right side of pivot element.
To distinguish between lucky and unlucky ... |
For algorithms involving binary trees, time or space complexity is often O(logn) in the best case of a completely balanced tree, and O(n) in the worst case of a completely unbalanced tree. Sure, it's a generalization, but it's also a reasonable one.
But in real algorithms, we're typically not interested in the rare wor... |
Suppose that there are two probabilistic automata $A_1$ and $A_2$ with a same finite alphabet $\Sigma$. The languages of them are $\mathcal{L}_{1} \subseteq \Sigma^*$ and $\mathcal{L}_{2} \subseteq \Sigma^*$ respectively.
For every input $x \in \Sigma^*$, $\Pr \{ x \in \mathcal{L}_{1}\}=p_1(x)$ and $\Pr \{ x \in \mathc... |
Suppose the use of linear regression. The result of the MSE is 120.5(mean squared error) for the train-set. Wev'e reached the minimum of training the data.
Is it possible that by applying Lasso(L1 form) we would get a lower MSE for the train? and for the test? is the same also holds for Ridge(L2 form)?
Lasso Train
Las... |
I need to build a turing machine that decides $A=\{0^{2^n} | n \ge 0 \}$ with an alphabet of two symbols - $\{0, \_ \}$.
I'm aware of the known TM that decides this language with three symbols $\{0, x, \_\}$ but I am not able to come up with one that does it with just two.
Any advice would be highly appreciated
|
I have some problems to understand computability and hope you can help me.
In the lecture we had following problem:
Consider the three partial functions $f,g,h\colon N \to N$, where $f$ is computable and $g$ is not computable. The following two statements are correct:
If $h(x) = g(f(x))$, then $h$ could be computable.... |
In several posts on StackExchange and elsewhere, I have seen claims that you only need to show you can construct constants, successor, projection, composition, and minimization to prove a language Turing-complete, since primitive recursion is allegedly a special case of minimization. But as I have been thinking about i... |
How do I construct a DFA for the language $\{0^m1^n \mid m+n \text{ is even}\}$? The corresponding regular expression is
$(00)^*(11)^* + (00)^*0(11)^*1$.
|
I'm trying to come up an efficient algorithm that, given a list of positive integers $a = \left(a_1, \ldots, a_D\right)$ and positive integer $c$, finds a list of non-negative integers $b = (b_1, \ldots, b_D)$ that minimizes $\prod_{i = 1}^{D}\left(a_i + b_i\right)$ such that $\prod_{i = 1}^{D}\left(a_i + b_i\right)$ i... |
I try to express datastructures in a form of mathematical functions. For example an array or a dictionary is just a function to me.
Is there a good way to model a tree in terms of functions?
|
Say we have two strings s and l, and they only have characters 'a' through 'z' (lowercase English alphabet characters). The task is to find the maximum number of consecutive occurrences of s in l.
Ex.
s = "ab"
l = "defgababajklabe"
The answer here would be 2, because there is "abab" which would be 2 consecutive occurre... |
I am given the following problem description:
Given $l$ lists, $L_1$, $L_2$, . . .$L_l$ each containing $N$ bit vectors of $n$ bits each, we want to find tuples $(x_1,···,x_l)$ with $x_i$ in the corresponding $L_i$, such that:$$⊕_{i=1}^l x_i = S $$ for some target n-bit vector $S$. In other words, we want to find one... |
I understand that the language $L = \{ a^mb^nc^k \mid m=n \text{ or } n=k \}$ is context-free because it can be represented as the union of $L_1 = \{a^mb^mc^k\}$ and $L_2 = \{a^mb^kc^k\}$, which are both context-free. But I can't figure out the working of the PDA accepting $L$.
To check whether $m=n$, first of all $m$ ... |
In this circuit, if the two qubits are initialized at state 0, then after the oracle they are entangled and in the state:
$$\frac{1}{2} (|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$
My question is, how do the two $H$ gates act on them? Do they act like:
$$\frac{1}{4} [(|0\rangle+|1\rangle)\otimes(|0\rangle+|1\rangle... |
I am struggling with a specific question regarding complexity classes. The question goes as follows:
There are three languages A,B,C so that:
A is NP-complete
B is in P
C is polynomial time reducible to A $\triangle$ B (symmetric difference)
Which of the following statements is valid:
C is in P
C is in NP
C is ... |
As I was preparing for the CCC this year, I am quite confused as to why a certain code modification was able to speed up my code for CCC Seniors Problem 2.
Here was the C++ source code for my first attempt, which scored 13/15 in the cccgrader website as well as the DMOJ online judging website.
#include <bits/stdc++.h>
... |
For an optimization problem $x^* =\text{argmax}_xf(x)$ s.t. $x \in Y$ satisfy to some constraint $Y$.
Can I argue that if there is a polynomial algorithm for this optimization problem. Then there must exist a polynomial algorithm checking if $x$ satisfy constraint $Y$?
|
If a constraint satisfaction problem $x \in Y$ is NP-Complete.
Can I conclude that the optimization problem $^* =\text{argmax}_x (x)$ s.t. $x \in Y$ is also NP-Complete?
|
I am trying to design an LL(1) Parser that accepts regular notation where 'E' represents epsilon, and 'U' represents "or" like ' | '.
So far I made one that accepts T = { a, b, *, +, (, ), E}
S -> T S'
S' -> + S | ε
T -> F T'
T' -> T | ε
F -> P F'
F' -> * F' | ε
P -> ( S ) | c | E
c -> D M
M -> C | ε
D -> a | b
I ... |
If 2 CPUs have the same Instruction Set Architecture, which of the following properties will be the same?
Clock Rate
CPI
Execution time
No. of instructions
MIPS
|
I learned two approximation algorithms for the min Steiner tree:
The first algorithm:
1- Compute the metric closure G' of G.
2- Compute a min spanning tree T' of G'
3- Construct the union U of the shortest paths in G which correspond to edges in T'
4- Output the Steiner tree T contained in U.
The second algorithm:
1-Fi... |
I have come across this video on skip lists:
https://www.youtube.com/watch?v=UGaOXaXAM5M
Clearly, the creation of skip-list from a sorted singly linked list is a randomized algorithm.
But I am confused: is it a Las Vegas algorithm or a Monte Carlo algorithm?
I feel it is a Monte Carlo algorithm since there is a possibl... |
I am still a bit confused by how to convert into CNF even though I have the rules written down.
How do I convert the following sentence into CNF?
$(I \lor M) \Rightarrow H$
I know I need to get rid of the implication symbol and when its in the form $(I \Rightarrow H)$ or $(M \Rightarrow H)$ then I can see how to do it,... |
Given an undirected graph with non-negative edge weights, and two vertices $s,t$ in the graph. I would like to find the minimal cut such that $s$ and $t$ are on different sides of the cut.
For example I have a graph describing the network of roads connecting Berlin and Munich and I want to find the minimal cut such tha... |
If we know the vertex cover number for a simple graph $G$ denoted by $\tau(G)$, is it possible to find the minimum vertex cover set for $G$ in quasi-polynomial time? As I found, we cannot find any quasi-polynomial time solution for NP-hard problems (or at least it is a strong conjecture) such as finding the minimum ve... |
Given a graph $G$ where each node has a value $c$ and weight $w$, I want to select a connected subgraph $V^*$, such that,
Sum of all values in $V^*$ crosses threshold $t$.
Sum of all weights(say $w^*$) in $V^*$ is as low as possible.
A practical example is finding smallest continuous area of a country that hosts at ... |
Let $A$ be a matrix of size $K \times N$, $K \leq N$. Let $n_1...n_K$ denote a $K$-permutation of integers $1...N$ (understood as a unique assignment of a column to every row in the matrix). How to most efficiently calculate the sum, over all $K$-permutations, of products $A[1,n_1] * A[2,n_2] * ... * A[k,n_K]$?
For exa... |
Suppose we have a simple graph $G$. We know that finding the minimum vertex covering set for $G$ is in the NP-hard class. But, what about the complexity class of finding the size of the set, i.e., the vertex cover number denoted by $\tau(G)$. Is there any previous result about this research question?
|
Problem Statement: There are $n$ hours in a day and you have $w$
workers. For each worker $i$ you will be given $x_i$ (work experience),
$s_i$ (shift start time) and $e_i$ (shift end time) on a separate line.
Here $s_i$ and $e_i$ are both inclusive. At any given hour $t$ in a
day, you have to determine who is the mos... |
I am writing an application that will maintain heart rate within a specified range by adjusting the resistance on a turbo trainer.
I could cobble together something that would gradually increase resistance until heart rate reached the right level but I imagine reaching the desired heart rate quickly, not overshooting a... |
If RAM is a short term memory and SSD is a long term memory, why don't microarchitecture of computer nowadays use SSD or another long term memory for saving temporary data like hidden variable for programming?
If it's about speed, then SSD can improve its speed, is it possible that SSD will become faster than RAM at so... |
Exam question:
Draw the Red Black Tree that results from inserting the following
values in the given order:
[10, 20, 30, 4, 5, 50]
Draw the red connections with a dotted line and the black ones with a continuous line.
What I understand about Red Black Trees:
Every node is either red or black.
The root and leaves ar... |
I am trying to get my head around the Pumping Lemma to prove a language is non-regular.
I am reading the Sipser text book and he gives the following example.
Let B be the language $\{0^n 1^n | n \ge 0\}$
Let $s = 0^p 1^p$
I understand that the idea is you can split this string into xyz such that y can be pumped. It is ... |
Is there any difference between saying
$ L_1 = \{(a^n b^n)^m \mid n, m \ge 1\} $
with $ L_2 = \{a^n b^n \mid n \ge 1\}^+ $?
I know that for $v = abab$ we have $v \in L_1$ and $v \in L_2$
my understanding is that there is no difference between them and for $w = abaaabbb$ we have $ w \in L_1$ and $w \in L_2$ . but I have... |
Why is it that when I read about finding the shortest path for a DAG I usually just hear about topological sort? Why not use dynamic programming where the shortest path to a vertex is simply the minimum of all vertices that have a path to it?
|
I have started learning about quantum computing, and I have been told that you can forget about the physics and think of qubits as a natural generalization of the notion of bit. According to this view, one should think about a qubit as a generalization of a bit, where the states $0$ and $1$ are in superposition; there ... |
I am curious on the use of the potential method for amortized analysis for a dynamic array which quadruples in size after it becomes full.
I understand how the potential function is defined and used for such an array which doubles in size, but am having difficulty showing that the insert operation takes constant time i... |
In the alpha-beta pruning version of the minimax algorithm, when one evaluates a state p with $\alpha$ and $\beta$ cutoff and gets a v value, i.e.,
v = alphabeta(p, $\alpha$, $\beta$)
are these properties true?
alphabeta(p, -$\infty$, $\beta$) = v when $\alpha$ < v
alphabeta(p, $\alpha$, $\infty$) = v when v < $\beta$... |
I'm trying to understand why:
$$L_{\Sigma^*}=\{\langle M\rangle|L(M)=\Sigma^*\}\notin coRE$$
As I see it TM, $\langle M\rangle$, should accept all the inputs, and if one of the inputs rejected it's not $L(M)=\Sigma^*$ any more, so why it's not? $$L_{\Sigma^*}\in coRE$$
$*$ I familiar with the reductions $HP\le L_{\Sigm... |
I want to prove that $L = \{a, b\}^* - \{(a^n b^n)^m \mid n, m \ge 1\}$ is a Context Free Language.
so far, I tried to find a Context Free Grammar for $L$ or to use properties of Context Free Languages but have not been successful yet.
Any guidance and explanation would be greatly appreciated.
|
I have some users in groups, like this (groups are letters, users are numbers):
{
a: [1, 2, 3],
b: [4],
c: [5],
d: [6],
e: [7, 8, 9, 10]
}
I receive a new description of the grouping of these users like this:
[1, 2, 3, 4, 5, 6, 11],
[7, 8, 9, 10]
Now, I need to rearrange the users to minimize "changes", so ... |
I am currently studying Chapter 8 of Krama and Hammer's textbook on Boolean Functions, and having a hard time understanding what it means for a function to be "k-monotone."
I am currently working off the following definition of "K-monotone" in Chapter 8:
A Boolean function $f$ on $\mathcal{B}^n$ is $k$-monotone ($1 ≤ ... |
So if we assume that we have some strongly connected component G with n vertices. I would like to find the length of the longest path in that component.
My idea is: In a strongly connected component we can get from one vertex to every other vertex.
If we start at some vertex u then we can visit each of the remaining n-... |
I am studying the maximum matching problem and I was trying to understand why the classical augmenting path algorithm does not work for the general graph (i.e. for non bipartite graph) and you must recur to the blossom algorithm.
The explanations that I found (1. here, 2. and here) are based on the fact that the direct... |
In QuickSort Algorithm, the pivot is chosen as the first element or a randomised element. However, if the range of data to be sorted is known, For example, from 1 to 100, and they are mostly equally distributed, then, the best choice for first pivot would be 50, even if it's not present in the array, then, for left su... |
Often in CLRS, when proving recurrences via substitution, $\Theta(f(n))$ is replaced with $cf(n)$.
For example, on page 91, the recurrence
$$ T(n) = 3T(⌊n/4⌋) + \Theta(n^2) $$
is written like so in the proof
$$ T(n) \le 3T(⌊n/4⌋) + cn^2. $$
But can't $\Theta(n^2)$ stand for, let's say, $cn^2 + n$? Would that not make s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.