instruction
stringlengths
35
29.1k
I need to solve the following recurrence relation, where $T(n,m)$ is defined over $\Bbb N_+\times\Bbb N_+$. $T(n,m)=\begin{cases} 1, & n=1\text{ or }m\leq 2(n-1)!\\ \min\limits_{a,b,c\geq 1,\ c\le n-1\\a\leq c!,\ b\leq(n-c)!}{T(c,a)+T(n-c,b)+T(n,m-ab)}, & \text{else.} \end{cases}$ Note: This question is highly related ...
I'm asking about its part a. a) If $f(z),\space a(z),\space b(z)$ are polynomials with integer coefficients, let us write $a(z)\equiv b(z) (\operatorname{mod} f(z)\space and\space m)$ if $a(z) = b(z) + f(z)u(z) + mv(z)$. Prove that the following statement holds when $p^e>2$ (p prime) , $f(0)=1$: If $z^\lambda \equiv 1...
I am trying to understand connection between non determinism of grammar and LL(1) conflicts introduced by it. As per my understanding non deterministic context free grammar is a context free grammar in which at some point in time during parsing, multiple actions are allowed. Also I believe non determinism occurs when w...
Let's say I have a list of "Items" I also have a list of "Bags". Each bag is a set of "Items" which gives what item can be placed in that bag. But only one item can go in each bag. I want to place all items in a bag. It's okay if there are empty bags left over. Does this sort of problem have a name and a solution other...
There is a given treebank which we derive the Probabilistic context free grammar. I wonder how do one handles with a given sentence which includes terminals that don't exist in the derived rules? Is there a kind of smoothing for this case? Considering we use CYK to get the parse tree of the given sentence.
I came across this statement: Note that there are unambiguous grammars for which every LR parser construction method will produce a parsing action table with parsing action conflicts. I was guessing what could be the characteristics of such grammars? Then I came across this question which very well asks: Why does t...
I am looking for a very specific algorithm, so I think it doesn't exist yet. I would be satisfied if anyone was able to give me some hints to develop it. My problem is about a square grid of size n x n, where n is an odd natural number ≥3. For instance, it can be a 5 by 5 grid: .---.---.---.---.---. | | | | | ...
I understand that if there exist 2 or more left or right derivation trees, then the grammar is ambiguous, but I am unable to understand why it is so bad that everyone wants to get rid of it.
Since Earley parser finds all possible application variants for a token, can it parse text in parallel, unlike the usual parser like stack-based, etc. You just need to modify the start of each parallel chunk of tokens, then while going backwards while constructing a table you combine and validate the found rules like ...
I am completely aware of how to calculate first and follow, my professor has taught me that well , but he had not explained what is the need of First() and Follow(), so any explanation why we need them will help me very much.
Although type theory originated (e.g. already discussed by Russell in 1910s) much earlier than programming languages, I have this feeling that languages such as C considered type-checking from a very engineering-oriented approach. For example, it may have more to do with CPU/bus width than the correctness of reasoning ...
We say that two languages $L_1,L_2$ are decreasing reducible if there exists a polynomial time reduction $f:\Sigma^*\to\Sigma^* $ and there exists $n\in\mathbb{N}$ such that for every $x\in\Sigma^*$ satisfying $|x|\ge n \implies |f(x)|\lt |x|$. Assuming $P\ne NP$ Prove\Disprove: Every two NP-complete languages $L_1,L_...
I'm doing an online programming challenge where successive XOR operations are used (from codewars.com, if you don't want to create an account, here are the instructions). We have a rectangle of known dimensions where every value of column and row (zero-indexed) are XOR-ed in order to create a value. Then, we must compu...
Is it possible to use $USTCON$ log-space decision algorithm in order to show reduction from $USTCON$ to some other decision problem $A$? I mean - the reduction will run $USTCON$ decision algorithm and then produce some output $x ∈ A$ or $x ∉ A$ accordingly?
A minimum-spanning-tree (MST) path is always $V-1$ edges and a Hamiltonian Cycle (HC) is always $V$ edges. Because the HC has an extra edge we could say that in general, the weight of every Hamiltonian cycle of a connected graph will be more. If we take an edge of every Hamiltonian cycle we will find an MST and by that...
So I heard that there are such models for finding time complexity of an algorithm as logarithmic cost model and bit complexity model. But from the information I have found in the internet, I cannot understand what operations are taken to be constant time, but I understood that arithmetic operations are not taken to be...
I'm experimenting with the J array language, a dynamically-typed array language with mutable assignment, subtyping, and function overloading (just like traditional APL). It is unclear to me whether statically typing the J language (without subtyping) without need for type annotation is possible. Given that J's types ar...
My friend and I are working on this project for our Formal Languages and Automata class that consists in building a pushdown automaton. A part of the project that is bothering me is how to visualize the automaton in action. What mean in visualizing is, for example, this, a non-deterministic finite automaton that accept...
I'm trying to understand the contrast between run-time for this function public static String f(int N) { if (N == 0) return ""; String s = f(N / 2); if (N % 2 == 0) return s + s; else return s + s + "x"; } and this function public static String f(int N) { if (N == 0) return ""; if (N...
Given: $L_1=\left\{ \left\langle M\right\rangle :L\left(M\right)\ni w_{0}\right\}$ $L_2=\left\{ \left\langle M\right\rangle :L\left(M\right)=\left\{ w_{0}\right\} \right\}$ I believe I've managed to show that: $L_1 \in \mathcal{RE \setminus R} $ since it's easy to construct the acceptor: U(<M>): if <M> is an inval...
I am interested in using Michel Goemans' extended formulation first developed for the permutahedron to study comparator networks that are not sorting networks. In his paper "Smallest Compact Formulation for the Permutahedron" (An online version is available here http://math.mit.edu/~goemans/PAPERS/permutahedron.pdf), ...
Are there languages $L_1$, $L_2$ such that such that $$L_1 \cup L_2\leq_m\, L_1\cap L_2,$$ and two other languages such that $$L_1 \cap L_2 \leq_m\, L_1 \cup L_2?$$ And if so, what are they? How can i go about finding these?
In computational theory, and talking about CFGs, Turing Machines, and so forth I haven't a satisfactory explanation or definition for what ATM means versus ALLTM or the same or similar uses with CFGs, etc. Does the single A stand for any, some, one, or all instances of the class whether it's a TM, a CFG, or anything ...
When revising for an upcoming exam in complexity theory, I came across this problem on the final part of a question, which I was unable to solve: $ TARGET = \{<G, t> : t\ is\ reachable\ from\ every\ other\ node\ in\ G\}$ Now we are allowed to use any standardly known problems that are NL-Hard in this part of the questi...
I asked a question recently, but I need to be able to add an artificial minimum number of steps that can be larger than the Dijkstra minimum. To summarize, I built an undirected graph with edges representing possible moves of 1's, 10's, 100's, etc to get from one value to another. public static UndirectedGraph<int, IEd...
I've been reading about Adaptive Computing, i.e. the idea of computer programs taking feedback from the environment at runtime to improve the output in some way. More precisely, my current focus is in Self-Optimization: how to write programs that are able to choose the best algorithm/data structure in response to chang...
I was analyzing Randomized Quick Selects' time complexity, as a function of n - the size of the input, and k - the index of the element that needs to be selected. The time complexity dependence on n was linear as was expected, but the dependence on k was of an inverted parabola - i.e the time complexity was highest whe...
Is there any quantum algorithm (algorithm for quantum computers) for any NP-hard problem that has better runtime than the best known classic algorithm's runtime?
So glad to find this place. I have been struggling for quite a while with this given question and i am not sure how to fully address it. The question: $L_1$ and $L_2$ are regular languages over the same $\Sigma$. prove that the following language is regular as well: $L^\frown \:=\left\{\:w\:\in L_1 | \:w=\sigma _1\mu _...
Given a graph $G=(V,E)$. A fractional matching, say $f$, assigns every edge $e \in E$ to a fraction $f(e) \in [0,1]$, with the constraint: for $v \in V$, $\sum_{e \ni v}f(e) \leq 1 $. My question is : does the fractional matching give a matching that we know (of $G$) i.e. with no conflicting edges? I am confused, sin...
The problem: We are given an array $A$, an integer $Z$ and a value $Q$. The goal is to maximize the sum of $A$, by performing following operation any number of times: We can select exactly $Z$ elements from the given array and perform XOR on each of them with $Q$. Is there any data structure I can use which can perform...
What kind of advantages does Lambda calculus have over Turing machine, and vice versa?
I have wondered about ordinary code. Assume we are running this code on any modern System like Unix/Linux/Mac/Windows. This code is C, but it should work with every language which is close to the hardware. int a = 8; //printf("%d", (int)&a); This will show obviously that the system allocated the int dynamically. So th...
I am having hard time proving that the following language,comprised from two regular languages $L_1,L_2$(over the same $\Sigma$)is indeed regular: $$L^\frown = \{ w\in \Sigma^* | w=u\sigma_1\mu_1...\sigma_n\mu_nv\}$$ $u,v \in \Sigma^*$ $0\leq n$, for every i($1\leq i \leq n$): $\sigma_i,\mu_i \in \Sigma$ $\sigma_1...\...
We have an exercise where we need to find the partitions G[V1] and G[V2] of a graph G=(V,E), that fulfill the following constraints. We also know that there exists at least one partition that fulfills these constraints: |V1| - |V2| = 0 or 1 (V1 and V2 have the same amount of nodes or V1 contains one node more that V2)...
Is it correct to assume that PageRank is a sorting algorithm or does it fall in any other category?
I'm trying to do approximate matching of one plane geometry with n points to a big set of other plane geometries. The aim is to get the closest shape (rotation and scale agnostic) My idea would be to "normalize" all the shapes coordinates in the database to [0-1, 0-1] to omit the scaling correction and than compare it ...
Prove or disprove for each of the following two properties, whether a family of trees that satisfy the property is balanced. If you disprove, the counterexample should consist of an infinite sequence of trees in the family rather than just a single tree, because the property is asymptotic. A. There is a constant $c$ s...
Let $L = \{\space ww \space | \space w \in \{0,1\}^*$} (need to prove that $L$ is not CFL) Assuming $L$ is CFL we can use the PL and split $s=uvxyz$ and we choose $s = 0^p1^p0^p1^p$ where $p$ is the pumping length. Using the 3$^{rd}$ rule, namely $|vxy| \le p$, can I say that $vxy$ can consist only of $0's$ and either ...
In the proof of the time hierarchy theorem given on page 69 of Arora-Barak, we define a TM D as follows: "On input $x$, run for $|x|^{1.4}$ steps the Universal TM $\ \mathcal{U}$ of Theorem 1.9 to simulate the execution of $M_x$ on $x$." Here $M_x$ is the machine encoded by string $x$. Since we are simulating another ...
What is the difference between a Non-Deterministic Turing machine, Probabilistic Turing Machine and a Deterministic Turing Machine ?
The definition of proving recognizability using dove tailing is below. However I'm wondering if we can also prove loop or reject in the same way? Give a deterministic TM D that recognizes L such that if $w \in L$ then D accepts w. Or if $w \notin L$, then D does not accept $w$. I realized this definition states on whet...
I bumped into this problem today, and after a bit of pondering, I think I have a solution in $O(n^3)$, which is better than no solution or an $O(n!)$ solution, but my answer still isn't great. Can you beat my best answer? The Real-World Impetus Given a set of data $C$ that consists of nonoverlapping, nonempty, unique ...
I have a list of lists of objects. Each of the lists of objects is ranked according to a numeric field of the object. The big list is ranked according to the highest numeric value of the field of all the objects in a list of objects. I want to select elements from each of the lists of objects, but obviously want to wei...
Suppose I have $k$ sets with $n$ elements in each. Define a selection as one element taken from each set. A selection is unique if there's one and only one way it can happen—that is, one and only one mapping from the elements in the selection back onto the original sets. For example, if my sets are $\{1,2,3\}$ and $\{1...
I'm trying to speed up the following function in c++: void num_to_xy(int num, int *x, int *y): *x = (cl & 0x03) | ((cl & 0x10) >> 2) | ((cl & 0x40) >> 3) | ((cl & 0x100) >> 4) | ((cl & 0x400) >> 5) | ((cl & 0x1000) >> 6) | ((cl & 0x4000) >> 7); *y = ((cl & 0x0c) >> 2) | ((cl & 0x20) >> 3) | ((cl & 0x80) >> 4)...
I've broken down the expression into two simpler DFAs but right now I'm stuck. I don't know what to do with the expression a*, my solution currently (as presented above) is a NFA, not DFA.
The canonical NFA to DFA conversion, starting with an NFA with $n$ states, can result in a DFA with $2^n$ states. However, in many cases, there are states that are "unnecessary," such as when minimizing the resulting DFA. The most common case is when states are "unreachable" from the corresponding start state. I am int...
I have been reading papers about the construction of this matrix in Shor's Algorithm all night. The behavior of the controlled modular multiplication matrix is described as $$C U_{a^{2}}(|c\rangle|y\rangle)=|c\rangle\left|\left(a^{2^{i}}\right)^{c} y \bmod N\right\rangle$$ in this paper. It's described similarly here ...
Assume I have a undirected graph $G$ without cycles (i.e., a forest) and I am provided with pair of nodes $a$ and $b$. How can I find the total number of paths in the graph that do not share any edge with the (unique) path from $a$ to $b$ and have only one vertex in common with it? For example, suppose I have following...
I know if the time complexity of an algorithm is given with the above formula, then the algorithm works in constant time but my question is that what will be the height of the recursion tree for this formula?
Consider the following decision problems: $CONN$= {$〈G,k〉$ ∶ $G$ is undirected graph with at least $k$ connected components} $E-CONN$= {$〈G,k〉$ ∶ $G$ is undirected graph with exactly $k$ connected components} I'd like to show this two problem are in $NL$. I Know it's possible to guess a vertex from each connected com...
In an undirected Graph G=(V,E) the vertices are colored either red, yellow or green. Furthermore there exist a way to partition the graph into two subsets so that |V1|=|V2| or |V1|=|V2|+1 where the following conditions apply: either every vertex of V1 is connected to every vertex of V2 or no Vertex of V1 is connected t...
I'm a student. today I answered a question wrong, the question is this: Spouse we have a k-bubble sort, which means except sorting 2 elements each time, it has a magical function that can sort $k$ elements each time with $O(1)$. What is the best time complexity we can give from this sort? (you can use just the magical...
I have a vital misunderstanding of the pumping lemma. In the following example I show an example of using it on a regular language to come to incorrect conclusions. What am I doing wrong? L={ab}, assume the language is regular so by the pumping lemma there exists some n, and σ = αβγ and σ' = αβ^kγ ∈ L for all non negat...
I am aware of what is ambiguity, and why is it necessary to eliminate ambiguity in compilers in a certain context, but how can we allow ambiguity for operator precedence parser? Say I have a set of operations like a-b-c now if we operate it with two different parse trees, say one like (a-b)-c and other like a-(b-c) the...
Hello I'm searching for any good review article or book about the design an implementation of a proof-assistant, something such as the Dragon book for programming language. My background is undergraduate in maths. Thanks in advance !
It is well known that the conventional subset sum problem with integers is NP-complete. What if the array elements can be any real numbers and also target sum can be any real number? Is it NP-complete still or harder (NP-hard)?
Suppose I have a finite point set $P = \{p_1,\ldots, p_K\} \subset \mathbb R^D$ and all $p_i \ne 0$. What I would like to do is partition $P$ into two disjoint pieces $A \cup B$ so the convex hulls $\langle A\rangle $ and $\langle B\rangle $ of $A$ and $B$ respectively, do not contain the origin. I would like to choos...
Would a deployed or deployment-ready (i.e., already-trained) supervised learning model have a 100% accuracy rate for predictions on the training data (if you were to run the training data through it again)? [Note: I don't know if it is possible for such models to incorporate "memory" such that the model would retrieve ...
I've read about Maximum Independent Set problem being both $NP-hard$ and $CoNP-hard$. I know this can be shown using reduction from the corresponding Max-Clique problem, But I'm wondering - Is that the most straight forward reduction? Is it can also be shown directly from Clique problem?
I've noticed quite a few cryptographic algorithms speak mainly of the time complexity of an algorithm. For example, with a hashing function h, find x given y = h(x). We normally speak on how long it will take. Or the time to find the discrete log for a public key. Edit: While writing this question, I pondered that mayb...
What is an example of a Karp reduction $f$ between two problems $A, B$ in $\textbf{NP}$ such that $f$ does not provide a way to transform certificates of one problem into certificates of the other? In other words, such that $f$ is not the Karp reduction in any Levin reduction between $A, B$? The accepted answer to thi...
I'm writing a video game, and I'm trying to find an efficient way of calculating this. The goal is to count the number of paths of length $n$ that a character can take, where the character can move left, right, or up. The caveat is that the character cannot go back to the same position in a path. I've come up with a me...
I understand that functions are not defined in type theory the same way they are defined in set theory, hence functional property is not directly defined when defining function type in type theory. But I want to know which part of function type definition in type theory guarantees functional property even if it is done...
Bitcoin miners are incentivized to produce valid blocks via a trasactional reward. But let's say I wanted to implement blockchain as part of my private data system. Who would my miner's be? I think could just have one automated miner (on a dedicated machine) with the proof-of-work difficulty being set to something very...
I have this question to answer: For each node i in an undirected network $G = (N,E)$, let $N(i) = \{j \in N : \{i, j\} \in E\}$ denote the set of neighbors of node $i$ and let $c_e\geq0$ denote the length of edge $e \in E$. For each node $i \in N$, suppose the set $N(i)$ is partitioned into two subsets, $N^+(i)$ and $N...
I'm reading the CLRS book and there is a statement for instance, the running time of insertion sort is not $\Omega(n^2)$, since there exists an input for which insertion sort runs in $\Theta(n)$ time (e.g., when the input is already sorted). It is not contradictory, however, to say that the worst-case running time of ...
The m-th largest number in a list of n numbers can be found in $O(m \log n)$ using a max-heap. This avoids sorting. Suppose I'm interested not in the actual numbers, but separation between adjacent numbers (after sorting). Is there an algorithm to find the m-th largest separation without having to sort the numbers? Mor...
It's easy to come up with a simple distributed algorithms for finding the maximum element in a set (totally ordered): Divide and conquer. There are a few publications that present algorithms for distributed maximum-finding. The challenge is to pass the fewest messages between nodes. Does anyone know of algorithms that...
For the proof of "Cook-Levin Theorem", for a Turing Machine $M$ that accepts a language $L \in NP$ and input $x \in \{0,1\}^*$, we can create a SAT Formula, that is satisfiable if and only if $M$ accepts $x$. Could we adopt this construction so that for any Turing Machine $M$ and input $x \in \{0,1\}^*$ we can create ...
I have just started learning about time complexities and am currently reading Logarithmic Complexity. Here's an example of a piece of code which is $O(\log n)$: def intToStr(i): '''Assumes i is a nonnegative int Returns the string representation of i''' digits = '0123456789' if i == 0: return '0' ...
I was selected for a UG interview and the following was one of the questions asked: "Suppose we have an $8 \times 8$ grid. Under one of the blocks, I (the interviewer) have hidden a treasure which you have to find by asking questions to me. The questions are to be of the form - "Is it under this $n \times n$ square (w...
Having some trouble generalizing when a complexity class $D$ is closed under polynomial reduction. For instance, take the following examples: $\bigcup_{c \ge 1} \mathsf{DTime}(2^{cn^5})$ $\bigcup_{c \ge 1} \mathsf{DTime}(5^{cn})$ $\bigcup_{c \ge 1} \mathsf{DTime}(n^{c\log^5n})$ $P$ is contained in all of these cla...
I've seen two versions of the cross entropy cost function, and conflicting information about it. \begin{equation}J(\theta) = -\frac{1}{N} \sum_{n=1}^N\sum_{i=1}^C y_{ni}\log \hat{y}_{n_i} (\theta)\end{equation} $$ C(\theta) = - \frac{1}{N}\sum_{n=1}^N \sum_{i=1}^{C}[ y_{ni}\log (\hat{y}_{ni})+ (1-y_{ni}) \log(1-\hat{y}...
I have a DAG, and on each edge, I have a minimum and maximum weight. I would like to assign (or determine it's impossible to assign) exact weights to each edge so that Each edge's weight is between its min and max For any two nodes $S$ and $T$ in the DAG, all paths from $S$ to $T$ have equal weight (where the weight ...
I know the Dijkstra algorithm to solve the "single source shortest path" problem in a graph. And I've seen people discuss solutions in a dynamic graph where edge/vertices are subject to change. Retrieving the shortest path of a dynamic graph My question is a little different. Given the entry node $S$, while the entire...
I found in 'Computational Complexity: A Modern approach' Book the following statement that i dont quite understand its proof: For every f : {0, 1}∗ → {0, 1} and time-constructible T : N → N, if f is computable in time T(n) by a TM M using alphabet A, then it is computable in time 4log|A|T(n)by a TM M ̃ using the alpha...
Is the following language regular? $$\{ w \in \{a, b\}^* |\ \text{the product of the number of $a$'s and the number of $b$'s is an odd number}\} $$ If i'm not mistaken the condition is the same as having an odd number of $a$'s and an odd number of $b$'s. I have tried using the Pumping Lemma without success. So I'm sus...
I'm getting confused on these both. Reject the string does a stop while loop the machine goes on and on. My textbook has one example on a reject state and no physical one for loop: Assume that no reject state was given. And I input a string $1^{q_{1}}011$ After all the transitions the turing machine is now on the empty...
A language $L$ is in BPP if there exists a randomised TM such that it outputs a correct answer with probability at least $1/2+1/p(n)$ for some polynomial $p(n)$, where $n$ is the length of the input. This probability can be amplified to $1-2^{q(n)}$, for some polynomial $q(n)$ by repeating the algorithm polynomially ma...
I'm trying to write a code to generate incremental sequences of numbers such as: 0 + 1 + 3 + 5 + 1 = 9 0 + 5 + 1 + 1 + 1 = 8 0 + 1 + 1 + 2 + 1 = 5 I have 3 constraints: 1) I need to have limited number of addends (here it is =5) 2) final sum must be smaller than certain limit ( here limit is <9) 3) addends must be ...
This question popped to my head when I watched Pi where the mathematican told the Jews "Didnt you calculate every 216 digit number allready?" So I want to find every possible 216 digit number possible. Here is an example 00123468648648464234123456787634567543358648454585685675285684684568546852325352325325362354756876...
I am currently working on a thesis, where the main goal is to find errors (like a missing message, wrong sequence) in message sequences. The messages are distinguishable by their name, have further information in the message body, and are available in a database. Each message can just be thought of as string-representa...
A problem $\Pi'$ is pseudo-polynomially reducible to the problem $\Pi$ ($\Pi' \leq_{pp} \Pi$) if, for any instance $I'$ of $\Pi'$, an instance $I$ of $Π$ can be constructed in pseudo-polynomially bounded time, such that, given the solution $S_I$ to $I$, the solution $S_I'$ to $I'$ can be found in pseudo-polynomial time...
Given is an infinitely large grid graph. Use dynamic programming to calculate the number of possible paths of a given length n from a given start node, so that fjor every path applies: a) no vertex may be visited twice within it and b) never to go down an edge I found out, that the number of possible paths correspo...
Given that a computer is basically an electronic machine, is computer science really a branch of electronics, which is in turn a branch of physics?
I have read that paging does not suffer from external fragmentation as the frames and the pages are all of the equal sizes, but when we store a last level page table in a frame at that time it may not fully occupy the frame. Similarly, if n such page tables are stored, that does not occupy the frames entirely, then the...
How can the problem of finding the minimal clique cover be solved using linear/integer programming in a reasonable amount of time? Having an undirected graph, I am trying to partition all its vertices into cliques so that the number of cliques is the smallest. The problem can be formulated as an integer program, where ...
I'm learning about Exponential search and I keep reading that the worst-case performance is $\log_2 i$ where $i$ is the searched index. I tried with an array containing $1073741824$ elements ($1024\cdot1024\cdot1024$) and I searched for the $1073741823$th element (which is just $n-1$). Therefore, I used the exponential...
I am having some trouble really getting to a precise understanding of some of Self-Testing/Correcting for Polynomials and for Approximate Functions and would greatly appreciate help. Here is my understanding of section 3, Self-Testing Polynomials. My main problem is that the definition of the function $g$ seems to requ...
I'm new to CHR and I was wondering if it makes sense to have have functions as arguments for constraint heads in a rule. I know that in the body of the rule this is possible. E.g. Is C(X-Y) legal here? C(X), C(X-Y), C(Y) => C(X * Y)
According to this article, A problem X can be proved to be NP-complete if an already existing NP-complete problem (say Y) can be polynomial-time reduced to current problem X. The problem also needs to be NP. Now my question is: Do we also need to prove that problem X can be reduced to at least one NP problem? Acco...
I'm a student studying Big O. I know that we can solve $T(n) = aT(\frac{n}{b}) + f(n)$ by compering $n^{\log_b{a}}$ to $f(n)$ or $O(n^{\log_b{a}} + f(n))$ Today I was faced with $T(n) = T(\sqrt n) + 1$ and I think it is $O(\log\log n)$. and I was faced with this too, $T(n) = T(\sqrt n) + O(\log\log n)$ that I think...
It's often implicitly assumed that we don't have to pay much attention to the difference between the program (which specifies the function being computed) and the input (the value on which that function is evaluated) when reasoning about Turing machines. In particular, people are often happy to assume that the program ...
It is well known the Subset-Sum problem is NP-complete. This can be shown using a reduction from the 3SAT problem. I am wondering: is there any other NP-Complete problem that could be reduced to the Subset-Sum problem?
Suppose we have $m$ points in $R^n$ and $\epsilon>0$ is a given constant. How can we find a hyperplane that the number of points that are $\epsilon$-close to it is minimum, with the constraint that it partitions the points to two sets of equal size. More formally, if the hyperplane is parametrized by $u^\top x = b$, in...
Is one a subset of the other? Two differentiable processes? The same thing? In the textbook "AI: A Modern Approach", the terms seem to be used interchangeably.
Is there a good algorithm for finding a permutation which, applied to all the strings in a set, maximises the weight of those with a common fixed length prefix. Given a set $S=\{(s,w)\}$ of pairs of fixed length bit strings and weights and an integer k find a permutation p of {1..k} and bit string v of length k to maxi...
Given a set $S=\{A,B,\cdots,H\}$. Elements in $S$ can be matched according to the following rules: $$\begin{aligned} A\leftrightarrow B\\ C\leftrightarrow D\\ B+C\leftrightarrow F\\ D+A\leftrightarrow E\\ G+H\leftrightarrow B\\ \end{aligned}$$ The input to the matching algorithm is an array of variable size consisting ...