instruction stringlengths 35 29.1k |
|---|
I saw a joke on twitter today that got me thinking on how to perform a time complexity analysis of this algorithm such as you can express that the worst case is dependent on the input value in addition to the input size.
The joke algorithm was this sleep sort algorithm in javascript
const arr = [20, 5, 100, 1, 90, 200,... |
Problem:
Suppose the running time of a certain algorithm is $O(n \ln n)$. We happens to the running
time of the algorithm if $n$ doubles.
Answer:
Let $R_1$ be the running time of the algorithm when the input is of size $n$. Let $R_2$ be the running time of the algorithm when the input is of size $2n$. Let $R = R_2 / R_... |
$f(x_1,...,x_m)=\min_{\emptyset\subset I\subseteq[m] }\left|\sum_{i\in I}x_i\right|, x_i\in \mathbb{Z}\setminus\{0\}$
How to prove $f\in \mathbf{POLY} \Leftrightarrow \mathbf{P}=\mathbf{NP}$?
When $\mathbf{POLY}\overset{\Delta}{=}\{ f:\{0,1\}^*\rightarrow \{0,1, \}^* |$ exists polynomial TM which competes $f \}$
|
Right now I am stuck with the problem, how all shortest path trees can be created in O(n*m) given G = (V,E,c) with negative and positive costs without negative cycles and n =|V| m = |E| after execution of Floyd Warshall. We were asked to think about why this is not $O(n(n+m))$ and for which graphs we really would have ... |
(this is a cross-post from mathoverflow)
Assume I have an undirected edge-weighted complete graph $G$ of $N$ nodes (every node is connected to every other node, and each edge has an associated weight). Assume that each node has a unique identifier.
Let's say I then have an input, $c$ of three edges (e.g $c=[4,7,6]$).
D... |
I am working through a problem in which I have to prove that a particular $f(n) = \Theta(g(n))$. I know that for this to be true there need to exist positive constants $c_1$, $c_2$, and $n_0$ such that for all $n \geq n_0$, $c_1g(n)\leq f(n) \leq c_2g(n)$. Simply put, the goal is to pick values for the constants such t... |
The problem:
There are $N$ houses for sale. The $i$-th house costs $A_i$ dollars to buy.
You have a budget of $B$ dollars to spend.
What is the maximum number of houses you can buy?
There is an intuitive way to solve this problem in a greedy way: we must at first sort the house costs and then buy houses until we are ... |
In Sipser's Introduction to the Theory of Computation, the provided proof for the union operation being closed for regular languages has a step for the transition function that I find a bit lacking.
Assuming that $M_1=(Q_1, \Sigma, \delta_1, q_1, F_1)$ and $M_2=(Q_2, \Sigma, \delta_2, q_2, F_2)$ are two different FSMs... |
Recently I thought of an algorithm for multiplication and decided to stop dreaming and start writing on paper my ideas, and even implement this to code (in this case - Python 3.9.1).
I do not know if it resembles Karatsuba's algorithm, but I glanced at it and it seems to work very differently.
The idea behind this mul... |
In CLRS, exercise 4.4-5 the following question is asked:
Use a recursion tree to determine a good asymptotic upper bound on the recurrence $$T(n) = T(n-1) + T(n/2) + n$$
In my recursion tree, the sum of level 0 is $$n$$ level 1 is $$(3/2)n - 2/2^1$$ level 2 $$(3/2)^2n-14/2^2$$ level 3 is $$(3/2)^3n - 74/2^3$$
and so ... |
I am currently studying the roofline model. Wikipedia [2] shows the following example graph:
The diagonal line shows $\beta * I$. But I do not understand why this line does not go through the zero point. If $I = 0$ so should $\beta * I = 0$. What am I misunderstanding here?
[2] https://en.wikipedia.org/wiki/Roofline_m... |
I was given this problem in class, and I have no idea how to solve it. The problem is:
"Given a list of positive integers, divide the numbers into 2 groups such that the difference between the sum of each group is minimal, print that difference. The algorithm must be efficient."
I guess by efficient they mean do not ... |
I have been give a page table logical address of 0011 0110 1010 1010 and have been told that there are 512 entries into this page table in which the frame number is two times smaller that the page number.
I have looked at previous posts but I am still not understanding what steps I must do in order to translate this lo... |
I am looking for a technique or an algorithm that outputs a unique number/vector for each pixel of the image. I want to give the pixel a perspective so the neighboring pixels have more visibility and the farther away pixel have less visibility. Imagine if someone walks on the pixels, he sees different patterns, and I w... |
I came across the chalk-and-string labyrinth analogy for depth-first search in Algorithms by Dasgupta et al. I have seen the code for the depth first search.
Everybody knows that all you need to explore a labyrinth is a ball of string and a piece of chalk. The chalk prevents looping, by marking the junctions you have... |
After looking at Can a computer determine whether a mathematical statement is true or not? for a while, I worry we may be into incompleteness/halting problem territory with this question, so an answer on that front, while disappointing, would also be acceptable
I've been interested by ADT equations since I read the lin... |
Suppose that we have two sums:
a1+a2+...+an,
b1+b2+...+bm
We can perform only two binary operations on operands of these sums:
lt (less than)
eq (equal)
These operations can return 3 possible results: true, false, unknown. Other operations like summation, subtraction and etc. are not allowed.
The question is how to i... |
Is it known that "For each problem in NP there is a randomized algorithm that solves it in polynomial time"? If not true then is there any proof of that. Or does it belongs to the unknown domain?
|
Is there a Turing machine such that, given a description $\langle M \rangle$ of a Turing machine $M$, an input $x$ and a string $y$, computes whether or not $y$ is the output of $M$ input $x$?
My guess is that the answer is no because this might imply that the set of strings with Kolmogorov complexity greater than or e... |
I just watched this explanation of zero-knowledge proofs with Avi Wigderson: https://www.youtube.com/watch?v=5ovdoxnfFV
Key claims from the video:
Every formal statement can be translated into a map in a way that preserves truth. If a statement is true, its map will be 3-colorable. If not, it isn't 3-colorable https:/... |
I'm reading Computational Complexity by Arora and Barak and I had a doubt regarding a statement made about the equivalence of Turing machines:
For every $f\colon \{0, 1\}^∗ → \{0, 1\}$ and time-constructible $T\colon \mathbb N → \mathbb N$, if $f$ is computable in time $T (n)$
by a Turing machine $M$ using alphabet $\... |
This references the multiplication algorithm in Chapter 1 of Algorithms by Dasgupta et al.
I am trying to understand how the code for multiplication à la française works from the multiplication by hand. This is the example given.
This is the code given for it.
I went ahead and did multiplication of $13 \times 11$ (od... |
Given the Language $COMBI := \{\langle G,k \rangle | G$ has Clique $\geq k$ or Independent Set $\geq k\}$. Proof that Combi is NP-complete.
I tried to reduce Clique <=p Combi. I had two different ideas:
Let $f(\langle G,k\rangle) = \langle G,k\rangle$ so $\langle G,k\rangle \in$ CLIQUE $\Rightarrow f(\langle G,k\ra... |
I'm not sure whether the distinction between decision and search problems has a deeper significance or if it is just concerns the immediate answer to the problem.
Of course, if you have a finite solution space then you can easily turn a search problem into a decision problem by assigning a 'yes' to whichever output sat... |
PCB structure exists inside kernel area. And in ready queue, which is Linked List, each Node of the queue is PCB.
And this mean PCB Node has the next address of PCB in the queue, right?? Then My question is this..
Does PCB structure has pointer field that has address of next PCB structure??
According to Wikipedia, Jo... |
I'm learning programming, Python 3 in particular, and I have a good book "Beginning Python - From Novice to Professional" by Magnus Lie Hetland, but the book doesn't explain algorithms at all, and I'm having truoble understanding some codes which include recursion since I'm new to 'CS-style' programming, I have moderat... |
I'm reading The Algorithm Design Manual and I stumbled upon this problem.
I can't really get my head around this, I don't even know how the number of multiplications could differ, what I mean is that there is no polynomial that would make this algorithm perform poorly.
I also have no idea how this could get improved, e... |
I know that SAT can be reduced to (3 vertex) Graph colouring, and there is a Zero-knowlegde protocol (ZKP) for graph colouring. However, I am interested in a ZKP that can be performed directly on a SAT instance, without graph colouring.
Is there a known ZKP for SAT, and if not how would you suggest coming up with one?
|
Suppose that $A$ and $B$ are languages such that $A\leq_P B$ (many-to-one Karp reduction), and $B\in \mathbf{P/poly}$. How do we prove that $A\in\mathbf{P/poly}$?
Using similar ideas like Cook-Levin (or $P\subseteq \mathbf{P/poly}$), I can show that given $x\in\{0,1\}^n$, there exists a (easily computable) poly-sized c... |
def RecFunc(n):
if n <= 3:
return 1
return RecFunc( RecFunc(n/3) + RecFunc(n/2) + RecFunc(n/2) )
How should I start if it is nested inside? I know how to solve it without the outer RecFunc (with a recursive tree I assume) - But here there is an outer RecFunc and I don't know what to do!
Thanks to Steven... |
I wanted to test the feasibility of an idea that might be part of a small project, and I'm trying to set up a quick prototype using Python (with bindings to a C library). If any of this is sufficient for any interesting application, I might make this the main topic of my thesis.
I was able to plot how much memory this ... |
In the slides of a university lecture, the following phrase got my attention.
Assuming 10GB network, it takes 2 hours to copy 1TB.
My calculation was as follows.
10GB network = 10 gigabits per second network = 10 x 10^9 bits per
second ------> (1)
1TB = 10^3 x 10^9 x 8 bits --------------> (2)
Then the time to copy ... |
Let $\chi_S: \mathbb{F}_2^n \to \{\pm 1\}, x \mapsto (-1)^{\sum_{i \in S}x_i}$ for every $S \subseteq [n]$ denote the parity functions from $\mathbb{F}_2^n$ to $\{\pm 1\}$. Then, of course, every $f: \mathbb{F}_2^n \to \{\pm 1\}$ can be written as a linear combination (over $\mathbb{R}$) of the parity functions. I have... |
I've built a rudimentary SAT Solver from scratch, and wanted to do the same with SMT solvers as well.
While I've found two toy SMT Solver implementations in Haskell and Ocaml, but no tutorials or examples, which is a stark contrast from all SAT Solver tutorials out there.
Is there a resource for building a toy SMT Solv... |
I was going over the proofs of the non-deterministic time hierarchy theorem (the one in Arora-Barak and the one by Fortnow and Santhanam). They are available here:
http://theory.cs.princeton.edu/complexity/book.pdf : page 67
https://blog.computationalcomplexity.org/2011/04/new-proof-of-nondeterministic-time.html
It see... |
Given a grid graph $G=(V,E)$ which has only two different integer costs/weights of 1 and 2. Find Minimum Spanning Tree in $O(|V|+|E|)$.
I tried the following:
Changing Kruskal using a counting Sort in $O(|E|)$. But can I say that this results in O(|E|+|V|)? Since Kruskal would normally be ${\displaystyle O(T_{sort}(|E... |
As I understand it, A* is a general form of Djikstra where the selection of the next node to visit can be based on something other than the actual distance. For example, with Djikstra, you'd use a priority queue ordered ascending by distance and shift off the head of the queue to decide where to visit next. But with A*... |
The reverse of a string, introduced informally above, can be defined more precisely by the recursive rules $$a^R=a,$$ $$(wa)^R=aw^R,$$ for all $a \in \Sigma$, $w \in \Sigma^*$. Use this to prove that $$(uv)^R = v^Ru^R,$$ for all $u, v \in \Sigma^+$.
This is exercise 3 (page 28) from "An Introduction to Formal Languag... |
I have the following pseudo code for a insertion sort algorithm
INSERTION-SORT
1 for j = 2 to A.length
2 key = A[j]
3 // Insert A[j] into the sorted sequence A[1..j-1]
4 i = j -1
5 while i > 0 and A[i] > key
6 A[i+1] = A[i]
7 i = i -1
8 A[i+1] = key
I am trying to convert it into execut... |
Could someone tell why "G1 and G3 are ambiguous" and how to see whether a string has at least two different left-most derivations in general?
|
I am thinking about JavaScript here, or any language that supports async IO or that sort of thing (coroutines? though don't have much experience with those).
I have looked at some of the resources below in trying to figure out how the stack works when you have async, but I don't understand it yet and don't quite follow... |
I am looking for a solution for the following problem:
Find the size of a subset of top $N$ elements, where the minimum element is at least $N$, in linear time.
Consider the following sequence:
$$
3, 1, 6, 1, 5
$$
The answer here is $3$, with $6, 5, 3$ being in the set found. The value of $N$ is not a given - we're l... |
I have a bit of problem in the question below, mainly in the case of incrementing the input size (it doesn't seem solvable to me, like, do we just write $f(n)/f(n+1)$ or...), and also the logarithm ones because I'm not really comfortable with those.
I'd appreciate it a lot if you could take the time to explain them to ... |
I was reading about online algorithms and bipartite matching.
I found an implementation that works fine on several websites (like geeksforgeeks).
For the online version, I found this paper
https://people.eecs.berkeley.edu/~vazirani/pubs/online.pdf
But there's one part that I don't understand.
In this paper, they refer ... |
What is the solution of the following recurrence?
$$
T(n) = 3T(n/2) + n^2, \quad T(1) = 0.
$$
I cannot use the master theorem since I need to know the exact final expression, not just it's big O, which I know is $O(n^2)$.
I'm stuck at the following, after 4 steps:
$$3^4T(n/2^4)+((3^6)n^2)/((2^6)2^6)+(3^3n^2)/((2^2)2^4)... |
There is a similar question already asked on this site but does not have an answer as to how the 10x was converted into 2y. I know how to convert 8.75 or 875 into IEEE representation. But what about 106? Surely there's a better way than expanding it and then converting it into binary.
|
I'm kinda confused by Asymptotics, the exercises in the book I'm reading say to prove for example $f(n) = \Omega(g(n))$, and there is something I don't understand about these kind of proofs.
Do I have to prove them algebraically or is it possible to find some constant ($c$) such that this statement holds?
For example w... |
Is there a data structure which can maintain a list of intervals and the following operations?
insert(l, r): Inserts an interval [l, r] into the list
query(l, r): Return the number of intervals in the list which are completely nested in [l, r]
I need the data structure to handle inserting and querying without brute fo... |
For network packets coming over TCP/IP protocol, have you ever confronted a situation where you need to store those network packets in tabular form similar to how tabular tables in databases? For example, keep the dst IP, dst src, TCP/UDP, payload, etc.?
If you ever find yourself in a situation where you need to store ... |
Let $\Sigma = \{a, b\}$ and $L = \{aa, bb\}$. Use set notation to describe $\overline L$.
This is exercise 6 (page 28) from "An Introduction to Formal Languages and Automata" by Peter Linz. The author provides the following answer: $\overline L = \{\lambda, a, b, ab, ba\} \cup \{ w \in \{a, b\}^+ : |w|\geq 3\}$. Mine... |
Let $L$ be any language on a nonempty alphabet. Show that $L$ and $\overline L$ cannot be both finite.
This is exercise 7 (page 28) from "An Introduction to Formal Languages and Automata" by Peter Linz.
My attempt: $L$ is a subset of $\Sigma^*$, so it can be either finite or infinite. If $L$ is finite, then $\overlin... |
Quick question on the wording of the question from CLRS Ch2 Problems. The question goes as follows:
Although merge sort runs in $\Theta(n\lg n)$ worst-case time and insertion sort runs in $\Theta(n^2)$ worst-case time, the constant factors in insertion sort can make it faster in practice for small problem sizes on man... |
Prove that $(L^R)^* = (L^*)^R$ for all languages $L$.
My attempt: Suppose $w \in (L^R)^*$. So, $w = w_1\dots w_l$, for some $w_1, \dots , w_l \in L^R$. Since $w^R \in L$, then $w^R = w_l\dots w_1$, for some $w_l, \dots , w_1 \in L^*$. Therefore, $(L^R)^* \subseteq (L^*)^R$.
Honestly, I don't know how to proceed onwar... |
how to write a program that display the total running time of a given algorithm based on different situations such as processor speed, input size, processor load, and software environment?
|
If it is known that for some optimization problem there is a greedy algorithm that solves it and the solution includes sorting of input at the preliminary stage, is it necessarily true that the problem belongs to P?
I was told it is true that problems of this type must belong to P, but I have questions about whether th... |
I was told that exponential time always beats polynomial time but doesn't this not work for:
$n^{\frac{1}{2}}$ vs $2^{\sqrt{log \,n}}$?
If we take $log_2$ on both of them we get:
$\frac{1}{2}log \,n > \sqrt{log \,n}$
which seems that what I was told is incorrect.
Did I not hear the caveats?
Have I mislabelled exponent... |
I have a hard time seeing what the alternative approach is in linearizing a directed acyclic graph (DAG). Chapter 3 of Algorithms by Dasgupta et al. states:
Property Every dag has at least one source and at least one sink.
The guaranteed existence of a source suggests an alternative approach to linearization:
Find a ... |
Is there any literature / results to which fragment of the modal mu-calculus the logic CTL corresponds? I know that in order to tranlsate the until operators of CTL, it suffices to use a single mu-operator. Does this imply that CTL coincides with the fragment of the mu-calculus containing those formulas that are built ... |
I would like to define a grammar that produces and recognizes the counting numbers of the English language. I created the production rules below based on the assumption this is context-free, but I am not entirely sure thats the case. Is this a context-free or context-sensitive grammar? If context-free, do my product... |
I am not quite sure, whether automata can construct languages over their types. For example, a Push down automaton can construct a language of type 2 - does that mean that a PDA also can construct a language of type 3? The same for turing machine?
|
Hey guys I am having trouble generating strings from this language, I haven't seen a grammar that looks like this and can't figure how to generate strings from this grammar, is this Context Sensitive grammar? Thank you.
$G=(\{S, L_x,R_x,W_x \},\{a,b\},P,S) \\
P = \{
\\S \to \lambda \mid L_x R_x, \\
L_x \to x \mid L_x... |
I was reading about paging in OS , and one of the things I saw was the page table base register (PTBR).
If the CPU generates a logical address (Consists of Page number + Offset) it needs to be mapped to Physical address (Consists of Frame number + Offset).
In the mapping process there must be first a lookup in the Page... |
The is an improvement to the X3SAT solver I described in What is wrong with this simple proof of P=NP? I have fixed the flaw found in that solver. Now, I want to know how often the solver described below will backtrack because of a particular learned clause.
Exactly 1 in 3 SAT ($X3SAT$) is a variation of the Boolean Sa... |
Let us start with the following well-known definition:
Definition 1. Let $C\subseteq A^n$ be a code over $A$ and let $t\in \Bbb Z^+$ be a positive integer. We say that the code $C$ is
$\boldsymbol t$-error correcting if nearest neighbour decoding is
able to correct at most $t$ errors, assuming that if a tie occurs in... |
I'm trying to prove that a context sensitive language ⊊ Turing-acceptable language.
I was thinking of working out the complement of the language $A$, where $A$ consists of all words $w$ such that $M_w$ is a 1-NTM that accepts the input $w$ without leaving the input area.
Unfortunately, I can’t figure out how to really ... |
I have a pipelined stream processing situation, where a number of streams is linked in the computational process S0 -> S1 -> S2 -> .... You can understand "stream" as a list of numbers.
In this process, S0 is initially given in totality. S1 is a mapped result from S0 according to function f; S2 is the result from S1 by... |
How can it be proven that a
deterministic CSL = semi-deterministic CSL?
Does that imply that a CSL = semi CSL?
Would I need to build a Turing machine, since a language accepted by a Turing machine is considered semi CSL?
|
Text message constantly keeps adding more emoji so I know the protocol could be extended with a delimiter at minimum.
How does RCS compare to extending text message protocol? I ask this because I somehow doubt Apple will adopt the new standard but could be wrong when it doesn't support encryption.
Here is a list of fea... |
I'm learning about Traveling Salesman in an online course (sorry I can't share the link it's paid only) and the first step to solving it then just state "as a heuristic we avoid crossed paths" and never really explained why. Why are crossed paths bad in traveling salesman?
|
The following is a problem statement from "Introduction to Theory of Computation" Chapter 0 Problem 0.14:
Let $G$ be a graph. A clique in $G$ is a subgraph in which every
two nodes are connected by an edge. An anti-clique, also called an independent
set, is a subgraph in which every two nodes are not connected by an ed... |
I am trying to solve an LP in which one of the constraints is mentioned below,
$$\max(x_1,x_2) \ge q,$$
where $x_1 \ge 0$ and $x_2 \ge 0$.
Is it possible to do in linear programming?
|
I want to better understand how this actually works, as my solutions are
sometimes not 100% correct.
I have the following relation:
Check if the following relation is reflexive, symmetric, and/or
transitive:
$$ R_1 = \{ (x,y) \mid x,y \in \mathbb{R}, x=0 \land y \geq 0 \}. $$
so by that
$$ R_1 = \{ 00, 01, 02,03,04,0... |
I am reading the book An Introduction to Mathematical Cryptography. In its chapter 7, there is the following statement:
In real world scenarios, cryptosystems based on NP-hard or NP-complete problems tend to rely on particular subclass of problems either to achieve efficiency or to allow the creation of a trapdoor.
Q... |
A symmetric matrix $A\in \Bbb{R}^{n\times n}$ is copositive if for every vector $x\in\Bbb{R}^n$ with non-negative entries, we have
$$x^TAx \ge 0.$$
What are known methods to check if a specific matrix $A$ is copositive that are efficient in practice? I'm looking for something which will return an answer for a single in... |
How can I solve the following recurrence $T(n) = T(n - 1) + n$ with the substitution method?
I guess the solution is $\Theta(n^2)$ I try to demonstrate $O(n^2)$:
$$T(n) \leq O(n^2) \\ \leq c(n-1)^2+n \\ \leq cn^2+c-2cn+n$$
How can i continue?
|
For a CAM (Computer Aided Manufacturing) software, and more specifically, for the simulation of the subtractive manufacturing, I would like to understand how to design the representation.
In subtractive manufacturing (e.g. a Mill), a piece of raw material like a cube or a cylinder is machined. That is, a milling bit (... |
Given three binary strings, find the maximum possible length of a contiguous block of 1's formed by shifting and overlapping the strings.
This may be interpreted as finding the maximum window size $k$ such that for each column $(a, b, c)$ across the three strings, it holds that $a \lor b \lor c$ is true. If we instea... |
I find in many references the fact that if $G$ is a connected planar graph, then for any embedding, $G^{**} \cong G$. However, all those references either say that this fact is trivial, or give the proof as an exercice.
I am ok that this is clear on a small graph, with a nice embedding, but how can we prove this proper... |
As the question implies, can you mention any difference between Hidden Markov Model and Non-deterministic Finite-State Machine? Are they different or the same?
|
Consider the following mathematical model of training a neural net : Suppose $f_{w} : \mathbb{R}^n \rightarrow \mathbb{R}$ is a neural net whose weights are $w$. Suppose during the training the adversary is sampling $x \sim {\cal D}$ from some distribution ${\cal D}$ on $\mathbb{R}^n$ and sending in training data of th... |
Can someone recommend introductory articles/papers on the connections between dependent type theory and locally cartesian closed category? Many Thanks!
|
Most definitions of a $k$-wise independent family of hash functions I have encountered state that a family $H$ of hash functions from $D$ to $R$ is k-wise independent if for all distinct $x_1, x_2,\dots, x_k \in D$ and $y_1, y_2,\dots, y_k \in R$,
$$\mathbb{P}_{h \in H}(h(x_1) = y_1, h(x_2) = y_2, \dots, h(x_k) = y_k) ... |
Given:
$$f(1) = 1 \\ f(n) = 4f(n-1) + f(n/3) + f(n/8)$$
(if $n<1$ then it is still 1)
And I need to find $\Theta(f(n))$, can I do this?
$$ \Theta( f(n)) = \Theta(4f(n-1)) + \Theta(f/3)) + \Theta(f(n/8))$$
Then solve each term and get that it is $\Theta(4^n)$ ?
Or it is not possible as we basically have this:
$$ f(n) =... |
I understand that every modern human made computer is being operated by time sharing operating systems which allow two or more users running two or more processes at once each, from two different terminals.
Take for example playing two songs at once: One from YouTube and one from MP3; they appear "mixed" but the "parti... |
In the bin packing problem, there are some $m$ items of size less than $1$, and they have to be packed into as few as possible bins of size $1$. The problem is NP-hard, but if we are allowed to break some items then it becomes easy, since each bin can be filled completely.
What if we are allowed to break (to as many pi... |
The Akra–Bazzi method handles recurrences of the form
$$
f(n) = \sum_{l=1}^k a_l f(n/b_l).
$$
Does it work when then number of $a \cdot f(n/b)$ is not finite, meaning that we have a sum that depends on our input $n$?
What about this:
$$ f(n) = \sum_{l=1}^{n} f(n/3^l) $$
Can I say that we need to find the $p$ so that
$$... |
Is it possible to make an algebraic grammar LL($1$) which recognizes palindroms for an alphabet $\{a,b\}$?
|
I know the fact that if we have two functions $f$ and $g$ it is valid to say that:
$$ \Theta( f(n) + g(n)) = \Theta( \max\{f(n), g(n)\})$$
My question is if this is valid when $g$ is not a separate function, but also some kind of $f$?
For example, if we have:
$$f(n) = f(n-1)+f(n/3)+ f(n/9)+\dots+ f(n/3^{\log_3(n)})$$
I... |
I am trying to understand the definition of skewed circuits in these slides which is given as follows:
A circuit is skew if in each product gate, at least one product has degree $\le 1$.
I think author wants to say that each product gate is either a leaf node or one level above the leaf node.
|
I was studying CRC from lecture notes of Schwarzkopf but I am stuck at this statement:
If $G(x)$ is a factor of $E(x)$, then $G(1)$ would also have to be $1$.
What does this statement means? It is the third point in the third last block of the article whose link is given. I know a similar question is asked but that i... |
I am currently studying the book 3rd edition CLRS Algorithms textbook, Chapter 3. I had the exact same question as this post but I have one more question now:
What is a negative function?
These functions are estimates that describe the time it takes to perform a function (an algorithmic sequence) onto a list. How can t... |
Suppose I have a matrix that I know to be singular. This means that there is at least one row in the matrix which is a linear combination of the other rows. What is the fastest way to identify which row that is or which rows they are?
I'm aware that the solution to this problem is not unique in general. The goal is to ... |
Wiki describes the binary relation $\underset{\mbox{G}}{\implies}$ as "G derives in one step". I have a question on the condition when there are multiple productions for a single non-terminal.
Wiki defines $G = (N, \Sigma, P, S)$ and $\underset{\mbox{G}}{\implies} \subset (\Sigma \cup N)^* \times (\Sigma \cup N)^*$ wh... |
The lecturer of my graduate algorithms course suggested that, even if a Fibonacci Heap would consolidate its tree list after every operation (not just when doing deleteMin()), most operations would still have $\mathcal{O}(1)$ amortized complexity.
I've been trying to prove this, starting with the classical potential fu... |
I am trying to distort the image obtained from two cameras that generate a stitching image. Unfortunately, I do not have access to the cameras and I would like to know what could be the best way to apply to correct the image and get the lines below to be straight.
The next step I am trying to do is to calculate the ho... |
How to show that the quick-sort algorithm runs in $O(n^2)$ time on average ?
Because on average, the expected running time is in $O(n\log n)$. The algorithm should not be in exponential time.
|
Say I have a incredibly simple input to a convolutional layer: [In1] <----- 1*1 input matrix
I have two filters applied this input:[F1] and [F2]
They give the results: [F1 * In1] and [F2 * In1]
Then let [F1 * In1] = [Out1] and [F2 * In1] = [Out2]
I then calculate ∂C/∂In1 for each filter: [∂C/∂Out1 * ∂Out1/∂In1] and [∂C... |
A basic question or request for clarification regarding Karp reducibility:
Let $\Sigma^*$ be the set of all finite strings of 0's and 1's. Call a subset of $\Sigma^*$ a language. Let $\Pi$ denote the set of all functions from $\Sigma^*$ into $\Sigma^*$ that are computable in polynomial time. According to Karp, a lan... |
In my chess code I explore the whole tree of possible movements to find saving moves for a checked king. That is, for every one of the checked king's side pieces I search their whole tree of moves and keep those that remove the king from check in a list.
Not like it's particularly expensive computationally-wise with a ... |
I need an instance of 3SAT with exactly one solution but I cannot think of or find one anywhere. Can anyone please give me an example?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.