instruction stringlengths 35 29.1k |
|---|
$1.\: A_{DFA} = \{\langle B, w \rangle \mid B \text{ is a } DFA \text{ that accepts input string } w \}$
$2.\:A_{DFA} = \{\langle B \rangle \mid B \text{ is a } DFA \text{ that accepts input string } w \}$
I know how to proof that 1 is decidable by constructing a machine that always halts and accepts whenever $B$ accep... |
I have the following code in python and was asked to find the tightest upper-bound in terms of Big-O , I've done two attempts below and I don't know which one is right, can you help me verify as to which one is the right answer/approach?
def f1(L):
n = len(L)
while n > 0:
n = n // 2
for i in ran... |
Why does {w | w has equal number of 01 and 10 substrings} not require an infinite amount of memory
to “count” the number of 01 and 10 substrings?
|
Let $G$ be an undirected graph with $n$ nodes. Prove that any two of the following implies the third:
$G$ is connected
$G$ is acyclic
$G$ has $n-1$ edges
Proving $1, 2 \implies 3$
A connected, acyclic graph is a tree. Each node(vertex), except the root, in the tree has exactly one edge going upwards(towards the root)... |
In the context of studying the conversion from an NFA to the equivalent DFA, I came across the following NFA, which accepts all strings over the alphabet $\{0,1\}$ which contain $01$:
After I converted the NFA to the equivalent DFA, it became:
The issue is that the NFA accepts the string $101$ but the DFA doesn't.
Is... |
An array is $d$-sorted if every key in the array is located at a distance at most $d$ from its location in the sorted array.
I need to write an algorithm that get a $d$-sorted array of length $n$ and sort it in the following running times:
$\Theta(n)$ if $d$ is constant
$\Theta(n\log\log n)$ if $d = \Theta(\log n)$.
... |
Given a connected sourced/sinked directed acylic graph $G = (V, E \subseteq V^2, s \in V, t \in V)$, we want to enumerate the edges $e \in \mathsf{Bottleneck}(G) \subseteq E$ for which every $s$,$t$-path contains $e$. I don't actually know the real name for this notion; so I'm calling it the "bottleneck set", but when ... |
I'm trying to create an unambiguous grammar for a calculator that uses $+$, $-$, $*$, $/$ and $()$.
From watching videos and reading articles online, I understand how to create the grammar with $+$, $*$, $()$ (or 3 different precedences).
i.e. $E \to E + E \mid E * E \mid (E) \;\mid \;\text{num}$
$$\begin{align}
E &\to... |
This is a very elegant implementation of prefix-span algorithm by the maintainer of the prefixspan pip package. However, I am having a hard time understanding the reason behind the implementation. The result by localOccurs doesn't really make any sense to me. Can I get a overview of what each part of this implementatio... |
In the book "Advanced computer architecture and parallel processing" (El-Rewini & Abd-El-Barr), there is a question in the exercises of chapter 1 that needs the reader to compare between multiprocessor systems and uniprocessor systems in terms of many factors including run-time system:
Compare uniprocessor systems wit... |
I am reading Goldreich, Vadhan, Wigderson: Simplified Derandomization of BPP Using a Hitting Set Generator and trying to understand the result that polytime hitting set generators (HSGs) would not only imply $\mathsf{RP = P}$ but $\mathsf{BPP = P}$ as well, but I can't even conceptualize why the former holds.
The paper... |
I'm trying to prove that the following language is not regular:
$$\{ w^n\mid w \in \{0,1\}^∗, \, n \ge 2 \}$$
I'm trying to prove this with the pumping lemma, but I'm kind of confused because $w$ is a language, not an expression like $a^n b^n$, and I don't know how can I partition that into three parts.
|
We have a language $$ L = \{a^n b^m \mid 2n + 3m \le 1000 \} $$
Is this language regular?
I'm trying to disprove this using the Pumping Lemma, but it didn't work.
assume I say x = $x=a^{h}$ and $y=a^{t}$ and $z =a^{n-t-h}b^m$
if I say i = 0 everything is okay because $L =a^{n-t}b^m$ and 2(n-t) + 3m <= 1000
if I say i ... |
We have a language $$ L = \{a^n b^m \mid 1000|nm \} $$
Is this language regular?
I'm trying to disprove this using the Pumping Lemma, but it didn't work.
assume I say $x=a^{h}$ and $y=a^{t}$ and $z =a^{n-t-h}b^m$ and 1000|nm
if I say i = 0 , $L =a^{n-t}b^m$ and 1000|(n-h)*m and I can't prove (n-h)*m isn't dividable b... |
Is it possible to find an upper and lower tangent line to a convex hull in $log(n)$ time where $n$ is number of points on a convex hull? I have just done it in linear time where I checked for upper tangent line if orientation of $S,i,i+1$ is greater than zero (anti-clockwise) and if orientation of $S,i,i-1$ is greater ... |
For any alphabet and any natural number k, a language of strings at least k is decidable.
So my question is having some alphabet (let's say (0,1)) and some number let's say k=5 then my language has every string of 1's and 0's that are 5 or more characters at length (ie 01101, 011011 belong to language, while 011,10,110... |
Let the language $K = \{\langle W \rangle: W \text{ is a DFA on } \{a, b, c\} \text{ and } L(W) \text{ contains some string in } \{b, c\}^*\}$.
Is $K$ decidable?
Is it sufficient to define $M$ as follow :
Input $w$;
Simulate the computation of $W$ on $w$
If the accepting state is final after reading at least one $b$ o... |
Prove that 9 is the minimum number of calls to make-set, union-set, find-set such that a disjoint set union using weight (number of nodes) by path compression and disjoint set union using rank (upper bound on height) such that the trees produced by this sequence of calls is different.
So far I've found a tree example f... |
Setting aside the fact that tax lots (using specific id) should usually be assigned at the time of the trade (for stocks in the USA), let's assume instead we want an algorithm to optimally allocate them once we have the whole list of trades in hand for a single security. Each trade comprises: date-time, number-of-share... |
I’m trying to analyze a repeated data stream from a sensor. The data probably has events at the 100us scale, it occurs at a fairly random interval, and the signals are extremely similar. The problem is that I don’t have any sensors that have sub-millisecond refresh rates. The best I can do with what I have is about ... |
This is probably a very stupid question but I couldn't find an answer anywhere. I'm reading the Technical Reference book of the IBM PC XT and it says that "The system board also has from 128K by 9 to 256K by 9 of R/W memory." What does this by 9 means?
|
I'm trying to create a program where I have a user walking around a random space that contains obstacles, but I can't see where the obstacles are. The point is that as a user walks around, based on where they are traveling, the program creates a rough map of places where there aren't any obstacles (if the user is able ... |
I am studying algorithms and there is a question in CLRS called the Half-SAT problem
We are given a 3-CNF formula with n variables and m clauses where m is even. We wish to determine whether there exists a truth assignment to the variables of f such that exactly half the clauses evaluate to zero and the other half to ... |
can a computer be totally made up of SRAM with no DRAM but with secondary memory and run an opreating system properly?
|
I am learning computer architecture and organization. I am stuck in the following question. Can someone please help me?
The stage delays in a 5-stage pipeline are 300, 200, 100, 400 and 350 picoseconds. The second and third stages are merged into a single stage with delay 350 picoseconds. The throughput increase/decre... |
Is there an algorithm that could check whether it is possible to win in the current situation in solitaire? That is, can we remove all cards from the table in a certain number of moves?
Description of the game:
Two decks of cards (36 pieces each) are connected and shuffled, and then they are laid out in 8 piles of 9 ca... |
I have the following problem:
Write a function
whose input is an adjacency matrix A of a graph G. The function returns true
if G is a regular graph and false otherwise.
I understand that a graph is regular if the degrees of all the vertices are the same.
Therefore, I have written the following code which calculates t... |
I need to prove the existence of the $(1944, 144, 0.5)$ spectral expander. I tried to construct it using tensor product of the following graphs:
$$
(1944, 144, 0.5) = (9^2, 9, 1/3) \otimes (24, 16, 0.5)
$$
I already know that expander with parameters $(9^2, 9, 1/3)$ exists and corresponds to the affine expander, but I ... |
I am not asking about the Huffman Code, but the most widely described algorithm for generating one, also described on the english wikipedia: https://en.wikipedia.org/wiki/Huffman_coding#Compression
Now, I am not really concerned with the code being optimal or not, because many proofs for this can be found, but there is... |
As part of a project i'm doing I have been looking for a way to find common values between 2 arrays including duplicates.
For example;
A = [2, 2, 3, 5]
B = [2, 2, 5]
would return the array;
Common values = [2, 2, 5]
I have attempted using sets, and the intersection function, but neither gave duplicates
Any help appreci... |
Generally, we can implement algorithms in-place and out-of-place.
However, I can't say for certain that radix sort can be implemented in both ways.
|
Most programming languages have some kind of type systems but are there any programming languages widely used outside of academia (in consumer-oriented tech, finance etc.) that have intensional identity types à la Martin-Löf?
Coq and Agda have identity types but they are primarily used in academia.
|
Any physical computational device clearly has finite memory. On the other hand the input can be external and could therefore potentially be infinite. This idea is perfectly captured by the deterministic finite automata (DFA), so why do we use the Turing machines instead?
Let's consider a popular example. The language
$... |
Is there any formal method to prove that one problem belongs to Complexity Class $\mathbb{P}$?
For example, how can we prove that the problem of finding $n^k$ belongs to Class $\mathbb{P}$? We can use the fact that each multiplication can be done in unit time.
If you present an algorithm that can solve this problem wit... |
I solved the question T(n) = T(sqrt(n)) + 1 but can't quit understand one step of the solution
I don't understand the transition in (1).
how did we conclude that T(m) = T(m/2) + 1 from the previous step that m is in the power?
|
Can somebody please explain this in simple terms. I don't understand Sipser's way of explaining it.
He says this is a corollary to PATH is NL-complete which I do not understand either.
Can somebody please explain everything in a simple manner to me?
Theorem 8.25 shows that any language in NL is log space reducible
to ... |
I'm trying to understand the various optimizations given in the original 1992 paper on Karger's algorithm. Specifically, looking at section "3.1 Unweighted Graphs", I don't understand what data structure is used to represent the variant of the algorithm that works in $O(|E|)$ time and space (the other variant, which us... |
What have you tried?
So I watched this video.
According to the video, we've to calculate the variance $\sigma^2$ as follows:
$$
\sigma_{k}^{2} =
\frac
{
p_{1} \left(x_{1} - \mu_{k_1}\right)^{2} + \ldots + p_{n} \left(x_{n}
- \mu_{k_n}\right)^{2}
}
{
... |
I have the following language:
$L = \{a^{n^2}|n\geq 1\}$
Hey i have been stuck on this problem for a few days now and even going through sample problems in my textbook as well as sample solutions i cant figure out how to make this turing machine to work.
I know it may be a vague question but i really could use some hel... |
Recently been practicing some recent exams, there was a problem I could not comprehend the given answer, the question is as follows:
Suppose array $A[1..n]$ consist of $n$ distinct integers that is
sorted in ascending order, then How many of below problems could be
solved in $O(\log n)$?
and there were three statemen... |
1)"Given a CFL L and a regular language R, is the intersection of L and R an empty set?" decidable?
2)What if we replace L with the complement of L?
Either 1 or 2 is decidable and the other is not.
For the one that is decidable, give an algorithm. For the other, give an undecidability proof.
Intuitively, i think that 1... |
Algorithms like LZW and others compress data sequences.
What I'm looking is an algorithm that compress multiple Sets. if possible online algorithm.
For example :
1,2,3,4,5
2,8,7,5,4
3,1,8,9,7
2,4,5,8,7
becomes :
Rule1 : 2,4,5
Rule2: 8,7
Rule3 : 3,1
Rule4 : R1,R2
R1,R3
R1,R2
R2,R3,9
R4
.. Rules are hiera... |
The Wikipedia page on the Toffoli gate mentions that CNOT is the only non-trivial reversible gate on two input bits. The CNOT gate computes the following function:
$$
00 \to 00 \\ 01 \to 01 \\ 10 \to 11 \\ 11 \to 10
$$
I think I found a different non-trivial gate on two input bits:
$$
00 \to 01 \\
01 \to 00 \\
10 \to 1... |
For example I have 2 simple FSM. I will use regular expression for clarity.
FSM1 = 1+ = [1,11,111,...]
FSM2 = 2+ = [2,22,222,...]
FST = 1/2 = [1->2,11->22,...]
What is the general way to prove that there exists finite-state transducer that maps each string from the set defined by FSM1 to a string defined by FSM2? What... |
Is a Turing machine with added the following contant-time operation equivalent (in the sense that polynomial time remains polynomial time and exponential time remains exponential time) to a (usual) Turing machine:
By predicates I will mean predicates in first-order predicate calculus. (Note that predicates may have fre... |
Is a computer with infinite memory and infinite word size a Turing machine equivalent (in the sense that polynomial time remains polynomial time and exponential time remains exponential time) if we allow constant-time linked list element insertion (at the beginning of the list)?
I doubt this because element insertion r... |
I've just learned While-Programms. In case you're not familiar with it, a W-P is inductively defined as...
$x_i \leftarrow x_j+c$ (Addition for every $i,j \in \mathbb{N}$)
$x_i \leftarrow x_j-c$ (modified subtraction for every $i,j \in \mathbb{N}$)
If $P_1, P_2$ are While-Programms, so is their composition
If $P$ is... |
A graph G has n vertices and m edges
The Minimum Cycler of G is a set S of edges of minimum total weight such that every cycle in G contains at least one edge in S.
Devise an algorithm that finds the Minimum Cycler in O(m log n) time
My Approach-
Consider a cycler S. We can reduce our focus only to the cycler with mini... |
I started learning CFG and I'm trying to find CFG for this language, but I have no idea where to start and I can't seem to find this one online anywhere. It would be great help, if someone could show me how to do it. Thank you!
|
Suppose I assume that the complexity of a non-deterministic Turing machine $N$ is $T(n)$, $n$ is the length of the input string. What would be the time complexity of a deterministic Turing machine $D$ equivalent to $N$?
|
Python and Matlab seem to disagree on the division by 0.
Python:
>>> 1 / 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
Matlab:
>>> 1 / 0
Inf
with the usual properties of $\infty$ for Inf.
Which one is correct when it comes to the IEEE double-precision for... |
I am using method 3.3 described in Outlier Detection using Isolation Forest and Local Outlier
Factor .
It states:
Specify a dataset: $={_1, _2, ..., _}$.
Here, is the sample number of . $_$ is an attribute in $$, and $_={_1,
_2, ..., _}.$ $_$
is a certain data value of the attribute $_$
.
The outlier coefficient of th... |
I have an HW question where I found an answer that matches mine, but their breakdown confuses me.
Ques: What is 4365 - 3412 when these values represent unsigned 12-bit octal numbers? The result should be written in octal.
I used binary and then looked up the Octal to obtain 753
Found solution: 4365-3412 = 0753
This is ... |
The proof that $IP \subseteq PSPACE$ is done by considering by game tree of the interactions between the prover and the verifier; this tree is polynomial in depth and each message is polynomial in length, so the tree can be explored in a DFS like fashion to simulate an optimal prover in PSPACE.
Why can't the same be do... |
Visitor Pattern enables mimicking sum types with product types. Where does the "sum"-iness come from?
For example, in OCaml one could define type my_bool = True | False
Or encode with visitor pattern:
type 'a bool_visitor = {
case_true: unit -> 'a;
case_false: unit -> 'a;
}
let t visitor = visitor.case_true ()
le... |
I am trying to apply MADDPG, a policy gradient algorithm that uses centralized training and decentralized execution, to a project. In the work of Lowe et al., the actor returns a pmf for a discrete actions pace. If I set it to Discrete(5) for each agent, it would return something like [0.1 0.15 0.05 0.34 0.46]. I am co... |
Is it true that adding to a Turing-machine-equivalent an "oracle" calculating any polynomially calculable (in this machine) function using some other nonzero polynomial time than this machine itself could do, leaves the new Turing machine equivalent (in the sense that polynomial algorithms remain polynomial and exponen... |
Most mathematical objects can be said to be defined in simple terms, are usually really concise and still manage to capture the essence of what they are trying to talk about. For example, topology does a great job at capturing a broad and variety of interesting objects, but still its definition is simple enough to be u... |
M is a turing machine description, L(M) is recognized by M, |L(M)| is the size of this language.
Why is {M : |L(M)| <= 330} not CE?
I can't seem to understand the logic why it is not CE, wouldn't it be CE since if it goes over 330, then we just halt?
Here they mention that its complement is CE, then by Rice Theorem, |L... |
My understanding of non-deterministic algorithms is that they're "as lucky as you want".
...you can think of the algorithm as being able to make a guess at any point it wants, and a space alien magically guarantees it will always make the right/lucky guess.
For example, if you choose two vertices v and w, if there's ... |
I need to rewrite a short utility library, to get it working with the Brave browser (My actual question isn't about brave per se.)
canvas-color-tracker - example of it being used and src/index.js is short
The HTML canvas is used for mouse over and clicks to determine what object is under the cursor.
To use it with cir... |
Moving from top left down the column then over to the right column, taking ideas from here: https://www.geeksforgeeks.org/longest-palindromic-subsequence-dp-12/
I want to restate the question at the top of the Excel table.
Why do I need to max from T(i,j-1) and T(i+1,j)? Can't you just take what's in T(i,j-1)?
I chan... |
Given a binary matrix, define the magnitude of a row by reading off the numbers in it left to right and similarly for columns, reading the numbers going down. For instance, the row magnitude of the 1-st row of this matrix is 1001101, and for the 2-nd column it is 11.
1 0 0 1 1 0 1
0 0 0 1 1 0 1
0 1 1 0 0 1 0
0 1 1 0... |
I am facing the following question:
Let $\Pi$ and $\Pi$’ be two NP-complete problems, prove or refute $\Pi’\propto_{poly}\Pi$.
I do not understand the meaning of this question and how to answer it.
The definition of $\Pi’\propto_{poly}\Pi$" as follows:
Let $\Pi$ and $\Pi'$ be two decision problems. We say that $\Pi$... |
Hey guys so I picked up Introduction to the Theory of Computation and started studying finite automata and Turing machines. I was given the following language as an exercise in class, in which I need to build a Turing machine with only one tape and no extra tape space that accepts the following language:
$$\{0^{3^k} 1^... |
I'm trying to create a procedure in MySQL/MariaDB with optional filters for each participating table. Assuming the tables are $A, B, C, \ldots$, each table may or may not be filtered, and the result is that of each table having their respective optional filters applied. $A$ and $B$ have the relation A (1) -> (*) B, and... |
Why does attempting to estimate the entropy of a string, by randomly choosing pairs of (not necessarily adjacent) characters in it, and counting how often the selected characters in the pairs are equal, give wildly wrong results? Here is a MatLab program that exemplifies that, also available on my blog:
% Ovo je MatLab... |
I have been trying to create an FA for the language.
$\{w \in \{0, 1\}^∗ , |w|= 4 \vee w \text{ contains the substring }01\}$
I created one that accepts words that contain the substring $01$, but I have a hard time finding a solution for the length part.
This is my attempt so far:
Any help is greatly appreciated.
|
At the moment I am studying several questions about the arithmetical degree of some index-sets in relation to the standard-ordering on $\mathbb{Q}$. The situation is as follows: I fix some enumeration $r_0, r_1, \ldots$ of $\mathbb{Q}$ such that $<$ is decidable. Then I take
$R_e=\{r_n \mid n \in W_e\}$, where $W_e=dom... |
Quoting from Wikipedia:
A ridge function is any function $f:\mathbb{R}^d\rightarrow\mathbb{R}$ that can be written as the composition of a univariate function with an affine transformation, that is: $f(\mathbf{x})=g(\mathbf{x}\cdot\mathbf{a})$ for some $g:\mathbb{R}\rightarrow\mathbb{R}$ and $\mathbf{a}\in \mathbb{R}^... |
I am studying Computation complexity using Papadimitrious's book: "Computational Complexity".
While doing Problem 7.4.4, I came across the definition of what it means for a class of functions $C$ to be closed under left polynomial composition.
Here is Problem 7.4.4:
"Let $C$ be a class of functions from nonnegative in... |
I don't understand why the $1^{st}$ is false but I think I see why the $2^{nd}$ is true.
If $f(n) = O(n^2)$ and $g(n) = O(n^2)$, then $f(n) = O(g(n))$.
If $f(n) = O(g(n))$ and $g(n) = O(n^2)$, then $f(n) = O(n^2)$.
I understand why the second is true but not the $1^{st}$. For case 1, if
$f(n) < c_1n^2$ for some ... |
Found this in solutions of a test as being true
If you can square an n-bit integer in time $O(n \,log \,n)$, then you can multiply two n-bit integers in time $O(n \, log \,n)$.
How does the above scenario apply for multiplying different numbers? Isn't it possible that squaring is a special operation since it is just ... |
I'm looking at the following grammar rules for the Java language described on the Oracle docs:
Statement:
...
if ParExpression Statement [else Statement]
StatementExpression ;
...
StatementExpression:
Expression
ParExpression:
( Expression )
I don't understand why the StatementExpression rule... |
I have already made a Turing machine with just one tape that solves a subtraction between two numbers, but I trying to do the same but with TWO tapes.
As an example, how can I solve 4-2?
Taking account that 4 can be represented as 0000, 2 as 00 and the - as 1.
So, in this case the input will be 0000100.
|
First let's have some definition (you can find these in any complexity's textbook)
Theorem. [Gap Theorem] There is a computable time bound $t(n)$ such that DTIME[ $t(n)$ ]= DTIME[ $r(t(n))$ ] for any computable function $r$.
This theorem says that even if you have more time resources, then you cannot do more. We have... |
Can you please help me prove this? I am trying to set $o(f(n))= g(n)$ and then try to solve the equation $f(n) + g(n) = \Theta(f(n))$ but I don't know if it is the correct way, and if it is I don't know how to continue my solution. Thank you
|
I'm to write a syntax that will allow for a recursive function, i.e.
f(x) = if x == 0 then x else f(x+1)
Here's one attempt at creating the grammar:
But I don't think this is right since there's no such thing as parameterized syntax.
|
When can we fold copies in SSA?
We are clearly allowed to fold a copy such as
a0 = call foo()
b0 = a0
But what about a program such as
a0 = call foo()
C0 = call bar() // ignore sinking briefly, assume this is used later
if(a0) {
a1 = C0
}
a2 = phi(a0, a1)
call print(a2)
We can't fold the a1 = C0 copy because phi(... |
Do the following two CFGs describe the same language
S → aS | bS | ε
S → aS | Sb | ε
Would the answer to this be no, because the order can't be switched? bS and Sb are different. I'm a bit confused about how I would find out if they described the same language.
|
I was reading a solution to the problem in the title on leetcode and the article says that the time complexity of the following solution is O(n)
setup a data structure to hold stream value and insert new element in the right place using linear search or binary search
return median
my solution is as follows:
class Med... |
We have a strongly connected directed graph where each edge has positive integer weights. We are also given a $B \in \mathbb{N}$. Does there exist a strongly connected subgraph where sum of edge weights $\leq B$?
I'm not sure what NP-Complete problem to use. I tried subset sum, but it takes exponential time to build th... |
import java.io.*;
import java.util.*;
public class reverseAnArray2
{
public static void main(String args[])throws IOException
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter size");
int n = sc.nextInt();
int a [] = new int [n] ;
int b [] = new int [n] ;... |
I am reading Algorithms by Dasgupta et al and they mention maximal matchings as approximations for vertex cover.
They mention that the 2-approximation ratio is a lower bound. How is a maximal matching a lower bound? Does it mean that it is the lowest approximation value we can get compared to $\log n$ of the greedy alg... |
I read up the definition of a public key cryptosystem. It mentions there is a public key and a private key. That's confusing. Why is it called a "public key" system if it involves a private key as well?
|
I'm given a binary min-heap (implemented with an array) and need to come up with a (simple) efficient (no more than $k$ comparisons) to find the $k$-th minimal element.
My attempt was as follows:
check who is the smallest among the root children
scan the corresponding sub-heap maintaining a counter counting how many n... |
Prove that DFS produces the correct topologically ordered sequence.
I am having a hard time understanding the question itself. Should I prove the correctness of DFS? Should I use the pseudocode?
|
I'm trying to implement a KNearestNeighbor model and came across the fact that many professional models use a K-D tree to index the K Nearest Neigbors. I also read that high-dimensional data makes a K-D tree less useful because you don't eliminate as many vectors for every branch in the tree when traversing it. All of ... |
I am trying to explain the value iteration method that is used in reinforcement learning. The method is used to estimate a solution to a recursive equation like:
$ Return(state_t,action_t) = Reward(state_t,state_{t+1}) + \gamma * \max \begin{bmatrix} Return(state_{t+1}, action_{t+1}=='n')\\ Return(state_{t+1}, action_{... |
I have a connected graph with $nk$ vertices, and would like to select $n$ disjoint induced subgraphs with $k$ vertices such that each subgraph is connected, selecting one out of all possible solutions at random. It doesn't necessarily need to be uniformly at random, I just want the possibility of getting any possible s... |
I am looking for references that talk about the following subject:
Software programs are in general complex systems. That is, if we decompose them into components and we make sure that each component is working correctly then we stil can have a lot of failures that arise from the interactions between the different com... |
I am trying to understand reductions and NP-completeness from Algorithms by Dasgupta et al.
Chapter 8 has the table below and I am wondering:
if $P = NP$ does each of the problems on the left reduce to the easy problem (in $P$)in its immediate right?
The book mentions that
the problems on the left are all diffic... |
My lecturer says that a variable takes up one memory position in RAM. This is the slide in question:
But CLRS (Introduction to Algorithms by Cormen, end of page 23) says an integer is represented by $c\ lg\ n$.
Are both statements true? How can that be?
|
I want to convert a set of yaml files in a folder into an xlsx file. I thought I'd start with trying to convert one yaml file into an xlsx file. The yaml files in the folder are all in the format given below:
info:
city: Bangalore
competition: IPL
dates:
- 2008-04-18
gender: male
match_type: ... |
I know that dynamic programming is used to solve in "pseudo-polynomial time" some NP problems, like the knapsack. If P = NP, would it mean that every problem that we solve with dynamic programming would have a more efficient (polynomial) way to solve? Or are there problems that even if P = NP, we would still use dynami... |
I was going through the concept of reaching definitions from the red dragon book.
The authors define reaching definitions as follows:
Definition: We say a definition $d$ reaches a point $p$ if there is a path from the point immediately following $d$ to $p$, such that $d$ is not "killed" along that path.
Then the auth... |
I'm VERY stuck with this problem:
Given a set (with possible repeated elements), the cost of adding two elements $x, y$ is $x + y$.
For example, the possible costs of the next set $\{1,2,5 \}$ are:
The cost of adding $1 + 2$ (with cost $3$), plus the cost of $3 + 5$ (with cost $8$). The overall cost is $11$.
The cost ... |
What is the time complexity of computing $AA^T$? The context is building a co-citation weighted adjacency matrix.
|
I am studying Computation complexity using Papadimitrious's book: "Computational Complexity".
I am trying to do Problem 7.4.4:
"Let $C$ be a class of functions from nonnegative integers to nonnegative integers. We say that $C$ is closed under left polynomial composition if $f(n) \in C$ implies $p(f(n))=O(g(n))$ for so... |
I'm a first year MS:CS student, and my data structures class has inspired me to research file systems and their implementations. I recall using ext2, then ReiserFS, then ext3, then ext4, and now btrfs seems like the new thing. I understand (more or less) what changed from each of these, and their relative improvement... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.