instruction stringlengths 35 29.1k |
|---|
I tried to show the following language is DCFL (Deterministic Context-Free Language):
$$L=\{wo^n\mid w\in\{a,b\}^*, n_a(w)=n_b(w)=n, |w|=2n\}$$
I tried to show that $L$ has a DPDA (Deterministic Push-Down Automota), but I get stuck to find a DPDA for $L$.
|
Given are $n$ integer numbers in the range $0$ to $5n$.
A SubSort algorithm organizes the numbers into $k=n/100$ sets,
$s_{1}$, …, $s_{k}$ , each containing $100$ numbers, such that the
following conditions hold:
i. In each set, $_{}$, the 100 numbers are not necessarily sorted.
ii. All numbers in set $_{}$ are smalle... |
Integer Multiplication: $x$ and $y$ are two n-bit integers, where $n=3^k$ for some $k>0$. We break $x$ into three parts $a$, $b$, $c$, each with $n/3$ bits; and $y$ into three parts $d$, $e$, $f$, each with $n/3$ bits. The multiplication is:
$$xy = ad \cdot 2^\frac{4n}{3} + (ae + bd) \cdot 2^n + (af + cd + be) \cdot 2... |
Suppose
$$L=\{wo^n\mid w\in\{a,b\}^*, n_a(w)=n \text{ or} |w|=n\}$$
Can we conclude that $L$ is DCFl?
I think it's DCFL because
$$L=\{a^no^n\}\cup \{\{a,b\}^no^n\}$$
Since
$$\{a^no^n\}\subseteq \{\{a,b\}^no^n\}$$
We can coclude that $L$ is DCFL. Becuase
$$L= \{\{a,b\}^no^n\}$$
But i think my argument, maybe isn't true,... |
The question is:
A given graph is given with only weights 1 or 2 on its arcs. (I.e. each arc has a weight of 1 or a weight of 2)
And a origin vertex s.
Write an efficient algorithm that finds the shortest paths (most easy in weight that is) from s to the rest of the vertices.
I really don't have a better idea than pe... |
Consider the following algorithm for bin packing:
Initially, sort the items by their size.
Put the largest item in a new bin.
Fill the bin with small items in ascending order of size, up to the largest item that fits.
Close the bin. If some items remain, go back to step 1.
There is a very similar algorithm for the du... |
I would like to brainstorm/get some advice/tips regarding the following question. Given an array,you can either insert elements or you can delete elements from it.Note the insertion/deletion must be done in such a way so that in the end,for any element X in the array,X occurs X times. The objective is to find the minim... |
Specifically, what NP-hard problem can we reduce (the decisions version of) GAP to and how do we prove its correctness?
The decision version of the generalized assignment problem is to determine whether there exists an assignment where every job is fulfilled (as opposed to maximizing the number of jobs that can be fulf... |
There is a lot of Turing machine out there. Most of them are purpose-specific.
What make universal Turing machine universal?
How do we know or prove if a computer is universal?
Edited:
Is programmability of universal Turing machine the key to be universal?
|
I'm writing some software that involves processing a large collection of images that are arranged spatially. It basically involves loading pairs of images into caches and computing an operation on the pairs. I'm neglecting the cost of computation as it can't be avoided, but loading into the caches from network/disk doe... |
Shorter version of my question:
Is there any polygon union algorithm that allows me to change one of the polygons quickly?
Longer version:
Currently the major performance bottleneck I'm facing in one of my own project is to quickly compute the union of multiple polygons. I've been using the polybooljs library, which is... |
Assume that we have a set of nodes and multiple graphs with different edge values for the same set of nodes. As an example, there are 4 nodes A, B, C and D. And we have 3 graphs named GRAPH_1, GRAPH_2 and GRAPH_3 as shown in the figure below.
From using any number of graphs I need to find the shortest path between two... |
I have been reading the proof in the following paper, and I am unable to understand some parts in the proof. This paper shows that a distribution $A$ over $[n]\times[m]$, $n\geq m$, can be $\epsilon$-tested for independence with just $\tilde{O}(n^{2/3}m^{1/3}\mathrm{poly}(\epsilon^{-1}))$ samples. As part of their tech... |
Suppose given a square on plane, the location of side left-down part is on coordinate(0,0) and right-top part on coordinate (10,10). Now there are points on coordinates $$S=\{(9,4),(5,8),(4,3),(1,7)\}.$$
Now we want move from (0,0) to (10,10) in any direction that remain inside the square, such that on moving from sta... |
Is the following equivalence true?
$$(r_1^*r_2^*)^* = (r_1 + r_2)^*$$
I think these are equivalent since both the expressions generate the same strings: $\{\epsilon,r_1,r_2,\dots\}$ etc.
|
Suppose given a graph $G(V,E)$ that we want to count the number of pair of vertices that have common neighbor.
I think for any pair in $\binom{|V|}{2}$ we must check its neighbor that is common or not. So the running time is $O(V^3)$ in complete graphs.
My question is, are there simpler algorithm that run in $o(|V|^3)... |
I have 2 3D surface meshes. These meshes have vertex-correspondence and have the same topology (same edges and triangles connecting the vertices). However, the vertex positions (3d coordinates) are different - that is, the meshes are a vertex deformation of each other. They are pose 1 and pose 2 of the same surface mes... |
Given a DAG $G=(V,E)$ and a weights function on the vertices $w:V \to \mathbb{R}$, suggest an algorithm that computes for every $v \in V$ the sum of the weights of vertices that are reachable from it.
My idea is to use topological sort on the graph and then start from the end to the start, and for each vertex $v \in ... |
What does $k \ln(k) = \Theta(n)$ mean? Does it mean that $k$ is a function of $n$ and we actually had better write $k(n)\ln(k(n)) = \Theta(n)$?
|
Suppose given an un-directed graph $G$, such that bridge edge of $G$ has negative weight.
From Wikipedia:
In graph theory, a bridge, isthmus, cut-edge, or cut arc is an edge of a graph whose deletion increases the graph's number of connected components.
Now there is a claim:
The Dijkstra find correct shortest simpl... |
Can someone recommend a reference/textbook on the RAM model of computation? Preferably something with a concise definition and doesn't get too much into computer architecture. I'm very fine with this is the RAM model this is how much time space,... accept it.
There seems to be some inconsistency as to whether or not th... |
I was trying to implement bubble sort in python, but turns out it's not bubble sort, it's faster than bubble sort. Can somebody please enlighten on me what sorting algorithm I implemented?
def not_bubble_sort(data, n):
for i in range(n):
for j in range(i+1, n):
#swap
if data[i] > data[j]... |
Since the Y combinator itself is a function (albeit a higher-order one), I was wondering what the fixed-points of Y itself are.
|
More often than not, most programming problem can be solved in more than 1 way. You see this in website for practicing solving coding challenges where you often have myriad of solutions to the same problem.
My question is, do all these myriad solution all turn to the same AST in the language used? For example if I have... |
I have a set $S$, which contains $n$ real numbers, which generically are all different. Now suppose I know all the sums of its subsets, can I recover the original set $S$?
I have $2^n $ data. This is far more than $n$, the number of unknowns.
|
I do not have a formal computer science background here so I am looking for pointers.
How would you advice I go about describing a formal way to describe procedures like cooking recipes, manufacturing process, driving to a location etc.
Given the fact that these types of process does feel like algorithms, but they feel... |
Say you have the finite alphabet {a,b,c,d,e,f,g}. It's trivial to enumerate all strings of length <= 1000 over that set.
But what would be an efficient way of specifying a subset of those strings that include "e" at least once?
The obvious and least efficient way is to enumerate all strings and discard the ones that do... |
Consider an approximation algorithm which does better than $f(n)$, in expectation. Suppose we know that $\mathbb{E}(OPT)=g(n)$.
Given that we use the convention of "larger divided by smaller" for approximation ratios, can we say that the "expected approximation ratio" is better than $g(n)/f(n)$?
The other possibility i... |
Referential transparency is a relatively new concept to me, but I understood that it means that a function will always give the same answer given the same arguments.
Would passing arguments by reference break this property somehow in a functional language?
|
I am looking for any literature or reference for the worst case complexity of using quicksort on a sorted array with median as pivot. Different internet sources give conflicting answers and often skip this exact question or don't give logic for their answer
Can someone explain whether is it O(nlogn) or O(n^2) and why s... |
How can create a Turing machine that checks whether or not an input string is a well-defined regular expression? For example, it recognizes a language that consists of string over {0,1} and the symbols used to write down REs (U,*,+, ...)
|
An event that occurs with high probability is one whose probability depends on a certain number $n$ and goes to $1$ as $n$ goes to infinity, i.e. it can be made as close as desired to $1$ by making $n$ big enough.
I often see that authors tend to try to prove an event $A$ happens with high probability by showing that $... |
AlphaZero is a computer program that was originally built to master the games of chess, shogi and go. It was trained solely via "self-play", in parallel, with no access to opening books or endgame tables.
The Amazon.com e-commerce system identifies users of similar tastes in terms of their profiles and shopping orders.... |
I often hear Turing machine is a mathematical model of computation. Sometimes, it's said to embody any computer program. Sometimes, it's said to be an idealised computing device consisting of a read/write head.
But is it a theoretical model for hardware or a theoretical model for software?
|
suppose you have graph G and you want to remove node n and n and all of his children but keep the ones that are connected to other nodes
if i want to delete A it will delete C but not D becase its connected to B.
and if i want to delete D then E will not be deleted because it is connected to A
is there
|
We can interpret $f(n) + o(f(n)) = \Theta(f(n))$ as for any $g(n) \in o(f(n))$ there exists some $h(n) \in \Theta(f(n))$ such that $f(n) + g(n) = h(n)$. But can we perceive it as for any $g(n) \in \Theta(f(n))$ there exists some $h(n) \in o(f(n))$ such that $f(n) + h(n) = g(n)$? If yes how do you prove this second rela... |
I was solving the following question:
Show that $L_1 \cap L_2 \in \mathrm{NP}$ for $L_1,L_2 \in \mathrm{NP}$.
I came a cross this solution on the internet which is:
$M$: On input $w$ —
Run $M_1$ on $w$; if $M_1$ rejects then REJECT
Else run $M_2$ on $w$; if $M_2$ rejects then REJECT
Else ACCEPT
But is it the proo... |
I have come up with a relaxation-free variant of Dijkstra's shortest path algorithm, and I would like to see if it's correct. Here is the pseudocode for finding the shortest distance from a node $\alpha$ to another node $\beta$.
Initialize an empty priority queue $Q$ and an empty hash map $H$.
Add $\alpha$ to $Q$ with... |
While reading a book on computer organization, I ran into a design principle stating that "smaller is faster", indicating that fewer registers means less clock cycle time. Could you prove why?
|
There are certain points about the halting problem that do not make sense to me. I couldn't seem to find a good breakdown of it that addresses my notes below. I was wondering if someone could clarify or correct my understanding of it.
To start, every version of the proof I have heard seems vague on how it defines the... |
When my instructor taught compiler construction he explained all the phases of compiler and their working nicely. But when I read online here, at last line it is written that
Parse trees are not always produced.
So, what does it mean? I thought parse trees are always produced after lexical analysis part. Is there any... |
How would you describe the runtime complexity if I have an algorithm that at each step, the size of the array reduced by an exponentially-increasing amount?
For example, for each step in the algorithm, it is actually processing n - 2^k items, where k is the number of steps it has run so far. So for the first step, we p... |
I am working on a problem which is related to The processor. The problem is the problem 4.12 in the book whose title is "Computer Organization and Design". The problem has the assumption as follow:
Here is an image Figure 4.45
And the question number 3 makes me stuck on it
The answer for this problem is MEM/WB has f... |
Which of these is true or false.
1)If Control Flow graph(CFG) doesn't contain any loop, the program will never go into infinite loop.
2)If CFG contains loop, the program may or may not go into infinite loop.
Another question:-
3)Checking for infnite loop in a program is equivalent to checking for halting ability of tur... |
Full disclosure, I'm asking this after watching a couple pop science videos; I do not know anything about the actual physics and hardware. I suspect the presenters expected an audience like me because they explained irreversibility at the level of a programming language ( irreversible_add(a, b) = a+b erases information... |
I am trying to figure out on how to approach the problem on finding proving the asymptotic of an exponential recurrence. It is described as such:
t(n)=4t(n/2)+2^n with t(1)=1 for n>=5
From what I know, the recurrence should lay in Θ(2^n).
My own attempts:
Usually I would approach this problem via master-theorem case... |
Need some guidance on where to begin. I am just learning python if it has any bearing.
I want to create a page on my site where users log in, choose multiple topics from a list, choose between levels of difficulty, choose whether or not to be timed, and then be presented with random multiple choice questions on the to... |
Wondering what are the real word applications of the Complete binary trees or Almost complete binary trees where the the last level of the tree may not be complete and all nodes in the last level are aligned to the left.
|
Suppose there is a language L∈NP, that is not NP-Complete and L≠∅ and L≠Σ∗. Which of the following statements can we infer from this?
P = NP
P ⊊ NP
P ≠ NP
NP ⊆ P
|
Why is a game like Tic-Tac-Toe in PSPACE? For example for a nxn grid you have nxn! possible game tree paths (duplicates and illegal moves aside), then don't you need (n^2)! memory slots?
|
The title explains the question easily. Also the radius of the circle is always an integer. The naive algorithm I thought was to check each and every lattice point of the rectangle but I wonder if we can solve it in less time complexity.
Here the lattice point means the simple integer point in 2D geometry plane
|
I'm confused to if there exists an algorithm that can solve the below maximum independent set in polynomial time where it is parameterized by a k value.
maximum independent set
Input: A graph G with weight and a positive integer K
Output: A safe set of maximum total value that uses at most k integers
say I have these p... |
Consider a Boolean Circuit $C$ which takes $n$ inputs and has one output. Notation: Let $\textit{size}(C)$ be the size of circuit $C$: the total number of gates in $C$. Let $G = (V,\Sigma,R,S)$ be a context-free grammar where $V$ is the set of non-terminals. Circuit-Value is the circuit value problem, and CFGM is the c... |
How should one go about this kind of problems? I'm supposed to use a graph structure for this.
Say I have a file containing a couple of courses with their prerequisites.
I have to organize the semester with courses while respecting prerequisites and the max number of courses per semester. The first semester should be f... |
Firstly I don't have CS or DFA/NFA background knowledge about their theorems or lemmas, so I don't understand some related questions' answers like here. However, I can easily intuitively understand a language $L\subseteq\{0,1\}^*$ of strings which has equal number of 0s and 1s cannot be accepted by a FA thus non-regula... |
What is the VC Dimension of the class of $k$-dimensional cross-polytope (1-norm ($l_1$) balls)?
A $k$-dimensional $l_1$ ball with radius $r\in \mathcal R$ and center $\mathbb v\in \mathcal R^k$ is
$\{\mathbb x\in\mathcal R^k: ||\mathbb x-\mathbb v||_1\le r\}$.
Namely, denote $\mathbb x = [x_1,x_2,...,x_k]$ and $\mathbb... |
In coding competitions I usually see problems that involve dealing with values in given ranges. A typical example is, given a list of 3-tuples defined as so
3-tuple = (Left bound of interval, Right bound of interval, Value on this interval)
Now these intervals can be overlapping so we can have something like
list = [(... |
Given a graph G, we say C a cycle of G such that however we take two nodes a and b of C, there is NOT a path between a and b in G\edges(C) (that is the graph G less the edges of C).
Is C a minimal cycle of G? If it's not, what is the name of such a cycle?
|
i want to learn about the structure of a .blk file but the problem is I don't know where to look for detailed information of this sort, most of the google searches I made gave me links to viewers.
|
Given $\sigma_1 \dots \sigma_n$ a sequence or word of length $n$ over $\{0,1\}$ I was wondering if there is a computable function to calculate $\sigma_m$ in $\log(P(n))$ time where $P(n)$ is some polynomial of degree $Q(n)$ for some other polynomial $Q$ and with $\log(P(n))$ space with regard to some global endocing us... |
I am learning some basics in computer. In that in ASCII I read if 65 is A .
When we pressing key A what is happening next? Is the electric signal is passing as on & off & reaching to decimal part 65 (or) directly converted to binary?
If it is reaching 65 then which location character map (or) encoding is available?
P... |
Suppose there exist deterministic turing machine $M$ that could solve SAT in polynomial time. How can we construct a deterministic TM $N$ ,by using SAT solver $M$, that take as input a non-deterministic TM for language $L$ and output a deterministic TM for $L$.
I know we can convert NTM to TM but im looking for a way w... |
The following is exercise 3.8 from the first edition of Mitzenmacher and Upfal's Probability and Computing: Randomized Algorithms and Probabilistic Analysis.
Suppose that we have an algorithm that takes as input a string of $n$
bits. We are told that the expected running time is $O(n^2)$ if the
input bits are chosen i... |
int *numPtr;
double num;
numPtr = #
This code shows an error as pointer points to data of different datatype. But why does it show the error? Why doesn't the compiler typecast the pointer and remove the error?
Just like a character becomes an integer as it is implicitly typecasted. (int a = 'a';) It should do simi... |
It is known that the computational complexity of deciding whether an LTL specification is realizable in a safety game is 2EXP-complete (that is, you receive an LTL formula, where some variables belong to the environment and some to the system, and you ask if it's possible for the system to always satisfy the specificat... |
Here's a problem of CLRS:
Use the following ideas to develop a nonrecursive, linear-time algorithm for the maximum-subarray problem. Start at the left end of the array, and progress toward the right, keeping track of the maximum subarray seen so far. Knowing a maximum subarray of $A[1..j]$, extend the answer to find a ... |
This is a problem of CLRS:
What is the largest $k$ such that if you can multiply $3 \times 3$ matrices using $k$ multiplications (not assuming commutativity of multiplication), then you can multiply
$n \times n$ matrices in time $o(n^{log(7)})$? What would the running time of this algorithm be?
Solution:
We assume that... |
I was reading about the halting problem recently, but I couldn't quite figure something out. We take $H(x,y)$ to be a program which works out if program $x$ with input $y$ halts, and $H_2(x,y)$ to be a program which works out $H(x,y)$ and then does the opposite (if $x$ halts, $H_2$ loops, else $H_2$ ends). The halting ... |
If instead of saying there exists some $C \in \mathbb{R}^{+}$ and $N \in \mathbb{N}$ such that for any $n \geq N$ we have $f(n) \leq Cg(n)$ we say that there is some $C \in \mathbb{R}^{+}$ and
some subsequence $(f(n_{k}))_{k \in \mathbb{N}}$ with $(n_{k})_{k \in \mathbb{N}}$ strictly increasing such that for any $k \in... |
Can anyone give an intuitive explanation to why IP = PSPACE, or at least one direction of it?
I looked at many research papers but its very hard to understand the formalism unless you have a solid background in Turing machines and complexity theory. I'm an undergraduate.
|
I would like to prove that the grammar $G$ with the rules
$$
S \to SS \mid aSb \mid bSa \mid a \mid \varepsilon
$$
generates the language $L = \{w \mid \text{$w$ has at least as many $a$'s as $b$'s}\}$.
Question
My proof is below, but it feels rather clunky and unintuitive. Does anyone have an alternative proof and/or ... |
I was trying to get started with a small project but I quickly realized I had to do more research on the subject.
Suppose, when creating a site, in production, there's a certain structure how the backend and front end are maintained for scalability. Suppose, you're node application is containerized, deployed inside a E... |
I am reading Nancy Lynch's Distributed Algorithms.
In page 103, there is the FloodSet algorithm.
Can anyone please explain what Uj mean in W := W U Uj xj (line 3 of transition function)?
|
What is an example of an algorithm that requires synchronised clocks? Synchronised in an absolute sense, not just synchronised clock rates.
For more background, I've read Barbra Lisksov's 1993 paper 'Practical Uses of Synchronized Clocks in Distributed Systems' and also some content on Cloud Spanner and TrueTime. I'm... |
I have encountered a structure that looks like a monad with a one-sided inverse and some additional properties. I am not sure which properties of this structure are essential and which are accidental, so I will follow a simple example in my description.
I have a base type a which consists of sorted strings (e.g "aacdee... |
I have been wondering about the following question for quite some time:
You are given an array $x$. Define f(x) as the prefix sums of this array.
For example, f([1,0,1]) = [1,1,2] and f(f([1,0,1])) = [1,2,4].
Define $k$ to be the recursive depths of a series of f(x) (how many times it is nested).
For example, f(f(x)) h... |
I have a sparse $60000\times10000$ matrix where each element is either a $1$ or $0$ as follows.
$$M=\begin{bmatrix}1 & 0 & 1 & \cdots & 1 \\1 & 1 & 0 & \cdots & 1 \\0 & 1 & 0 & \cdots & 1 \\\vdots & \vdots & \vdots & \ddots & \vdots \\0 & 0 & 0 & \cdots & 0 \end{bmatrix}$$
Each row represents a different point in time ... |
I have a sparse $60000\times10000$ matrix where each element is either a $1$ or $0$ as follows.
$$M=\begin{bmatrix}1 & 0 & 1 & \cdots & 1 \\1 & 1 & 0 & \cdots & 1 \\0 & 1 & 0 & \cdots & 1 \\\vdots & \vdots & \vdots & \ddots & \vdots \\0 & 0 & 0 & \cdots & 0 \end{bmatrix}$$
Each row represents a different point in time ... |
My notes on P vs NP say the following:
Every problem x in the NP-hard class has the following properties:
– There is no known polynomial-time algorithm for x.
– The only known algorithms take exponential time.
– If you could solve x in polynomial-time, then you could solve them all in polynomial-time.
The last point ... |
In Sipser's Introduction to the Theory of Computation, the author explains that two strings can be compared by “zigzagging” back and forth between them and “crossing off” one symbol at a time (i.e., replacing them with a symbol such as $x$). This process is displayed in the following figure (from Sipser):
However, thi... |
I've read through a few definitions of a partially observable environment/MDP, and I need confirmation whether the partial observability is really a generalization of a MDP (misnomer) and not a required feature, just like when we call nondeterministic automata the union of a) deterministic automata and b) (what I like ... |
(moved from stackoverflow to here)
I'm trying to understand dataflow stuff for program analysis. Transfer functions move lattice elements up (towards top ⊤) and down (towards bottom ⊥). Sometimes the direction confuses me a bit (I'd do it in the other direction), so
do the top and bottom elements of a lattice have any... |
If a Turing machine halts for all rejects of L but might accept/loop otherwise, how is L's recognizability classified?
Recognizability
Decidability
${\langle L\rangle}$
${\langle \overline{L}\rangle}$
Turing-Unrecognizable
Undecidable
loop or reject
loop or reject
Turing-Recognizable
Undecidable
accept
reject... |
I read this site example 12 that {${xww|x,w∈(a+b)^*}$} the set of strings generated by language $L$ is {${ϵ,a,b,aa,ab,ba,bb,aaa,…}$} by taking always $w$ as $\epsilon$ and $x$∈$(a+b)^∗$. But my question is why they taking always $w$ as $\epsilon$ to prove it is regular. In that same logic why $ww$ isn't regular by t... |
I currently have an algorithm that uses brute force/exhaustive search to find all of the cliques of size exactly k in a graph G.
My algorithm is as follows:
Generate all subgraphs of size k, and check each one to determine if it is a valid clique.
I'm trying to find the time complexity of my algorithm, but I'm stuck on... |
I have noted that in several very unrelated human natural languages, people often confuse the term "virtual" with "digital".
As for Computer Science, is it correct to categorize all software whatsoever to "digital" or "analogue" (by means of how programs work)?
|
Shor's algorithm uses the Quantum Fourier Transform to find the period the function a^x mod N with "a" being a constant integer less than N and N being a semiprime. This function is periodic and has both a domain and image of all integers from 2 to N.
What is the fastest classical algorithm that could be used in place ... |
Union of two REL is closed under union. I don't understand how is it closed. I followed this link. The have stated:
Here the trick is to simulate both M1 and M2 “simultaneously”. In other words, we
design a machine that executes one step of M1, followed by one step of M2, then again
one step of M1 and so on.
My quest... |
If a primary server's UTC source fails, then it can become a stratum 2 secondary server. If a secondary server's normal source of synchronization fails or becomes unreachable, then it may synchronize with another server.
I have made a picture based on what I understood. I don't understand how will synchronization be ... |
I saw two different definitions of time constructible functions.
In Sipser (third edt), Definition 9.8, defines $t(n)$ is time constructible if $t(n)\geq O(n \log n)$ and maps $1^n$ to the binary representation of $t(n)$ in time $O(t(n))$.
In arora, there is a lower bound $t(n) \geq n$ instead of $t(n) \geq O(n \log n)... |
Notation:
Let $t$ and $u$ be terms in the $\lambda$-calculus, and $x$ be a variable name.
Let $[x\mapsto u]t$ be the substitution in $t$ of free variable $x$ for the term $u$. Specifically, I'm using the algorithm given in Functional Pearls: α-conversion is easy.
Let $t^\phi$ be the de Bruijn index–representation of... |
How to notice the type of algorithm whether it is polynomial or fully polynomial time approximation from the resulting running time ( execution time) of the program?
Is there any other way to decide?
|
I ran into this problem while trying to create a procedural texture algorithm. I ended up using a greedy approximation and shuffling it to hide the bias, but I was wondering if there was a way to find a uniform solution.
The Problem
Divide a wall of a height $H$ into a layers whose individual sizes range from $L_{min}$... |
I have a confusion on understanding the relation between:
The input n
,The relative error and
The running time of the program In both PTAS and FPTAS.
In "The running time of PTAS must be polynomial in terms of n, however, it can be exponential in terms of ε.
In PTAS algorithms, the exponent of the polynomial can increa... |
I have asked 1 type of question but I have asked that in many questions. So bear with me. My question is about 1 topic, I just didn't find it right to create separate questions for each of these questions so I am asking like this-:
The Lamport logical clock algorithm is-:
at pi : before each event Li= Li + 1
when pi ... |
$G$ is a strongly connected graph with nodes $V$ and edges $E$. Each node $v_i$ receives a sample $x_i$ from a Gaussian $\mathcal{N}(\mu,\sigma^2)$ with unknown mean and variance.
The objective is for all nodes in the graph to find Maximum Likelihood estimates for $\mu$ and $\sigma^2$. To do this, nodes are allowed to ... |
Is there a class of recurrence relations that can't be solved using the substitution method? Let me explain the motivation behind this question by an example.
Consider the recurrence relation $T(n) = 2T(n/2) + n$. It's obvious that $T$ is in $\Theta(n \log n)$.
To verify that $T(n)$ is in $O(n\log n)$, one could use th... |
I've been able to form a recurrence relation with memoization in a recursive approach for most problems but the online coding rounds exceed the time limit or stack overflow occurs in all these problems. An iterative approach seems to be the only way out. But coming up with logic for filling the DP table is frustrating ... |
Calculating the factorial n! by the algorithm that defines it is of O(n) complexity because it requires n-1 multiplications to find the solution. Is there an algorithm that is any faster than that?
|
I’m having trouble coming up with a good adversary strategy for this problem:
Input: a graph G
Output: the maximum size of any clique in G
Where the algorithm asks each time, “are vertices x and y adjacent?” and it could ask about any random pair of vertices in the graph.
So, I need an adversary strategy to force the a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.