instruction
stringlengths
35
29.1k
I am looking for a problem that can not be solved by computer but can be solved by human while computer can verify if the answer is correct or not. In fact what is the question in my head is that is there a way to clearly show the smartness in human brain compared to huge computation power of the processors.
Frankly speaking I have many problem with symbols in graph such as (s:s') or v\S or some symbols such as those that I mentioned . Can anyone suggest a good resource or a good tutorial on the net that has been discussed about these symbols and have clarified these symbols ?
I am trying to solve a problem on codeforces. Given an integer array $a_1,\ldots,a_n$, our goal is to find the minimal number of instructions, each of which increments or decrements a single entry, needed to make the array strictly increasing. That is, we want to find an increasing integer array $b_1,\ldots,b_n$ while ...
I have a query regarding the fact that how Spinlocks are advantageous in terms of context switching ?
I'm trying to understand sorting algorithms. And I'm thinking about a totally different way to tackle sorting: Use array indexes to sort a given set of integers. Suppose We want to sort a list of positive integers (for now). Let's call it toSortArray Create a boolean array that has a length equal to maximum integer in...
I have a problem where our action set is a polytope $\mathcal P\subset \mathbb R^d$ and an algorithm that involves projecting onto the action set. For example it says to select the Euclidean projection of $a \in \mathbb R^d$ onto $\mathcal P$. I believe this can be done efficiently if $\mathcal P$ has a small number o...
I'm taking an Advanced Algorithms course. I'm currently studying efficient algorithms for sorting strings. In this chapter, it is provided a lower bound for the time complexity of $\Omega(d + n\log{n})$, where d is the sum of the distinguishing prefixes of all the strings in our set S and n is the cardinality of the st...
I would like to find the sum of values from a given number array, where the repetition of numbers are allowed, closest to a target but the sum cannot exceed the target. If there are more solution, I'd prefer the one with the minimum element count. Examples: 1) Given values: [500, 1000, 2000, 5000] Target: 7000 Result: ...
I am curious about following question. I've read other threads but the problem is slightly different: Is the set of real numbers a language? So my question is: If I have a grammar, as defined in https://en.wikipedia.org/wiki/Formal_grammar#The_syntax_of_grammars G = (P,N,S,$\sum$) P-production rules N-non terminals ...
I am trying to write a genetic algorithm which will learn how to throw a ball at a target. I have successfully implemented code that will graph the projectile motion of a sphere given an input velocity vector $u(0)$. However, I'm not really sure about the crossover part. Right now, I am selecting the parents using a di...
Context free languages are not closed under complementation. This follows from their property of non-closure under intersection: If CFLs were closed under complementation, then they must have also been closed under intersection, which is not the case. Now as we know, CFLs are not closed under intersection and compleme...
A sorting network is a circuit-based approach to sorting, built out of CompareExchange gates, which compute the function: $$\mathsf{CompareExchange}(x,y) = (\min(x,y), \max(x,y))$$ The input to the circuit can be assumed to be in $\{0,1\}^n$ (which is viewed as $n$ separate wires). As sorting networks are phrased in te...
If a Sparse Language is NP-complete then are all NP languages sparse? We say a language is sparse if $\forall n \in \mathbb{N}, |L \cap \{ 0,1 \} ^{n}| \leq p(n)$, for some polynomial $p(n)$?
S ::= x S ::= if E then S S ::= if E then S else S This is example if E then if E then x else x proves that it is ambiguous but I don't see why? Isn't it just an if statement within an if statement.
Wiki gives an alternative algorithm for topological sorting is based on depth-first search, as follows: L ← Empty list that will contain the sorted nodes while exists nodes without a permanent mark do select an unmarked node n visit(n) function visit(node n) if n has a permanent mark then return if n h...
I have been trying to construct an example, where Hopcroft and Karp's algorithm for the maximum matching problem performs poorly (say at least $\Omega(\log n)$ rounds). However, all the examples I came up with where solved on paper in almost constant number of rounds. Other questions here in the community targeting thi...
Given a matrix $A=[a_{ij}]$ of positive number $0\leq a_{ij}\leq1$ that has $m$ rows and $n$ columns. I would like to select, for each row $i$, a set of columns $S_i$ such that $$\sum_{j\in S_i} a_{ij}\geq1,$$ and the number of overlaps $\Delta$ is minimum. The number of overlaps $\Delta$ is calculated as follows: $$\D...
Given N points, I want to find the optimal configuration for which all the points are as far away from each other as possible. The metric I'm considering is an approximation to the perceived distance between two colors: The colors are constrained between 0 and 255. And there are N colors of maximum pair distance I...
On the intuitionism page at Stanford Encyclopedia of Philosophy (SEP), it's said in Section 3.3 that Because of the finiteness of a natural number in contrast to, for example, a real number, many arithmetical statements of a finite nature that are true in classical mathematics are so in intuitionism as well. For examp...
Consider a given set $W = \{w_1, w_2,...,w_N\}$ of weights, such that $\sum_{i=1}^N w_i = 0$. Consider the given set of mutually different elements $A=\{a_1,a_2,...,a_M\}$ with $M\leq N$. Consider the set $S$ as a length-N sequence in which all elements of $A$ appear (therefore some $a_i$ can be repeated). Define the s...
I'm actually writing a piece of code to try and test various conjectures on directed graphs, and when possible, find a minimal counter example to the conjecture being tested. For that, I need to enumerate all possible simple directed graphs D=(V,A) (simple in the sense that multiple arcs, 2-cycles, or (u, u) arcs are...
I think that both forward selection and backward selection should give the same results if the evaluation model is deterministic and using the same variables gives the same results. Is this true? If so, what are the reasons for chosing one method over the other?
If a Sparse Language is NP complete, then are all languages in NP in P/poly? I know that sparse languages are in P/poly, but does a polynomial time reduction give an addition to the circuit that is super polynomial? A sparse language is such that $\forall n \in \mathbb{N}, |L \cap \{ 0,1 \} ^{n} | \leq p(n)$ for some p...
I encountered the following problem on Codeforces. An array of integers $p_1,p_2,…,p_n$ is called a permutation if it contains each number from 1 to n exactly once. For example, the following arrays are permutations: $[3,1,2],[1],[1,2,3,4,5]$ and $[4,3,1,2]$. The following arrays are not permutations: $[2],[1,1],[2,3,...
In computing, base 2 is a 0 and a 1 / on and off in a transistor. Base 3 is -1, 0 and 1. Electronically/in computing how would/could base e be represented visually?
From Design Concepts in Programming Languages by Turbak Although some dynamically typed languages have simple type markers (e.g., Perl variable names begin with a character that indicates the type of value: $ for scalar values, @ for array values, and % for hash values (key/value pairs)), dynamically typed languages...
Given a graph $G=(V,E)$ with $|V|=n,|E|=m$. I am reading a $\textit{brute force}$ solution to determining whether each candidate vertex cover of size $k \leq n$ is a vertex cover. The graph does not have loops. As per page 2 of the notes here we have: 1) $C(n,k) = O(n^k)$ $k$-subsets of $V$ 2) $O(kn)$ time to check w...
In Python, I can change the types of values associated with a variable: >>> x=1 >>> x="abc" In C, I can't do the same. What is the name of the feature that allows Python to behave so, while not C? I was wondering if the following language features have to do with the observation in Python: no explicit type annotati...
Some say that 'the bombe' created by Alan Turing is technically not a computer despite decrypting the codes. Why is it so? Is 'the bombe' technically a computer? First of all what is technically meant to be a computer?, When even olden mechanical machines like step reconer or hollerith tabulating machine is often regar...
I found this formal definition of a programming language in the 1973 paper Formal definition of programming languages by Terrence Pratt. PL is a formal language endowed with two structures: a translator and an abstract machine. Translator defines a mapping from program strings, as defined by BNF grammar, into a re...
Is it possible to define the language: $$L = \{ a^n \; b^{n^2} \}$$ using an existential second order sentence over strings (ordered structures with unary predicates $U_a(x), U_b(x)$) using only one binary relation? The sentence should have this form: $\exists M ( \exists B_1,...,B_n ( \varphi ))$ where: $M$ is a ...
Let $P \subset \mathbb R^d$ be a polytope with interior given by $F$-many linear inequalities. Suppose we have a convex problem with feasible set $P$. For example computing the Euclidean projection of some point onto $P$. Instead of trying to directly solve the problem we run Langrange multipliers on the dual problem. ...
I am reading through and thinking about how neural network works and have been reading about convolutional neural networks (CNN). I am particularly interested in image filtering (or enhancing) using CNN. The thing that confuses me is, how exactly does CNN produce the output, filtered/enhanced image? From what I underst...
I have constructed a DCEL using the procedure described in How do I construct a doubly connected edge list given a set of line segments?. This correctly identifies all faces, however I'm struggling to come up with a way to identify the unbounded face surrounding my graph. So far my only idea is that by building a polyg...
Assume a randomly ruffled pack of n cards with numbers from 1 to n. Each time we pick the top card from the pack (while there are still cards) and we put them according to the following rules: The first card goes to the top of a stack For every new card k,or (i) the k is put on the top of an already existed stack, if t...
I've been trying to read about sorting algorithms on stacks optimizing the amount of push and pops. One of a number of related probems I'm interested in can be formalized like that: There is a set of $k$ stacks containing $n$ stack items in total ($n>>k$). The stack items are numbered from $1$ to $m$ where $m < n$ (i.e...
You are given a graph of all the nodes and links between them. Each node has an associate value with it and each link contains the distance between the two nodes. Once you reach a node, your current value adds upon the value at the node. Once you collect the value at a node it is set to 0. Assuming you start at Node A ...
In my operating systems textbook, there is a paragraph which states: As for the contents of each PTE, we have a number of different bits in there worth understanding at some level. A valid bit is common to indicate whether the particular translation is valid; for example, when a program starts running, it will have co...
Given items with weights $w_{1}, w_{2}, \dots, w_{n}$ and queries of form $(l, r, w)$ asking for possibility to find a subset of items $w_{l}, w_{l + 1}, \dots, w_{r}$ with total weight $w$, how to answer these queries with $O(1)$ time by having done precalculation of some table in $O(nW)$ time, where W is strict upper...
Consider this class: class Has record part where extract :: record -> part update :: (part -> part) -> record -> record It captures the notion of some product type record having a field of the type part which can be extracted from the record, or the functions on which can be used to update the whole record (in a l...
I'm working on a project to change the location of items in a warehouse to allow me to ship items together which were bought in the purchase order (currently impossible due to conveyor logistics). The problem is, I don't have enough space to relocate them all and don't know which items to prioritize. I have a list of o...
Lets say we have plenty people to dress up entrees, but only one chef to cook them. Each entree $E_i$, takes $c_i$ time to cook and $d_i$ time to "dress up". The dressing up of entrees can occur while other entrees are being cooked and dressed up, but we can only cook one entree at a time. How would you go about creati...
Is the problem of deciding whether a SAT instance, where at most two clauses are false (that is, any given variable assignment will either lead to all clauses being true, all but one, or all but two), is satisfiable solvable in polynomial time? This is a follow-up from my previous question. The problem presented in tha...
Let us say we have $m$ bins and $n$ balls. Every bin $i$ has capacity $c_i$ which is the number of balls that can be put into bin $i$. We have $c_i\geq1$ for all $i$. For each bin $i$, there is a collection of sets $S_i=\{X_1,X_2,\ldots,X_{k_i}\}$ for given $k_i$. Each $X_j\in S_i$ is the set of balls that can be put i...
Let $\mathbf{FO^2}$ be the fragment of first-order logic consisting of sentences with at most two variables and no function symbols. It is well known that satisfiability for $\mathbf{FO}^2$ is decidable (see [1], for instance). Furthermore, in that same paper, it is argued that $\mathbf{FO^2}$ satisfiability is $\mathb...
I have the acyclic directed graph of tasks I want to perform. Each edge of the graph is a dependency, e.g. task 4 could be performed only after 1 and 2 completed. 0 `----> 1 ------------> 4 ---> 7 ` ^ ^ `---> 3 | | ` `------> 2 -----/ | ` `------> 5 ----------...
From CLRS Introduction to Algorithms, Appendix A, page 1152. They discuss a method called "Splitting Summations", where they split the summation and bound each term separately. For example, $$\begin{align*} \sum_{k=1}^{n} k &= \sum_{k=1}^{n/2} k + \sum_{k=n/2 + 1}^{n} k\\ &\geq \sum_{k=1}^{n/2} 0 + \sum_{k=n/2 + 1}^{n}...
can anyone please describe the language this FA accepts? thank you
following question, I understood the intuition behind how cutting down the size of input by square root on each iteration leads to O(log(log(n))) complexity. I tried to derive it on paper. Let T(n) = T($\sqrt{n}$) + c $\implies$ T($n^{1/2}$)+2c $\implies$ T($n^{1/4}$)+3c $\implies$ T($n^{1/8}$)+4c $\implies$ T($n^{1/16...
Consider this problem: You are given an array $A$ (of distinct integers) of one out of the following four types: Ascending (e.g., 1,2,4,6); Descending (e.g., 6,4,2,1); Ascending rotated (a non-trivial circular shift of an ascending array, e.g., 4,6,1,2); Descending rotated (a non-trivial circular shift of an descendin...
I have a question. Assume $L = \{ a^m b^m \mid m ≥ 1 \}$ is not a regular language. Prove that $I = \{ a^{5n} b^{3m} c^n d^m \mid m,n ≥ 0 \}$ is not a regular language. I can prove it with pumping lemma but the question is to solve it by using the assumption. Thanks.
I am given an assignment to design a tiny arithmetic unit (from 0 to 15 inclusive) start with 0 and using a DFA. The operations are as follow: increment x+1 and if x+1 is larger than 15 then x+1 goes to 0 decrement x-1 and if x-1 is less than 0 then x-1 goes to 15 multiplication: 2*x and if 2*x is larger than 15 then...
Considering this factor $2$ minimum vertex cover approximation algorithm : Repeat while there is an edge: Arbitrarily pick an uncovered edge $e=(u,v)$ and add $u$ and $v$ to the solution. Delete $u$ and $v$ from the graph. Finally output the candidate cover. I want to find the worst case running time of this algor...
This a problem i came across while practicing binary search. Here is the problem: Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after dividing dividend by divisor. The integer division should truncate toward zero. Note: Both...
I have many questions which related to this topic. I saw somewhere that a topological sorting can be used to find shortest path, and in DAG it can even find shortest weighted paths of all vertex by asking about each vertex whether it's weighted higher than edge plus previous vertex. The point is, I don't understand ...
If LR parsers handle only DCFLs than why we don't just use dpda to parse these languages? What are advantages of using LR parsers over DPDA? Is it that it is easy to built autonomously or something else?
here is a nested loop where all the variable are integers.This is another question to the thread. I understood the solution part , but stuck in the time-complexity part. What is the time complexity of the below code and how? def divide(dividend, divisor): """ :type dividend: int :type divisor: int :rtyp...
I'm reading the book by MacKay "Information theory, inference and learning algorithms" and I'm confused by how he introduces the decoding problem for LDPC codes (page 557). given a channel output $\mathbf{r}$, we wish to find the codeword $\mathbf{t}$ that whose likelihood $P(\mathbf{r}|\mathbf{t})$ is biggest. I can...
I want to map objects of a list, to objects of that same list, randomly, without ever mapping any given object to itself. So given a list of objects [a, b, c] valid maps would be, for example: a -> b, b -> c, c -> a or a -> c, b -> a, c -> b an invalid mapping would be: a -> a, b -> c, c ...
Would we consider $O(\log_2(n))$ to be the same complexity as $O(\log_2(n-1))$? Why or why not? I'm specifically wondering about how the number we take the log of affects the time complexity.
The language I am interested in is $L=\{w∈\{a,b,c\}^*| w$ contains "$bac$" but not "$cab$"$\}$. I am thinking that the result will have the form $L=X_1X_2X_3$, where $X_1=\{w∈\{a,b,c\}^*| w$ does not contain "$ca$" at the end nor "$cab$" anywhere$\}$, $X_2=$"$bac$" and $X_3=\{w∈\{a,b,c\}^*| w$ does not contain "$ab$" a...
I've tried to find the answer through Google but I've come across conflicting uses of terminology, so I just wanted to be absolutely clear. Here is my understanding: High level code written in a high level language (C I think is one of the lowest-level high level languages) gets translated to assembly code by that lan...
How could we delete an arbitrary vertex from a directed weighted graph without changing the shortest-path distance between any other pair of vertices? We are allowed to reweight the edges.
Consider the following (Context-Free) Grammars with only one production rule (not including the epsilon production): $S \rightarrow aSb\;|\;\epsilon$ $S \rightarrow aSbS\;|\;\epsilon$ $S \rightarrow aSaSb\;|\;\epsilon$ $S \rightarrow aaSaaSbb\;|\;\epsilon$ $S \rightarrow aSbScSdSeSf\;|\;\epsilon$ etc... Grammars like...
(I'm not sure this is the right forum.) I'm writing a program that uses the prime-counting function. Right now, I'm using x/log(x), but I want to switch to something more accurate. A better approximation is the logarithmic integral function (actually, its Eulerian variant), which can be computed from the exponential ...
$N:=2^p$ Input: $f \in \mathbb C^N$ 1: $n=N/2$ 2: initialize vectors $f^{(1)}, f^{(2)} \in \mathbb C^n$ 3: $w_N^0=1$ 4: for $j=0,\ldots,n-1$ do 5: $\ \ \ \ \ f_j^{(1)}=f_j+f_{j+n}$ 6: $\ \ \ \ \ f_j^{(2)}=(f_j-f_{j+n})w_N^j$ 7: $\ \ \ \ \ w_N^{j+1}=\exp(-2\pi i/N)w_N^j$ 8: end for 9: if $N=2$ then 10: $\ \ \ \ \, $set...
Spawning from here: We usually don't care whether indices start at $0$ or $1$ (except in the sense we'd rather start with our favourite if it doesn't matter, and the old joke is that set theorists start at $0$ and non-Peano number theorists start at $1$). I say usually, because there are a few cases where we do: [......
The class NP can be defined as a polynomially bounded relation $R$. Where $x \in R$ if there exists some $y$ that has length bounded by $p(|x|)$, where $p$ is some polynomial. Why do we not study the case where $y$ is not bounded by a polynomial? Is there any significance in problems of this nature; in-efficient proof...
I have a language $\mathrm{Count}(M)$, defined below, and a finite number $k$. \begin{align} \mathrm{Count}(M)= \{k \in \mathbb{N} \mid \text{there exists some input on which $M$ halts after exactly $k$ steps}\}. \end{align} I need to check whether the language $L$ is in RE, and whether it is in R. $$L= \{ \langle M \...
The following exercise is taken from Chapter 17 of Languages and Machines by Thomas Sudkamp: Let $Q$ be a language reducible to a language $L$ in polynomial time. Prove that $\overline{Q}$ is reducible to $\overline{L}$ in polynomial time. I am not sure if my solution idea is correct. Anyone knows the correct solutio...
I am given the following regular expression, which accepts all strings over $\{a,b,c\}$ whose $n$th character from the right is $a$: $$ (a|b|c)^*a(a|b|c)^{n-1}. $$ The exercise asks for the number of states in the minimal DFA for the language. The answer must be similar to this question but still, I don't get it. When ...
I just read about Cross-entropy cost function for my work. and I see a notation that said "the minimization of cross entropy of some data is equal to maximization of their log likelihood." How can I achieve this result? How can I show that?
Let's say I give you the following array of points: (1,1) (1,3), (2,2), (4,1), (4,3) My (terrible) mspaint drawing of the shape that would be created by these looks like this: How, given an arbitrary set of coordinates, can I define the edges which constitute a shape with no overlapping edges?
I have a set of positive numbers: ${n_1,n_2,...n_k}$ s.t. $n_1>n_2>\dots >n_k$. I want to find an array of non-negative integers $c_1,c_2,\dots,c_k$ such that $$n_1c_1 + n_2c_2 + \dots + n_kc_k = N $$ for some given number $N$. I have looked into Knapsack and unbounded knapsack, but they don't explicitly look to calcu...
I am interested in formulating a knowledge graph query in a matrix multiplication/dot product/inner product. I have found by chance the paper Variational Reasoning for Question Answering with Knowledge Graph which uses a inner product in the last operation (look the picture). The problem is that the paper is not thoro...
I am curious, what happens if we run Universal Turing Machine on itself?
I am currently learning the dynamic substructure and optimal solution for the coin change-making, and one of the questions given from my teacher is to describe an overall O(n) dynamic programming algorithm that will give the optimal solution and why is it O(n)? Can anyone help me to understand the question? Thank you!
Here $DSPACE(\log(n))$ is the family of algorithms for which there exists a deterministic Turing machine using $O(\log(n))$ space. On the other hand $NSPACE(\log(n))$ is the family of algorithms for which there exists a non-deterministic machine using $O(\log(n))$ on all the possible path it could explore. I understand...
The question arise from my customer's real-time system (RAM model, off-course), which has very limited resources. Given an NxM matrix of integer values, we need to verify that the number of non-zero elements in every row and every column is maximum 2. The matrix cannot be stored! It comes as a stream (M and N are known...
Let's say program $P$ with given input $i$ is found to halt (or doesn’t halt) by a Turing machine. Is it true that the same program $P$ with input $F(i)$ also halts (or not, respectively), where $F$ is a computable function? In general, is it true that the behavior of program $G(P)$ with the input $F(i)$ identical to t...
I'm looking at a worksheet that expresses boolean logic expressions using multiplication, addition, and apostrophes; something I've never seen before. I can make a guess that the apostrophe is equivalent to ¬ (except it's suffixed instead of prefixed). But I'm not sure what the addition and multiplication of the variab...
Given $n$ roots, $x_1, x_2, \dotsc, x_n$, the corresponding monic polynomial is $$y = (x-x_1)(x-x_2)\dotsm(x-x_n) = \prod_{i}^n (x - x_i)$$ To get the coefficients, i.e., $y = \sum_{i}^n a_i x^i$, a straightforward expansion requires $O \left(n^2\right)$ steps. Alternatively, if $x_1, x_2, \dotsc, x_n$ are distinct, th...
Data structure is a term that I've heard use I think only somewhat informally in software engineering. Is there a formal definition of it in CS?
Please find my program logic as below : Please find my flowchart for the above program logic as below: My superior asked me correct the flowchart. But I couldn't identify my mistakes. Please guide me to correct my flowchart in correct manner. Thanks in advance.
I want to decode the following bit stream using Hamming code: 01110110 Once using even parity and once odd parity. I will show my work. For even parity: $p_{1} \; p_{2} \; 0 \; p_{3} \; 1 \; 1 \; 1 \; p_{4} \; 0 \; 1 \; \; 1 \; 0$ Now, we check: $p_{1}: p_{1} \; 0 \; 1 \; 1 \; 0 \; 1 $, since there is an odd number of...
Assume we have a tree and we want to serialize it. Example: Tree 1 / \ 3 2 / \ / \ 5 N N N ...
In this loop $j$ is dependent on $i$, and $j$ is executing like $n/2$, $n/2-1$, $n/2-2$, ... So does this sum up to $O(n\log n)$?
The problem I am facing is clustering problem, needed for a Vehicle routing problem (VRP) I'm tackling. It is a heterogeneous VRP with Time Windows and a capacity utilization constraint, i.e. a truck can be routed only if its loading factor is more than 80%. We have a set of customers dispersed on the map. Each custome...
Define $spdist(s,t)$ as the distance of the shortest path from vertex $s$ to $t$. Define $IN(v)$ as the set of in-neighbors of $v$. Define $w(u,v)$ as the weight of the edge $(u,v)$. I am asked to prove the following two inequalities to gain the correctness of Dijkstra's algorithm: $$spdist(s,v)\leq min_{u \in IN(v)} \...
Finding a Hamiltonian path in a directed bipartite graph is NP-complete. Problem 1 What is the complexity of the problem if we insist that the underlying graph of the digraph be complete bipartite? Is this known? (In other words, what is the complexity if the digraph is semicomplete bipartite, not just any bipartite...
As an amateur Bash/JavaScript scripter I was wondering if program coding ("writing source code") in general, and abstractless coding in particular (binary) is a concept of Computer Science or just an engineering implementation to ease doing the science and to automate processes. Is program coding part of computer scien...
I am trying to solve the following recurrence relation: $$T(n) = T(n/2) + T (n/3) + n $$ $$T(1) = Θ(1) $$ I guess that the time complexity is $T(n)=Θ(n)$ since $\frac{n}{2} + \frac{n}{3} < n$ I am trying to prove it using a recurrence tree. The tree is not balanced. Particularly, the longest path from the root to a l...
Assume $T(1) = 1$, and $T(n) = 2T(n/2) + n^2$ for even $n$, $T(n) = T(n − 1) + n$ for odd $n$. I'm new of learning to solve recurrence problem, for 1, it seems we can apply Master Theorem directly and we got $a = 2$, $b = 2$, $d = 2$, therefore it's the case that $d > \log_b(a)$ and $T(n) = \Theta(n^2)$. But I'm unsu...
I am interesting in the asymptotic rate of growth of the following recursion: $$ T(n) = 2T(n/2) + \frac{T(n − 1)}{\log n}, $$ with base case $T(1) = 1$. I'm having trouble of solving this recurrence problem, it seems much more tricky than I initially thought, and I'm totally stuck after doing some unrolling. What is a ...
I want to show that MAX−CLIQUE={(G,k)|the largest clique of G is of size exactly k} is DP-complete The idea is reduce MAX-CLIQUE to C={(G1,k1,G2,k2) | G1 has a k1-clique and G2 does not have any k2-clique} which I already know is DP-hard. I was seeing the solution on the second page of this link, but it seems...
Let $G$ be a simple complete graph with an edge-2-coloring. An alternating Hamilton (x,y)-path is a Hamiltonian path which starts at vertex $x$ and ends at vertex $y$ such that the colors of its edges alternate along the path. In [1], J. Bang-Jensen and G. Gutin pose the following problem: Problem 5.14 Is there a pol...
My professor noted that we could treat any logarithmic function with an exponent as equivalent to log(n) for the purposes of big-O analysis. ie. $(n log(n) + 1)^2 + (log(n) + 1)(n^2 + 1)$ From the left I would get $(n^2)(log(n))^2$ and from the right I would get $(n^2)log(n)$. According to my professor I can just say ...
We have $m$ bins and $n$ balls. Each bin $i=1,2,\ldots,m$ can contain at most two balls (not any two balls but two balls from some specific set), see 3. Each ball $j=1,2,\ldots,n$ can be put into bin $i=1,2,\ldots,m$. For each bin $i=1,2,\ldots,m$, there is a collection of sets $S_i=\{X_1,X_2,\ldots,X_{k_i}\}$ for g...
In Categories, Types and Structures, authors talk about exponential objects in section 2.3.1. Let $C$ be a Cartesian category, and $a,b \in Ob_C$. The exponent of $a$ and $b$ is an object $b^a$ together with a morphism $eval_{alb}: b^a \times a\rightarrow b$ (evaluation map), and for every object $c$ an operation $\La...
In Practical Foundation of Programming Languages by Harper 8.4 Dynamic Scope Another approach, called dynamic scoping, or dynamic binding, is sometimes advocated as an alternative to static binding. The crucial difference is that with dynamic scoping the principle of identification of abt’s up to renaming of bound ...