instruction stringlengths 35 29.1k |
|---|
Let $f$ be an $o(2^{-\sqrt n})$ function, and let $g$ be an $o(2^{-\frac{n}{2}})$ function. Is the function $ f + g - fg$ is an $o(2^{-\sqrt n})$ function?
Can you help me prove that?
I think the answer is correct, but when for example, I consider the expression $\frac{2^{-\sqrt n} + 2^{-\frac{n}{2}} - 2^{-\sqrt n - \f... |
I have been looking at the Suurballe node-disjoint algorithm, which is illustrated here:
http://www.macfreek.nl/memory/Disjoint_Path_Finding
What I am a bit unsure about here is "Step 4". So before that each node in the first shortest path is duplicated/divided into an in and out version of itself. And after that a new... |
I think since the input word is delimited by special symbols, which the machine cannot move past, the language accepted by such a device should be finite. Are all finite languages are regular, and are regular languages decidable by a TM?
|
I've built a topic model, with:
Input: list of tokenized lists
Output: a m x t matrix (with each cell indicating the probability of word i appearing in topic k).
Output: a k x n matrix (with each cell indicating the probability of topic k in document j).
To find the optimal number of topics, I want to calculate the c... |
I've come across this question and I think I'm on the right track with the idea I just don't really know how to formalize it properly or understand why everything said in the question is required for the proof. The question is as follows:
Let $\mathcal X$ be a finite example domain and let $\mathcal Y = \{0, 1\}$. Let... |
Given a $m\times n$ matrix and a starting position $(i,j)$, how can we find the shortest path to go through all the elements at least once if we can only move by a single unit (i.e. up, right, left or down) at a time?
Currently all I could think of was moving to the nearest corner and then traversing from there, but th... |
I got these for four of them, but I can't get the transition function.
Q = {q1, q2, q3, q4}
Σ = {a,b}
q1 is the start state, and
F = {q4}
|
How can I solve this recursive function using substitution method?
$$T(n) = 2T(n/3) + T (2n/3) + n^3$$
I substitute $T(n/3)$ and after that $T(n/9)$. when it goes to k-step, I'm stuck.
|
So, i faced this question during a pratice quiz
i have no idea why " all of the elements are located contiguously in memory " wrong!!
My logic is that priority queues are made of binary heaps and binary heaps are made of arrays ( according to introduction to algorithms by CLRS ) , so this means that elements are locat... |
Is it possible to have a finite automaton where $\Sigma = \mathbb{N}$? Why or why not?
I think it is possible to have a set of all natural numbers, however I'm not sure why.
|
I have the following problem:
In a school, there are n students and m clubs, with n > m. Each student needs to be assigned a club. The students have preferences, (say top 3 or top 5) of the clubs they wish to be matched to. So far, it's basically just a maximum weight matching in a weighted bipartite graph, which can b... |
What is the space complexity of quicksort?
I was doing some research and found some saying it is $O(1)$, some saying it's $O(\log n)$, and some saying $O(n)$. Not sure what to believe, even though $O(\log n)$ seems to make the most sense for me. Does it all depend on the pivot point that is chosen?
|
I have been working to understand the pumping lemma better, but I am quite stuck at proving these two languages is not regular:
\begin{align}
L_1 &= \{(ab)^n c^m \mid n\ge 1, m\ge 2n \} \\
L_2 &= \{(ab)^n a^k (ba)^n \mid k<3\}
\end{align}
For $L_2$ my approach was:
Let us be given a number $p$. Let $z = (ab)^p a^k (... |
So I am a computer science student and I was recently looking at the subject of comparing DNA sequences.
Probably the most widely used algorithm is the Needleman-Wunsch algoirithm and while it might be suitable for most cases, It bothers me that an $O(n^2)$ algorithm is used to compare large batches of text, both from ... |
An ancestry matrix $M$ for rooted tree $T$ is defined as $M[ij] = 1$ iff node $i$ is an ancestor of node $j$. Suppose we are given a matrix $X$. We can easily check that if $X$ is compatible with some rooted tree (and create the tree) or not.
The question is if $X$ is not an ancestry matrix, how hard is the problem of ... |
If a programming language only supports global variables, is it still possible to use asynchronicity, like callbacks, event-driven programming, other kinds of parallelisation?
How can it be done?
|
Given matrix $A \in \{0,1\}^{n \times m}$ with $n$ rows and $m = 2^n - 1$ columns. Where $j$-th column is binary decomposition of $j$ ($j = 1 \dots 2^n - 1$). For example, if $n = 3$:
$ A = \begin{pmatrix}
0 & 0 & 0 & 1 & 1 & 1 & 1 \\
0 & 1 & 1 &0 & 0& 1 & 1 \\
1 & 0 & 1 & 0 & 1 & 0 & 1
\end{pmatrix}$
This matrix calc... |
This is something like assignment problem, we have 2 group of people, first contains $n$ person and second contains $m$ person. we have a matrix $C$ which is an $n \times m$ matrix and our goal is to find an assignment matrix $A$ which is again an $n \times m$ binary matrix (contains ones and zeros) and if $A_{ij}$ is ... |
I am learning automata theory, and I am confused about this exercise:
Give context free grammar to create the following language where the
input alphabet is $\{a,b\}$
$L = \{w \text{ where }w\text{ is NOT of the form }b^n a^n\}$
So, I understand how to create $\{b^n a^n, n\in\mathbb{N}\}$:
$$S \to bSa \mid \epsilon... |
A Markov chain with transition matrix $P$ is termed regular if for some $n$, all entries of $P^n$ are positive.
Is there a known notion of degree of regularity quantified in terms of how soon all entries are positive? That is, a Markov chain with transition matrix $P$ would be considered more regular than a Markov chai... |
Given a regular language $L$ defined over $\Sigma = \{0, 1\}$. We define a new language $$Perm(L) = \{w \mid \exists x \in L, w \in perm(x)\}, $$ where $perm(x)$ is the set of all permutations of the word $x$.
We have to show that $Perm(L)$ is context-free.
I have looked at the properties that neither CFL nor Regular l... |
1 2 3 4 5
|---|---|---|-----|---|---|
| | > | v | | | 5 |
| > | ^ | > | [>] | z | 4 |
| ^ | | | ^ | | 3 |
| ^ | > | > | ^ | | 2 |
| a | ^ | | | | 1 |
|---|---|---|-----|---|---|
Let say we have a GRID like the one above.
I want to create score for paths, where every next step has ... |
I noticed that some "design-the-grammar" problems say verbally
Alphabet is $\mathbf{\{0,1\}}$.
$\{w \mid w \text{ contains at least three 1s}\}$
and some problems list it as
$\{ w ∈ \mathbf{\{0,1\}}^* \mid w \text{ contains at least three 1s} \}$
So, my question is: Is the in-line notation with the asterisk star '*... |
I am studying Automata theory. DFAs and NFAs seem pretty straightforward to me, but I don't quite understand how to design push-down automata for context-free languages.
If I have context-free language where the
input alphabet is $\{a,b\}$
$L = \{w \text{ where }w\text{ is NOT of the form }b^n a^n\}$
How would I desig... |
Suppose there is a path (linear) graph $G = (V, E)$ where $V = \{0, \ldots, n - 1\}$ and $E=\{(0, 1), (1, 2), \ldots, (n - 2, n - 1)\}$, with edge weights $w_e : E \to \mathbb{N}$ and vertex weights $w_v : V \to \mathbb{N}$. Let $\lambda$ be a known constant.
We need to find an exact cover $C \subseteq \mathbb{P}(V)$ ... |
There are four variables: $x_1, x_2, x_3, x_4$.
If you choose either $x_3$ or $x_4$ or both — then you should choose exactly one of $x_1$ or $x_2$.
If you choose neither $x_3$ or $x_4$ — then there is no restriction in choosing $x_1$ or $x_2$.
I have come up with the following if else logic for this, but cannot proceed... |
We wish to find the maximum independent set in a bipartite graph. My intuition led me to the following algorithm. (Assume that the bipartite graph is connected and has at least 3 vertices, if not run the algorithm on each component)
Given $G=(L,R,E)$
Let $S$ be the set of vertices with degree $1$. Note that since grap... |
Let $T_1(n)$ be the time complexity of computing the square of an $n$-bit integer, and let $T_2(n)$ be the time complexity of computing the product of two $n$-bit integers.
Assuming that addition is asymptotically faster than multiplication, which of the following is correct?
$T_1(n) = \Theta(T_2(n))$.
$T_1(n) = o(T_2... |
I recently read this paper Mahoney, 1999.
And encountered this line,
optimal compression of a probabilistic language L with unknown distribution (such as English) using an estimated distribution M (an encoding of length −log2 M(x) bits for each string x) is M = L, by the discrete channel capacity theorem.
Can you ple... |
Say you have some virtual machine with < 100 numbered opcodes that fully specify its behaviour. Is there an easy way to order and enumerate all possible programs of less than n instructions, the result being that a particular number refers to a particular program? Preferably with natural numbers and short programs at t... |
So I understand the logic behind converting positive decimal numbers to IEEE 32 bit floating numbers but I'm not completely sure behind the negative one's. If for example we have a decimal number say -15.5, do we have to do two's complement first then convert it to the floating point representation or we directly do it... |
I've recently come across a few articles that talk about a "Generalized Transition Graph" (GTG), but I've never heard of such a thing before. This other answer to a similar question leads me to believe that GNFAs are simply GTGs with a different name where GNFA is the more standard nomenclature/name.
There is a Wikiped... |
Problem:
Assume that $k \geq 1$ and $\epsilon \geq 0$, is $\ln^k(n) \in$ $\Omega( n^\epsilon)$?
Answer:
In the special case of $\epsilon = 0$, I claim the answer is no. I suspect the person who wrote this
problem meant to write: assuming $\epsilon > 0$.
I claim that if we differentiate $\log^k(n)$, k times then we get ... |
My theory
take a file examplesize:(3GB)
convert said file to a number
divide that number by a large prime number example:(2^82,589,932 · (2^82,589,933-1))[2018 Dec 07]
get the quotient and the remainder
if the remainder is still large do the math again to get another quotient and remainder until the remainder size... |
Problem:
Is $\log(n!) \in$ $\Omega( n^n )$?
Answer:
Since $n! > n^n$ for all $n > 1$ we can conclude that: $\log(n!) \in$ $O( n^n )$.
Let us look at the special case where $n = 4$.
\begin{align*}
n! &= 4(3)(2) = 24 \\
n^n &= 4^4 = 256
\end{align*}
Let us look at the special case where $n = 5$.
\begin{align*}
n! &= 5(4)... |
I have the following question and given answer:
Question: List the names of managers who have at least one dependant.
Answer: {e.Fname, e.Lname | EMPLOYEE(e) AND (∃d)(∃t)(DEPARTMENT(d) AND DEPENDANT(t) AND e.Ssn = d.Mgrssn AND t.Essn = e.Ssn) }
My answer was exactly the same except that instead of the (∃d)(∃t)(...) s... |
I am trying to design a parallel scheduling algorithm based on a constraint graph $G=(V,E)$ in which each node represents a task and each edge $e=(v_1, v_2)$ signifies, that tasks $v_1$ and $v_2$ can not be executed in parallel. Each task is executed exactly once, so the problem is finding "good" independent sets $V_i$... |
Problem:
Give tight asymptotic bounds $( \Theta )$ for the following function:
$$ T(n) = T(n-2) + n $$
Answer:
We are not given the base case. I am going to assume that $T(0) = 0$ and $T(1) = 1$. Here are some
values for the function.
$$T(2) = T(0) + 2 = 2$$
$$T(3) = T(1) + 3 = 4 $$
$$T(4) = T(2) + 4 = 6 $$
$$T(5) = T... |
Consider the following language, where the alphabet is $\{0, 1, 2\}$:
$B = \{0^a1^b2^c|a, b, c \geq 0 \text{ and }c = ab + 1\}$.
Is this language a context free language? Prove your answer.
I am having trouble using the pumping lemma of context free languages to show if this language is context free? Can anyone give me... |
If we partition the nodes of a graph into sets A and B, there is an edge e of weight larger than any other edge crossing the cut between A and B, e would never be in the minimum spanning tree?
|
Hi I'm trying to show $C=\{wzzw^R|w,z\in\{0,1\}^+\}$ is not a context-free language.( I have this believe because $C=\{ww|w\in\{0,1\}^+\}$ is not a context free language.) I'm really struggling to come up with a string that captures the essence of irregularity of this language: I tried strings like $s=1^p0^p1^p0^p1^p1^... |
Is $L_1 = \{0^n1^m0^{n+m}\mid m,n \geq 0\}$ regular? What is its context free grammar and proof?
Second, is the following language context-free?
$$L_2=\{0^a1^b2^c \mid a,b,c \geq 0 \text{ and } c = ab+1 \}$$
I am trying to prove this via the pumping lemma but am stuck. For CFG however, I have no idea. For the context-f... |
Consider a trail as a sequence of land heights representing the elevation along the trail. A pit is any position in the trail surrounded by higher terrain on both sides.
For example, in the sequence [1000, 600, 1700, 900, 900, 1400, 600], positions 1, 3 and 4 are all pits (elevations 600, 900 and 900 respectively).
We ... |
Given $m$ matrices of size $n\times n$ each of which is promised to be a permutation is it in $\mathit{quasiAC}^0$ or $\mathit{AC}^0$ to multiply the permutations where
$m=\mathit{poly}(n)$
$m=\mathit{poly}(\log n)$ which means $m=O(\log^k n)$ where $k\in\mathbb N_{>1}$
$m=O(\log n)$?
Given $\mathit{poly}(n)$ input... |
Given n numbers that all are identical, then what would be the running time of heap sort?
Will it be in linear time $O(n)$ or, best case $\Theta(n\log n)$?
|
I need to test my understanding of the difference between the data model and database schema. According to my understanding, the data model is a description of how the data will be stored and the relationships between the data. While the schema is very similar to a database model and according to the book "Database Ma... |
so I know the name of the array is a pointer to the first element of the array. But I've noticed something weird Here's the code.
Here is the result:
How is it possible that the pointer is pointing to itself and when I dereference it, I get the first element of the array? Are arrays implemented using struct? What am... |
I am asked the following:
def myRemove( str, ch ):
# Return a new string with the first occurrence of ch removed. If there is none, return str.
Sample run
>>> myRemove( "abcdabcd", "a")
'bcdabcd'
>>> myRemove( "abcdabcd", "x")
'abcdabcd'
>>> myRemove( "abcdabcd", "d")
'abcabcd'
I have tried a few different methods ... |
I am reading Chapter 8 NP-complete problems in Algorithms by Dasgupta et al and looking at some questions at the end of the chapter.
My own questions are below (after the image with the textbook questions). Note that I am not asking what the solutions are (those may be for separate questions) but rather the approach t... |
I am considering this left recursive language grammar production rule:
Expr = Expr, "a" ;
As a production rule, I believe that this can be used to produce an infinite sequence of aaa by describing the rule like this:
Given a non-terminal Expr, expand it to Expr followed directly by the literal a.
Example: if Expr is ... |
I'm trying to solve this recurrence of a function of a binary tree with a recursive tree. But I can't find any pattern to solve it.
This function calculates both the height and if its a balanced tree.
template <typename T>
std::pair<bool, int> balanced_height(const BinTree<T> &tree) {
if (tree.empty()) {
return {... |
Let $\mathcal C$ be a circuit of $m=f(n)$ input wires
where every input is taken in the set $\{x_1,x_1',\dots,x_n,x_n'\}$ where $x_n\in\{0,1\}$ and $x_n+x_n'=1$ holds (not all $x_i,x_i'$ necessarily needs to be utilized if $f(n)=o(n)$)
where every layer of the circuit is all $AND$ or all $OR$ gates having fan-in $2$ ... |
It is well known that a recursive sequence or $1$-d sequence can be calculated in $O( \log n)$ time given that it has the form
$$a_n=\sum_{k=1}^{n} C_ka_{n-k},$$
where $C_k$ is a constant. Examples would include polynomials like $n^2$ or $n^3$, exponentials like $2^n$, and Fibonacci Numbers defined by $a_n=a_{n-1}+a_{n... |
I have just started studying about bipartite graphs and there is an example that bipartite graph can be use to solve the wolf, cabbage, and the sheep river crossing problem, as a kid i had fun solving this question, now I was wondering how can we describe the problem in bipartite graph, as to describe it we need to div... |
Suppose we have an instance of 3SAT that is NOT satisfiable and we say $S$.
If in $S$ there are the following $8$ clauses
$\left(a\vee b\vee c\right)\wedge\left(a\vee\bar{b}\vee c\right)\wedge\left(a\vee b\vee\bar{c}\right)\wedge\left(a\vee\bar{b}\vee\bar{c}\right)\wedge\left(\bar{a}\vee b\vee c\right)\wedge\left(\bar{... |
Let $A\subseteq\{0, 1\}^∗$, and let $A^c = \{0, 1\}^∗ \setminus A$ be the complement of $A$. Prove: If A is $\le_m$-complete for CE, then $A$ join $A^c$ is neither c.e. nor co-c.e.
c.e --> Computably enumerable
The join of two languages $A, B \subseteq \{0, 1\}^∗$ is defined by: $\{x0 \mid x\in A\} \cup \{y1 \mid y \in... |
Let $\{A_n : n \in \mathbb{N}\}$ be a collection of c.e. (computably enumerable) sets. Is $\bigcup_n A_n$ c.e.?
That is, is the union of c.e. sets c.e.? Otherwise, under what conditions will this be true?
|
I am trying to wrap my head around how dynamic programming helps avoid all possibilities that are exponential after reading Chapter 8 NP-complete problems of Algorithms by Dasgupta et al. where it says:
So far in this book we have seen the most brilliant successes of this quest, algorithmic techniques that defeat the ... |
I recently read in the New York Times that my old "Data Structures and Algorithms" class professor Dr. Ullman had received the Turing Award along with Dr. Aho. The article title was "Turing Award Goes to Creators of Computer Programming Building Blocks".
Now, I think of of "computer programming building blocks" as thin... |
I had an online round at a company where I was asked this question.
There are $N$ items, and you have to choose some items from them such that the total weight does not exceed $W$.
Each item has three properties, weight, profit and type. There are only two types of objects.
Type 0 item can be selected independently own... |
Consider the language $L= \{a^n \mid n\geq 0\} \cup \{a^nb^n\mid n\geq 0\}$ and the following statements.
$\quad\quad\text{I. }L$ is deterministic context-free.
$\quad\quad\text{II. }L$ is context-free but not deterministic context-free.
$\quad\quad\text{III. }L$ is not $LL(k)$ for any $k$.
Which of the above stateme... |
Quantum computers can solve certain problems faster than classical computers e.g factoring numbers.
and this is because quantum computers can do a fourier transform on $n$ qubits in $O(n^2)$ time as opposed to $O(n2^n)$ time.
We can usually reduce time complexities by pretending that we can do some thing faster - intro... |
Given a self-balancing binary search tree of size $n$, I want to perform the following operations:
InsertInOrderSequentialBatch an ordered sequence of $k$ values (specialized $k \in \{2, 3, 4\}$ or generalized $k \in N $) which are guaranteed to be sequential in an in-order tree traversal immediately after insertion.
... |
From what I have been taught, I cannot use left-recursive, nondeterministic, or ambiguous grammars in recursive descent parsers. So, here is the grammar:
\begin{align}
&E \to E+T \mid T \\
&T \to T\cdot F \mid F \\
&F \to F^* \mid a \mid b
\end{align}
I actually changed this to:
\begin{align}
&E \to TE' \\
&T \to +TE' ... |
I'm trying to implement SAT solver, based on backtracking algorithm and BCP. This SAT solver is trying to pick one literal from each clause, from 3-CNF SAT instances. I've implemented a neural network based heuristic to pick valid literal at first, and degree of how valid is given literal from clause is determined by n... |
I am trying to create a new form of a bubble loop and want to see if they would return the same truth values during runtime. Could I get a second pair of eyes to confirm if this is the case?
Note: prod is equal to a target product of a sequence.
Code #1
For c = 1 to x
For d = 1 to c - 1
If (a,c * a,d = prod) return Tru... |
Does this conversion look right? I am learning conversion from RE to CFG.
RE:
$$(a \cup b)^* \cup ab(a \cup b)^*$$
CFG:
Terminals:
$$ S_1 \to a \\ S_2 \to b $$
This is for the first $(a + b)^*$:
\begin{align}
&S_3 \to S_1 \mid S_2 && (a \cup b) \\
&S_4 \to S_3S_4 \mid \epsilon && (a \cup b)^*
\end{align}
This is for th... |
I have an array $A$ of length $n$, containing triplets (think of it as a $3\times n$ matrix). Can I re-order the array (without reordering a triplet's inner values) in time $O(n\log n)$ so that it is possible to answer the following query in $O(\log n)$? Given $i$, determine the number of $j$ such that $A_{2,j} \le A_{... |
What does it mean when in a machine learning paper there is
$(arg)^{T}$, what does the T does to an arg in this 3b1b video on neural networks he puts the: $(w^{l-1})^{T}$
|
I just want to know if Big O notation was used as a consequences of the Linear speed up theorem or not. For me I guess the answer is yes.
For example, if we didn't have a linear speed-up theorem, then does it mean that we would have a different measure of time/space complexity? i.e. multiplicative constants does makes ... |
The number of comparisons in the following algorithm is supposed to be $3n/2 - 3/2$ if $S$ is odd. I understand that the for loop is $3n/2$ comparisons, but I fail to see where the $-3/2$ comes from.
if (n % 2 == 0):
if (S[0] > S[1]):
Largest = S[0]
Smallest = S[1]
else:
Smallest = S[0]
... |
I'm currently struggling to come up with a proof that the following language is irregular:
$$L_2 := \{w_1aaw_2 \in \Sigma^* \mid w_1, w_2\in\Sigma^* \land |w_1| \ne |w_2|\}$$
where $\Sigma = \{a, b\}$.
Now quite intuitively, the language needs to know what $|w_1|$ was in order to compare against $|w_2|$, so it has to b... |
int counter(char c){
int count = 0;
while (c!=0){
if((c & 1) !=0)
count++;
c = c >> 1;
}
}
I am trying to understand a program that counts the number of 1s in the binary representation of the input character. While I understand the & part and the count part, I don't get why we're checkin... |
I'm trying to solve this question for practising purposes:
"Describe a linear-time algorithm for computing the strong component containing a given vertex v. On the basis of that algorithm, describe a simple quadratic-time algorithm for computing the strong components of a digraph."
The question can be found here . It... |
What will be the context-free grammar of $B= A_1.A_2 $
when $A_1 = \{0^n1^n|n\geq 0\}$
$A_2 = \{1^n0^n|n \geq 0\}$
Also verify using a string.
if the Grammar for
$A_1$: $S_1 \rightarrow 0S_11 | \varepsilon$
$A_2$: $S_2 \rightarrow 1S_20 | \varepsilon$
I am stuck with the value of $S \rightarrow$ ?
|
These are simple statements:
Marcus was a man
Marcus was a Roman
All men are people
Caesar was a ruler
All Romans were either loyal to Caesar or hated him
Everyone is loyal to someone.
People only try to assassinate rulers they are not loyal to
Marcus tried to assassinate Caesar.
I have converted them to First Order ... |
Suppose we define a class of algorithms that is allowed to sample i.i.d. Bernoulli bitstrings of arbitrary length, and use these to generate outputs. If we are allowed to use algorithms like this, then intuitively, "white noise" images like this one are easy to generate (i.e they have a low description length algorithm... |
Prove that the language that consists of cube numbers as strings is not regular.
I wanted to use pumping lemma but couldn't
$$0, 1, 8, 27, 64, 125, 216, \dots$$
|
The Exercise is
Computer A has a main memory of size HA 2 MiB, and computer B has a main memory of HB = 256 MiB. Both computers process single transactions that have a size of s=84 KiB. Each of the computers loads a maximum number of transactions into the main memory so that at least 512 KiB are still reserved for the... |
My assumptions (please correct me if anything in this part is wrong including wrong usages of jargons)
In MIPS instructions, add t1 t2 t3 translates to 00000001010010110100100000100000 . The add, t1, t2, t3 I suppose first of all get translated to some ASCII value implemented on the hardware level. For example, t1 is ... |
Below are the excerpts from the automata text by Peter Linz.
Definition 9.3
Let $M = (Q,\Sigma,\Gamma,\delta,q_0,\square,F)$ be a Turing machine. Then the language accepted by $M$ is
$$L(M) = \{ w \in \Sigma^+ : q_0w \vdash ^* x_1q_fx_2 \text{ for some } q_f \in F,x_1,x_2 \in \Gamma^*\}$$
From the above definition it... |
I was thinking about the implementation of a DFS on graphs, and particularly about space complexity. The DFS algorithm can be implemented with a stack data structure. When a vertex $v$ is met during the exploration of the adjacency list of a vertex $w$, if $v$ has not already been processed, then $v$ is added to the st... |
$X_1+X_2$ and $X_1-X_2 $ are i.i.d. $N(1,4)$. What is the distribution of $X = (X_1,X_2)^T$?
I know i.i.d. is an independent and identically distributed random variable but I don't know how to use it to solve this problem that contains a column vector.
|
I'm looking for an algorithm that will group players from the same teams together throughout multiple matches.
In my case, every team has up to 4 players in every match.
Teams have subs, which means that it is not necessary that the same players will play in all the matches.
Each team has randomly assigned ID in form o... |
Assume that we have a car in the real world, this car would be composed of atoms, and we can do operations on this car (for example: we can move the car or change its color, etc.).
And assume that we have a car object in the computer world (in RAM), this car object obviously is not a real car but rather a representatio... |
We are given $N$ points($N \leq 40$), where no combination of three or more points is colinear. The values of $x$ and $y$ are bounded by [$0$,$10^4$]. The problem is to find the number of permutations(mod $M$) of the points that satisfy the following properties:
We draw a triangle between the first 3 points of the per... |
I am trying to fully analyze the running time of $\texttt{nestedLoops}$ in terms of $n$ with a Theta bound.
The Java code I have is as follows:
public void nestedLoops(int n) {
int i = 1;
while (i < n) {
int j = i;
while (j > 1) {
int k = 0;
while (k < n) {
... |
I just got a hobby of studying this topic and it is quite intriguing. In one of the books, I came up with the following question:
A computing hardware is to be designed with a processor generating 32bit address for memory. It requires 2GB of RAM, 128MB of EPROM and 1MB of EEPROM, and these are mapped in the memory add... |
Backgrounds
Hi guys, I am now trying to teach myself some basic computer science theories. Specifically, I am using the book, CSAPP (computer systems, from a programmer’s perspective) and 15-213 taught by CMU
Question
My question is whether I need to memorize all the details covered in such theoretical courses (eg. the... |
I have some sets, and can combine them by taking their union. I can take unions of the unions, too. I want to take unions until the total number of sets is as small as possible, with one caveat: that none of the unions can have more than $N$ elements. (So that the problem always has a solution, none of the input sets w... |
I came across an algorithmic problem. I do not know how to do it optimally.
The problem is as follows:
There is an increasing array $A$ of size $n_1$
There is an array $M$ of queries of size $n_2$
where $1 \le n_1, n_2 \le 10^7$
For each query element $m \in M$, it is required to find the count of elements in arra... |
How we can prove that the relation: $R= \left\{0,1\right\}^*\times \left\{0,1\right\}^* \in FP$
I understand that we need to find a polytime algorithm to decide whether $(x,y) \in R$ since $(x,y)\in R= \left\{0,1\right\}^*\times \left\{0,1\right\}^*$
How can we find this? And this is enough to prove that $R \in FP$?
|
I want to know if a DFA is minimized, is there an upper bound on how many dead states are possible when it is in its minimal form, in terms of number of states, etc?
Intuitively, I am thinking that it is at most one, because if other state is there from where accept state is not reachable, the minimization would merge ... |
Given an integer $x$, I need to find the largest power of two $p = 2^n$ that divides $x$ such that the remainder is zero.
When $x$ is zero, the algorithm should return zero. For odd numbers, it should return one, since the largest power of two that divides these numbers is $2^0$.
How to write an algorithm for this? (an... |
Given a NOT satisfiable 3SAT instance, that we say $S$. Suppose that $M$ is a minimal subset of clauses of $S$ such that $M$ is NOT satisfiable. Say $X$ the subset of variables of $S$ that belong to the clause of $M$. For each Boolean values combination of the variables of $X$, we have a clause of $M$ that is false, be... |
Assume the binary operator is given as a table/matrix, so constant time to compute $xy$. And likewise, assume the (relation giving rise to the) partially ordered set is also given as a table, or in any case assume constant time to check if $x \le y$.
If I want to check if a finite binary operator is residuated, what's ... |
Is there an algorithm to find a spanning tree. I know that there are $n^{n-2}$ of them and we have algorithms to find a minimum spanning tree.
But what if I just want any spanning tree? It doesn't have to be minimum.
For a graph with no edge weights, should I just assume that the edge weights are all 1 and then use a... |
Given a graph $G = (V,E)$ and an integer $k$, the 1-BDD problem asks if there exists a subset $D$ of at
most $k$ vertices such that the degree of any vertex in $G[V \setminus D]$ is at most one.
Is there any FPT algorithm for the above problem running in time $O^*(2^k)$?
|
Given an arbitrary TM, can you decide whether it's a LBA?
|
Given any deterministic finite state automata $M$ over any alphabet, I need to construct an FSA $M'$ that accepts the set of strings $M$ accepts, but with two different letters interchanged. For example, if $M$ only accepts $101$, $M'$ should only accept any element from $\{011, 110\}$.
Suppose a string accepted by $M$... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.