instruction stringlengths 35 29.1k |
|---|
Suppose we have $n$ candidates from a candidate pool $\{1,2, .., n\}$ and we have $m$ departments. A candidate can be assigned to at most one department (so not being assigned is possible). Each department $d$ is considering candidates in $C_d \subseteq \{1, 2, ... n\}$ (with possible overlap between departments), and ... |
Suppose we are at the centre of a $k$ road intersection (i.e, there are $k$ different roads radiating out from where we are standing, infinitely). Suppose along one of these roads is a treasure.
This treasure is along one of these roads at distance $d \in \mathbb{Z}$ from the center. We do not know which road and we do... |
Consider a function $C(n, d)$ which counts the number of well formed, i.e, balanced, parenthetical 'words' of length $n$ and maximal nested depth $\leq d$.
That is, $(())$ has $n = 4, d = 2$. $()((())())$ has $n = 10, d = 3$ and so on.
$C(n, d)$ counts all well formed strings above (i.e, $($ and $)$ are balanced), of l... |
Consider the following problem from Jeff Erickson: Algorithms
that also appears in this post, which wants us to prove a lower bound for the problem.
Suppose you are given an array $A[1 .. n]$ of integers, each of which may be positive, negative, or zero. A contiguous subarray $A[i .. j]$ is called a positive interval... |
I read from this post the term configuration space. I don't know the meaning of configuration space.
What is the exactly meaning of configuration space?
And why DFA's configuration space is finite and PDA's configuration space is infinite? Give one example for both the cases then it could be better for me.
|
Consider exercise 23(c) of chapter "Greedy Algorithms", Algorithms by Jeff Erickson.
Given a tree $T=(V,E)$ in which each node has a reward, and
$k\in\mathbb{N}$, our goal is to find a set $S$ of paths, each having length exactly $k$, such that the paths in $S$ are pairwise vertex-disjoint and and the overall reward (... |
I am trying to find a better way to find all leaf nodes in my undirected waypoint graph.
This is how I define a leaf node:
A leaf node is a node that is never part of a cycle and so has to meet one of these two criteria:
It has only one connection
Or
The node's total connections minus the total leaves connected to s... |
To get the dual of a planar graph, each of the faces becomes a vertex. And then, two vertices in the dual graph are connected if they share a common face. My question is about planar graphs that have disconnected components. It's unclear to me how to define a face for these. As a simple example, consider the graph belo... |
I am reading chapter 1 of Michael Sipser's "Theory of Computation" and in the section "Formation defination of NFA" he says the following:
3rd point of the above image is the point of interest in the post
According to a few stackoverflow post:
1)https://math.stackexchange.com/questions/1689850/is-the-empty-string-alwa... |
I am studying "Theory of Computation" by Michael Sipser. I am studying the section where he teaches how to convert "RE to FA". He uses empty transitions for union, concat and star, but that is very getting very confusing for me
But i found this another method here: https://www.codingninjas.com/codestudio/library/conve... |
I have to write the language of the below $NPDA$(Non-Deterministic Push Down Automata).
I think that from $q_0$ to $q_1$ and then $q_2$, we are actually building the below all the strings of $0$'s and $1$'s of the form $a^nb^n$ with the lenght at least 2.
But there is also a transition from $q_2$ to $q_0$, which makes... |
I have read that when programming it is good to identify relations -- invariants -- that should hold true throughout the program, and it is good to insert assertions throughout the code to check that the invariants are maintained.
I can see how programs that involve mathematics can have invariants, i.e., some mathemati... |
I’m looking for a distribution that is non-negative, or has good tail bounds (so non-negative with high probability) and maximizes the ratio between the expected maximum of $n$ iid samples and the mean.
That is, if $X_1,\ldots,X_n$ are iid samples from the distribution, $Y = \max(X_1,\ldots,X_n)$, and $X$ is another sa... |
I have to design an NPDA(Non-Deterministic Push Down Automata) for all the strings over
$\{a, b \}^*$, which have equal numbers of $a$'s and $b$'s but do not end up with an $a$.
I know how we should create an NPDA for the strings with an equal number of $a$'s and $b$'s, which its machine would be like this:
But I don... |
In linux, when I access /proc for a particular program it shows memory mapping for the program in maps file.
Something like this:
I wanted to know what is this [stack] memory mapped to i.e the kernel stack or the user stack and how can I access the contents inside that memory area?
There is another file within the /pr... |
Given the problem of having a sorted array $A$, an element $x$ to be searched for in the array $ A $, what is a lower-bound on the process of finding $x$ in $A$?
The answer is $ \Omega(\log n) $ because I was told that $ n $ is the number of leaves in the decision tree and so $ \log n $ will be the height of the tree.
... |
That's a question from a home assignment by T. Zur:
Say that a Turing machine $M$ is monotone if it halts on every input,
and if the length of $w$ is greater than the length of $w'$ then $M$
performs more steps on $w$ than on $w'$.
Prove that MON is undecidable.
My idea is to define a reduction from HALT to MON. We d... |
Can anyone please help me with a better solution than O(n^3) for this problem?
So the problem is given a string, we want to output the substring's length where freqency[c1] - frequency[c2] is MAX.
c1 = Most frequent character
c2 = Least frequent character
e.g
'aaabbbbbabcbbbaaaa' => 8 ( corresponding to the substring '... |
Let's say that we want to convert the regular expression: (ab + a)* to Finite Automata, where '+' is union and '*' is kleene star. Using the Thompson method, Thompson Method
I end up with this:
My question is, is there a way to cross verify that my E-NFA accepts the language of Regular expression mentioned at the start... |
I was wondering if someone could help resolve some issues I have understanding the proof given for the Cook-Levin theorem provided in the Sipser text (3rd edition) – as this proof has truly stumped me.
Having read through this proof numerous times, the only issue I have is that I simply do not understand how it actuall... |
How do I being to show that if $L_{1}$ is Turing-recognizable language over $\Sigma=\{0,1\}$, then $L_{2} = \{ww^R | w ∈ L_{1} \}$ is a Turing recognizable language too.
There is another similar problem, but instead of the language being recognizable, it's decidable. If anyone has any ideas on how to approach both of t... |
Can anyone please help me solve this better than $O(|a-b| \cdot n)$?
Given an array of both negative and positive numbers, we want to find the maximum sum of the elements in contiguous subarray having a length between $a$ and $b$.
Example
Input:
8 1 2
-1 13 -2 5 13 -5 2 2
Output:
18
Here a = 1 , b = 2
Although Maximum ... |
I know that retrieving an item in a collection can be done in $O(1)$ time(on average) using hash tables. I would like to know if there is an algorithm that could be as performance without using arrays.
My main motivation for this question is to know if it is possible to build a retrieve element algorithm in $O(1)$ time... |
I have a large system of $3$-$XORSAT$ constraints (i.e. up to $3$ variables per constraint) and this can be represented in matrix form as a linear algebra problem $Ax=b$ $mod$ $2$. Solvability (i.e. the satisfiability of the $3$-$XORSAT$ system) can be tested by using Gaussian elimination which involves multiple rounds... |
Show a reduction of max flow to min cost (not min cost max flow!!)
|
I am studying the Master Theorem, but there is a case in which I have no knowledge on how one should proceed. If it's given:
$T_1(n)= 1$ if n=1
$T_1(n)= 4T_1(\frac n2) + \sqrt{3n}+1$ otherwise.
For this case $T_1(n) \in \Theta(n^2)$
We then have:
$T_2(n)= 1$ if n=1
$T_2(n)= 14T_2(\frac n4)+ T_1(n)=14T_2(\frac n4)+4T_1(... |
Orthogonal arrays often appear in probabilistic algorithms. They can be efficiently constructed from, e.g., BCH codes.
But is there an efficient algorithm that can verify if an array is orthogonal? I would be particularly curious about the strength-4 binary arrays.
In my last edit I added that the array is binary. It s... |
I am trying to understand how the input size, problem size and the asymptotic behavior of an arbitrary algorithm given in pseudo code format differ from each other. While I fully understand the input and the asymptotic behavior, I have problems understanding the problem size. To me it looks as if problem size = space c... |
Consider a logical address space of 4096, page size = 1024
physical memory = 8192
$\begin{array} {|c|c|}
\hline
\text{Page No} & \text{Frame No} \\
\hline
0 &7 \\
\hline
1 &4 \\
\hline
2 &2 \\
\hline
3 &3 \\
\hline
\end{array}$
What is the physical address corresponding to logical address 500, 1000, 2000, 3000, and 400... |
There are people and the food they prefer:
John -20> Apple
John -10> Pear
Ethan -20> Apple
Ethan -5> Orange
Michael -10> Pear
Michael -10> Limon
The numbers indicate how strongly they prefer the respective food.
i.e. John likes Apple more than Pear (20 > 10). And so for everyone.
The task is to distribute food to absol... |
Let $G = (\{A,S\}, \{a,b\}, S, P\}$ be the grammar with the following productions:
\begin{align}
& S \to aAb | Sb \\
& A \to aAb | ab
\end{align}
What is the language $L(G)$ generated by the grammar?
Prove your answer to 1. by induction.
Here is my attempt.
I think that the language generated by $G$ is
$$L= \{a^nb^... |
I was wondering whether someone could help me resolve an issue I have understanding the proof given for Savitch’s theorem in the Sipser text (3rd edition). The question I have is more or less identical to the first question given in a previous post (The crux of Savitch's Theorem); which has remained unanswered – hence ... |
Let $L=\{ a^c \mid c \text{ is composite} \}$. Prove that $L$ is not regular using the pumping lemma. You can use Dirichlet's theorem, which states that if $(a,b) = 1$ then there are infinitely many prime numbers of the form $an+b$.
I am thinking about this question for a lot of days and I don't find it trivial, do y... |
I have recently come across a result that showed that a given problem is in FPT when parameterized by the treewidth of a graph. However, they did this by showing that the problem is in FPT when parameterized by the treewidth of an augmented version of the graph that had treewidth of at most 2k+1 when the treewidth of t... |
I encountered an exercise in which I am struggling to understand the solution provided even though I spent a lot of time trying to figure it out.
The exercise is the following and was taken from the book "The art of computer programming - Volume 1 by Donald Knuth"
Imagine four railroad cars positioned on the input si... |
I know that :
$T(n,k)=T(n−1,k−1)+T(n−1,k)$ is the Pascal triangle.
But what is this then:
$T(n,k)=T(n−1,k−1)+T(n,k-1)$
Is there any name for it? I am trying to learn about it's time complexity etc, but I can't find anything online.
|
Let $G=(V,E)$ be a complete finite graph with the vertices arranged in a circle. Each edge has a nonnegative weight, and we would like to find an efficient algorithm to find a subgraph of maximum total weight, which is a triangulation of the graph. A triangulation of the graph is a subgraph such that no edges cross a... |
In an introductory course on Dijkstra's algorithm, I enunciated the following lemma :
Let x →* z be a shortest path in a weighted graph and let y be any vertex along that path. It follows that x →* y and y →* z are shortest paths too.
To which one of my students pointed out that it does not seem to hold in the undire... |
It is pretty simple to implement a DFS algorithm for a binary tree but what about BFS for binary trees? I tried to adapt the BFS algorithm for ordered tree, this is the result:
I presume that better solutions are possible. Could someone suggest a better solutions?
|
I know that swapping is avoided in mobile systems because of limited memory but I came across this question and couldn't answer if the answer is yes.
Should swapping be done in Mobile systems? If yes, what should be the appropriate swap size in case the secondary storage is 16 times that of RAM. Which swapping location... |
Given three arrays A, B, and C of size n, m, and m respectively (1-based indexed). A function F(i) is defined as -
F(i) = minimum_of(⌈ Ai / B1 ⌉ * C1 , ⌈ Ai / B2 ⌉ * C2 , ⌈ Ai / B3 ⌉ * C3 , .... , ⌈ Ai / Bm ⌉ * Cm)
where ⌈x⌉ is defined as the ceiling function. For example : ⌈2.3⌉ = 3, ⌈3.9⌉ = 4 and ⌈3⌉ = 3.
Find the va... |
I am studying Communicating Sequential Processes (CSP), and I understand that an event can be "emmited" ($\overline{e}$) and an event can be "waited on" ($e$), so that an event will sync with another parallel event ($\overline{e} || a \rightarrow e$).
Now how do I represent the fact that an event must not occur at the ... |
Given an undirected and unweighted graph $G = (V, E)$ and two of its vertices $s$ and $t$. My task is to find an algorithm that checks if there exists an edge belonging to $E$ such that its removal will result in the shortest path from $s$ to $t$ being extended (and if so returns this edge). We may remove only one edge... |
I am studying B-trees and reading Introduction to Algorithms by Cormen et al.
Unfortunately, they have this diagram Figure 18.1 and they do not list the order of the tree.
I understand that for a B-tree of order $m$, the tree has 5 properties:
Every node has at most $m$ children.
Every internal node except the root h... |
I misunderstanding about some logarithm property in algorithm course:
is it correct that we say following three term is equivalent?
$O(\log a + \log b)$
$O(\log (ab))$
$O(\log (a+b))$
|
I need to prove:
reverse(push(as,bs)) = push(reverse(bs), reverse(as))
where:
def push[T](as: List[T], bs: List[T]):
List [T] = as match {
case Nil => bs
case x::xs => x::push(xs, bs)
}
def reverse[T](ls: List[T]):
List[T] = ls match {
case Nil => Nil
case x::xs => push(reverse(xs), x::N... |
I am confused with the terms inhabitant vs. subtyping.
For example,
We usually think that "john is an inhabitant of Human". This sentence is correct, because john is an individual, and an individual belongs to the set Human (that reflects the meaning of inhabitant). However, if we think of john as a subset with only o... |
I have the following problem:
There are $n$ variables $x_i$, $i=1...n$, each can take integer values from 1 to $m$. For every set of values I can run a test which has a binary outcome ('Pass' or 'Fail'), and it is known that the test outcome only depends on a value of a single variable being larger than some threshold.... |
Can somebody explain to me the meaning of $::$ in the following predicate?
$$(\forall i : P(i) : Q(i)) \equiv (\forall i :: P(i) \implies Q(i))$$
|
Suppose you have an $n\times n$ matrix and you want to find a local minimum. To find it you scan the middle row and column and identify a minimum. If it is a local minimum, you're done; if not, you recursively search the sub-quadrant where the smaller value was found.
Now I can analyze the runtime in two different wa... |
(a || b) || (c && d))
Given the above, how do I derive the table below:
a
b
c
d
output
T
-
-
-
TRUE
F
T
-
-
TRUE
F
F
T
T
TRUE
F
F
T
F
FALSE
F
F
F
-
FALSE
I'm told that this is short circuit evaluation, basically, we take away some branches/paths that always lead to false or true so we don't waste ti... |
There is this certain slide in Coursera Computer Science: Algorithms, Theory, and Machines course:
I think it is saying finding the optimal size of given data is undecidable. However, I thought there is a theorem in information theory that gives the limit of the lossless compression? I think I must have misinterpreted... |
Can’t a PDA get stuck in a cycle of blank transitions?
Should the implementation detect such cycles and do something about them? That seems quite complex to consider all the edge cases.
Does the answer vary for nondeterministic PDAs?
|
Some time ago I had in one of the big tech interviews the following question that I still don't know how to approach it.
You have a chains of reservations from AirBnb:
reservations:[
{user = 1, res_id = 1001, checkin = 100, checkout = 101},
{user = 2, res_id = 1002, checkin = 104, checkout = 105},
{user = 1... |
What are some examples of non-enumerable languages whose complement isn't either? I.e., a language L such that L is not Turning-recognizable and L’ is not Turing-recognizable either.
Update: Found some examples:
Is the below language Non R.E?
|
I was watching video Lec 2 | MIT 6.046J / 18.410J Introduction to Algorithms (SMA 5503), Fall 2005, where professor Erik Demaine said that $a^{\log_b n}$ is the same as $n^{\log_b a}$. Can someone please explain me why bringing "the $n$ downstairs" and "the $a$ upstairs" is possible?
|
I need to write a function that gets an array of numbers $a$ as an input and returns an index $i$ such that $a[i]<a[i+1]$ if it exists, if such $i$ doesn't exist return $-1$. (return any index $i$ if there are multiple).
We know that: in $a$ there are at least $2$ elements, $a$ may or may not be sorted and the first e... |
In Arora and Barak's textbook, in chapter 18, p.366-367, they prove the following theorem:
Theorem 18.7 if $(L,D)$ is reduced to $(L',D')$ and $(L',D') \in disP$, then $(L,D) \in disP$
The proof goes by just following the definition of average-case reduction and disP. I.e., suppose there is an efficient algorithm $A'... |
in my Complexity class I have to present the 1/2 MaxSat approximation algorithm that appears in the Vazirani, Vijay V - Approximation algorithms-Spring (2011) [Image attached].
The problem is that it is not clear to me where and how the weights are assigned. The example talks about considering the weights as a unit but... |
I saw this question on the internet and found many solutions actually but none of them really persuade me that much.
Question: Given language $L$ which is accepted by a Turing machine $M$, provide a 2-PDA that describes $L$. End of the question.
Note: A Turing machine is given by $M=\{Q,\Sigma,\Gamma,\delta,q_0,q_{acc... |
An alternative way of deciding within a nondeterministic complexity class is to present a verifier-prover pair. To recall, let $\mathsf{L}$ be a language, and let $\mathsf{w}$ be a word. To decide whether $\mathsf{w} \in \mathsf{L}$:
The prover, a magical machine, will immediately find a proof that $\mathsf{w} \in \ma... |
Are Unit Tests Required if you have a good End to End Test? If you find problems, couldn't you always just update the end to end test to make it more robust?
|
I'm looking at a problem similar to an assignment problem.
There are both agents and tasks. Each agent has a list of tasks they are able to do, and cannot do any task not within that list (note that agents do not have a preference for what task they do, only a list of tasks they are able to do). A task can be assigned ... |
If $A$ and $B$ are languages, let $A\bowtie B$ denote the set of strings made by concatenating any word from $A$ and any word from $B$ of equal length.
$$A\bowtie B \equiv \{ ab : a\in A,\;b\in B, |a|=|b|\}.$$
You can prove using regular grammars that if $A$ and $B$ are regular, then $A\bowtie B$ is context free. I am ... |
I was watching video 7. Binary Trees, Part 2: AVL, where professor Erik Demaine stated that $$2N_{h-2} = 2^{h/2\text{ (or maybe with floor or something... maybe it's ceiling)}}$$ where $N$ stands for the number of nodes in a subtree of height $h-2$. Can someone explain me in more detail why this recursion can be solved... |
Is there a communication protocol that ensures that both parties can read the other one's message at the same time (or at the very least, only after sending their own message, thus no party can read a message and then send their own).
|
In the operating systems that make use of the execution-time address binding who is responsible for the creation of logical addresses?
EDIT
I'm thinking that the logical addresses are generated by the compiler and are included in the relocatable code
|
With C# I can convert an array of bytes to a decimal value:
//F4 6C 56 7D AE C6 4B 40
var bytes = new byte[] { 244, 108, 86, 125, 174, 198, 75, 64 };
var value = BitConverter.ToDouble(bytes, 0); //=55.5522
I would like to know how this works and be able to express it by hand on paper.
|
Exchange sort is similar to selection sort, just swaps "overly eagerly" instead of finding the minimum and doing only one swap. And the swaps affect how often the if ... is true. For example for 8000 random numbers, in exchange sort it's true ~270 times more often:
trues in trues in
n exchangeSort sel... |
I recently submitted a paper where in part of the paper I derived a bound on a function (note it is an upper bound). The benefit of the bound is that it is much less complex to compute in contrast to the actual value of the function. So, the bound can be used as a cost for optimization instead of the actual value of th... |
Say that a Context Free Grammar is red when it accepts every word of length 3 that begins with a, and extremely red when it accepts every word that begins with a.
Is redness decidable? or Semi decidable? will the algorithm go into an infinite loop when presented with certain invalid statements?
Also what about extreme ... |
The question will be hard to understand without an example, so let's given an example first:
Let's say I have a 2 dimensional concave polytope, defined by a circular sequence of its vertices:
$(0,0),
(1, 4),
(2, 0)
(1, 1),
(0, 0)$
Let's say I wanted to find the polytope I get if I considered only points s.t. $y>=0.5$,... |
Pumping Lemma : For any regular language $\mathbb{L}$, there exists an integer $n$, such that for all $x\in \mathbb{L}$ with $|x|\geq n$, there exists $u, v, w \in \Sigma^*$, such that $x = uvw$, and
$|uv| \leq n$
$|v| > 0$
$uv^iw ∈ \mathbb{L} \space\forall i\geq0$
My question is, what exactly is the "Pumping Length"... |
An accountant in a big firm would like to find the median of the
salaries of all employees. The data they received is a list of size n
containing the tuples $\left\{s_{i\ },f_{i\ }\right\}_{i=1}^{n}$,
where the number $s_i$ is the salary and the integer $f_i$ is the
number of employees that got salary $s_i$ in the fir... |
So I am studying PTAS algorithms. For a maximazation problem the difinition says that an algorithm that has value A , is a ptas if :
$A \geq opt(1-\epsilon) \; ,\forall \epsilon > 0$
(and I guess also $\epsilon < 1$ (?) )
Obviously for any constant $c>0 : opt(1-\epsilon) \geq \frac{opt}{c}(1-\epsilon)$
So when I prove... |
I was looking at an example of grammar from the website: grammer example
which is as follows:
S → aB / bA
S → aS / bAA / a
B → bS / aBB / b
I believe they forgot to write: A -> a
Next, we are going to derive the string: aaabbabbba
I did it by myself and found the following:
Left derivation:
S -> aB
-> aaBB
-> aaaBBB
->... |
I have a set of line segments (say 1000 of them) and a query point. I want to find the segment which is the closest in the Euclidean sense (if the point does not project on the segment I accept two options: 1) just ignore the segment - infinite distance - or 2) consider the distance to the closest endpoint). Preprocess... |
This is a problem that I have found from Introduction to automata theory, languages and computation by John Hopcroft and Jeffrey Ullman.
PDA P=({q0, q1, q2, q3, f)}, {a, b}, {Z0, A, B}, δ, q0, Z, {f}) has the
following rules defining δ:
δ(q0,a,Z)=(q1,AAZ)
δ(q0,b,Z)=(q2,BZ)
δ(q0,∈,Z)=(f,∈)
δ(q1,a,A)=... |
I'm trying to solve following modified knapsack problem using dynamic programming.
What we know:
Total number of items
Item weight, value and type
Knapsack capacity
Aims
Find Maximum weight of knapsack
List taken Items
Constraints
Only one item of each type can be taken
For example, in my problem, the item list w... |
Hello I am struggling with proving a lemma, it goes as follows:
Suppose we have a vector r = (r1....rn)^T where rj is either 0 or 1 which is selected uniformly at random with probability 1/2. Suppose now we have a n x n matrix called M (which has at least one non zero element).
I need to prove that the Pr[Mr = 0] <= 1/... |
Suppose a real-valued function class $\mathcal{F}$ with pseudo dimension less than $d$, I am wondering what is the pseudo dimension of the following function class
\begin{equation}
\mathcal{F}_2 = \{\min(f_1, f_2), \text{with } f_1,f_2\in \mathcal{F}\}
\end{equation}
where for any $x$, $\min(f_1, f_2)(x) = \min(f_1(x),... |
I understand why L2 is not a regular language. We can use the pumping lemma to prove it
In the case of L2:
assume n = 1 and string = ab
We assume that L2 is regular, so it has "pumping length" property and it can be divided into 3 strings, x = empty string, y = a, z = b
Now we pump y, so after pumping once we get the s... |
I try to determine if the following statement is true:
for any given language $L \subseteq A^*$ if $L$ is a context-free language then $L_1 = \{u^Rv^R \ | \ uv \in L, |u|=|v| \}$ is also a context-free language.
Initially I tried to come up with a counterexample but now I start to believe this statement could be true. ... |
For open addressing, I know that once you have around 70% table being filled you should resize because more than that you get collision.
But for closed addressing, I read that load factor should not exceed 1 (m/n where m = number of items in the buckets and n = size of the table)
otherwise trigger rehashing to grow the... |
What is the most efficient data structure for a dynamic set of words over a finite alphabet $\Sigma$ which supports the following operations?
Add a word.
Remove a word.
Determine a shortest word which is not in the set.
Does it help if all words have the same length?
A real world example: I was thinking about link sh... |
Case:1
Suppose l have one DFA which accepts the set of all strings over {a, b} which starts with aand it's complement is not starts with a.
From the above image we see that in the second diagram represents the DFA which accepts the strings which belong to complement of the language accepted by first DFA.
Case:2
Now co... |
Im trying to build my own learning track
Currently I am working on becoming a unity developer to make game or whatever is needed. I use C# within the system.
I don't feel satisfied just working within the engine and want to make my skills more broad and flexible to be able to solve a wide number of problems.
if someon... |
I am having a hard time to prove it, what i know is we cannot prove that a language is regular by using pumping lemma cause even if the "pumped string" is in the language the language could still be regular.
But since we already know that ww^r is a context free language cause we can design a pda for it, we should be ab... |
the expression "graphs" in the title refers to graphs as they are thought in computer science:
Let G = (V(G), E(G)) be a graph. It is a tuple with a set of vertices and edges.
|
Assume a bloom filter that is composed of $H = \{H_1, ..., H_k\}$ hash functions, and uniformly maps elements from an input set $X$ to an array $A$ of size $n$. Let $X_1, X_2$ (not same) be two input sets of size $m$. After applying the same bloom filter to both input sets, we receive the arrays $A_1$ and $A_2$ (both o... |
Let's say there is an unfair coin with $P[head]=p$. We do not now $p$ but we know that $p \geq a$ for a known $a$. After $n$ trials we get $bn$ heads. Now, we want to estimate $p$ so that
$P[|p-b|\geq gp] \leq \epsilon$, where $g, \epsilon$ are known
Here is what I have got so far:
We know that $\mu = np$
not sure i... |
I have the following problem:
Let Alice and Bob be two people playing games.
Alice and only Alice owns a special device, Robo, that is capable of generating one truly random number $k \in \mathbb{N}$ per game, within any range given by Alice at some moment of the game.
The game Alice and Bob decided to play today ta... |
I would like to show a language is in not recursive (not in the family $R$) without using a reduction from a language that is known to be non-recursive. In other words, its as if I am discovering the first non-recursive language.
I have 2 languages I would like to show it for. These are:
$L_{AC}$ - the pairs $\left<M,... |
In 1949 Shannon proved, using a non-constructive counting argument, that some boolean functions have exponential circuit complexity, see [1] and many texts on computational complexity. This result has been strengthened later, showing that, in the limit, almost all boolean functions have exponential circuit complexity. ... |
I know that for $n \times n$ matrix, it takes $O(n^2)$ time complexity to compute the largest eigenpair of the matrix using Power method or etc. I'm interested to further extend the case so that now we're interested in finding $d$ largest eigenpairs, but for a "symmetric" matrix. What is the time complexity of this alg... |
I'm trying to gain a better understanding of Big O.
Here is something that I'm unsure about. Say we have an array containing N elements that is inputted by the user. From my understanding iterating over each element from this array gives O(n) as we are looping over the array N times.
Now we do the same thing, we iterat... |
We know that $L
= \{ xy | x, y \in (0 + 1)^*, |x| = |y|,
x≠y\}$
is context free. But my question is how we check $x ≠ y$ in $PDA?$ For example $x=0^n1^n$ and $y=1^{2n}.$ We can easily draw $PDA$ by checking one $0$ against three $1s$ but how can we check $x ≠ y?$
|
In shannon capacity, it uses log operation.
bandwidth * log2(1 + SNR)
Why they use log operation instead of just using SNR?
|
I have to find equivalence classes for different languages based on Myhill-Nerode. I'm struggling a little bit finding these equivalence classes; for example, the language $L=\{b^*a^n\mid n≡0\pmod5\}$ with alphabet $\{a,b\}$.
My first solution would be: $[\epsilon],[b^∗],[b^∗a],[b^∗aa],[b^∗aaa],[b^∗aaaa]$.
Would these ... |
I am a student want to study randomized algorithm. Someone recommend cs271 to me, but it's restricted now.
Can someone recomend a good resource to study randomized algorithm, thank you a lot.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.