instruction
stringlengths
35
29.1k
While studying master method at recurrences topic I'm stacked at a point. It is written in the book as: $T(n) = 3T(n/4) + n \log n$, we have $a = 3, b = 4$, $f(n) = n \log n$, and $n^{\log_b(a)} = n^{\log_4 3} = O(n^{0.793})$. Since $f(n) = \Omega(n^{\log_4( 3)+\varepsilon} )$, where $\varepsilon \approx0.2$ .... ...
Insertion-Sort (A) [where A is an array of numbers to be sorted] (1) for j = 2 to A.length (2) key = A[j] (3) i = j -1 (4) while i > 0 and A[i] > key (5) A[i+1] = A[i] (6) i = i - 1 (7) A[i + 1] = key CLRS proves the correction of the above algorithm by using a loop i...
I went through a question asking me to choose the inherently ambiguous language among a set of options. $$L_1 = \{a^nb^mc^md^n \;|\; m,n \geq 1\}\cup \{a^nb^nc^md^m \;|\; m,n \geq 1\}$$ $$and$$ $$L_2 = \{a^nb^mc^m \;|\; m,n \geq 1\}\cup \{a^nb^nc^m \;|\; m,n \geq 1\}$$ The solution said that $L_1$ is ambiguous while $L...
I am getting confused by the regular expression $(a\mid b)^*$ as it for sure matches $aab$ and $ab$. Does $(a\mid b)^*$ also match strings like $aa$, $aaaa$, $bb$ or $bbb$, that is those that use only $a$ or $b$?
I've got two log-space programs $F$ and $G$. Program $F$ will get input in array $A[1..n]$ and will create the output array $B[1..n]$. Program $G$ will get as input $B$ as created by $F$ and create from it the output array $C[1..n]$. I have to write a proof that there exist a log-space program $H$, which will get inp...
A film producer is seeking actors and investors for his new movie. There are $n$ available actors; actor $i$ charges $s_i$ dollars. For funding, there are $m$ available investors. Investor $j$ will provide $p_j$ dollars, but only on the condition that certain actors $L_j \subseteq \{1,2,...,n\}$, are included in the ca...
I'm struggling to understand the relationship between NP-Intermediate and NP-Complete. I know that if P != NP based on Ladner's Theorem there exists a class of languages in NP but not in P or in NP-Complete. Every problem in NP can be reduced to an NP-Complete problem, however I haven't seen any examples for reducing a...
I have difficulties understanding the definition of the class Max-SNP (optimization variant of strict NP), thus I have to following basic question: If a problem is known to be Max-SNP hard, does this imply NP-hardness of the problem?
I have some questions regarding acceptance of a language by DFA Whether more that one dfa accept a language Whether a dfa can accept more than one language
From CLRS (third edition, page 19), there is a footnote: When the loop is a for loop, the moment at which we check the loop invariant just prior to the first iteration is immediately after the initial assignment to the loop-counter variable and just before the first test in the loop header. Why is the checking moment...
Consider the search problem: Input: A sequence of $n$ numbers $A=(a_1, a_2, \ldots , a_n)$ and a value $v$. Output: An index $i$ such that $v = a_i$ or the special value NIL if $v$ does not appear in $A$ Write pseudocode for linear search, which scans through the sequence, looking for $v$. Using a loop invariant, pro...
Is there any algorithm that tells us how to modify semantic actions associated with a left-recursive grammar? For example, we have the following grammar, and its associated semantic actions: $ S \rightarrow id = expr $ { S.s = expr.size } S $\rightarrow$ if expr then $S_1$ else $S_2$ { $S_1.t = S.t + 2; $ $S_2.t = S.t...
I have a container with a certain dimension. A number of small boxes that may be different in size is to be packed into the container. How to arrange the small boxes such that the container contains as many as possible? No rotation is allowed. The heavier boxes must not be on the top of the lighter ones. Approximation...
I'm unclear about the use of the phrases "infinite" language or "finite" language in computer theory. I think the root of the trouble is that a language like $L=\{ab\}^*$ is infinite in the sense that it can generate an infinite (but countable) number of strings. Yet, it can still be recognized by a finite state automa...
I recently took a practice exam for the Computer Science GRE and this was one of the questions: Assume that set $A$ has 5 elements and set $B$ has 4 elements, how many functions exist from set $A$ to set $B$? I had no idea what this means, I don't recall ever studying functions between sets, could someone shed some ...
I have asked this exact question on StackOverflow. I did not get the answer that I was looking for. Please read this question fully before answering. Thank You. For static pattern database(5-5-5), see this(page 290 and 283) OR there is an explanation below. For What is 15-puzzle? I am creating a static patter database(...
It was brought to my attention that the cost of type inference in a functional language like OCaml can be very high. The claim is that there is a sequence of expressions such that for each expression the length of the corresponding type is exponential on the length of the expression. I devised the sequence below. My qu...
Is there a clear reference, with pseudo-code, on how to go about implementing a Prolog interpreter in a purely functional language? That which I have found so far seems to deal only with imperative languages, is merely a demonstration of Prolog implemented in itself, or offers no concrete algorithm to use for interpret...
I know that if you try and make the theory $$\lambda\beta+\{s = t\ |\text{ s, t are terms without }\lambda\beta\text{ normal forms}\}$$ then that theory becomes inconsistent. Are two terms where one is without a $\lambda\beta$ normal form also unconvertible in $\lambda\beta$, ie can it ever be true that $\lambda\beta \...
How do I show that the problem of deciding whether a PDA accepts some string of the form $\{ w!w \mid w \in \{ 0, 1 \}^*\}$ is undecidable? I have tried to reduce this problem to another undecidable one such as whether two context-free grammars accept the same language. However, I'm not sure how to use it as a subrouti...
A binary counter is represented by an infinite array of 0 and 1. I need to implement the action $\text{add}(k)$ which adds $k$ to the value represented in the array. The obvious way is to add 1, k times. Is there a more efficient way?
Could anyone point me to simple tutorial on greedy algorithm for Minimum Spanning tree - Kruskal's and Prims' Method I am looking for a tutorial which does not include all the mathematical notation explains algorithm along with the analysis of the running time.
I am trying to find the maximum palindrome sub-sequence and after going through some tutorials, I came up with a memoized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also someone explain what the runtime will be? Memoized-Palindrome(A,n) initialize longest [i][j...
Question: To what extent is it known (or believed) that Chuck Moore and Don Knuth had influence on each other's thoughts on ideal machines, or their work on algorithms? I'm interested in citations, interviews, articles, links, or any other sort of evidence. It could also be evidence of the form of A and B here suggest...
What is it about the structure of counting sort that only makes it work on integers? Surely strings can be counted? ''' allocate an array Count[0..k] ; initialize each array cell to zero ; THEN ''' for each input item x: Count[key(x)] = Count[key(x)] + 1 total = 0 for i = 0, 1, ... k: c = Count[i] Count[i] ...
I am following "Introduction to the theory of computation" by Sipser. My question is about relationship of different classes which is present in Chapter 8.2. The Class PSPACE. $P \subseteq NP \subseteq PSPACE = NPSPACE \subseteq EXPTIME$ I am trying to understand why the the following part is true $NPSPACE \subseteq EX...
If ${\sf P}$ does in fact equal ${\sf NP}$, how would this enhance our algorithms to factor integers faster. In other words, what kind of insight would this fact give us in understanding integer factorization better?
Suppose a build max-heap operation runs bubble down over a heap. How does its amortized cost equal $O(n)$?
Possible Duplicate: Prove that the complement of $\{0^n1^n \mid n \geq{} 0\}$ is not regular using closure properties Is $L=\{ a^nb^m \mid n,m \ge 0, n\ne m\}$ a regular language? I think it is but can't prove it.
I have just started to learn Dynamic Programming, and so far I have studied the few basic concepts; longest common subsequent problem, edit distance problem and the knapsack problem. I have attempted to solve the following exercise that is related with this topic, and so far I think I have a way how to approach it , bu...
I'm trying to find the most probable path (i.e., sequence of states) on an hidden Markov model (HMM) using the Viterbi algorithm. However, I don't know the transition and emission matrices, which I need to estimate from the observations (data). To estimate these matrices, which algorithm should I use: the Baum-Welch al...
I take course on Computational Complexity. My problem is I don't understand Relativization method. I tried to find a bit of intuition in many textbooks, unfortunately, so far with no success. I will appreciate if someone could shed the light on this topic so that I will be able to continue by myself. Few following sent...
We can consider a Residue Number System (R.N.S.) that has efficient operations for add, multiply, and compare between two numbers. A more rigorous definition We can suppose that we can perform the operations above between two non-negative integers $x$ and $y$ with $x \ge y$ in time proportional to $O(x\log(x))$ with $O...
I'd like to know if there is a function $f$ from n-bit numbers to n-bit numbers that has the following characteristics: $f$ should be bijective Both $f$ and $f^{-1}$ should be calculable pretty fast $f$ should return a number that has no significant correlation to its input. The rationale is this: I want to write a ...
I need to build a graph with $N$ vertices such that each vertex has degree at least $k$ and the graph has the smallest diameter. What algorithm can I use?
How can you prove that multiple-cell-move instructions, for example (X, Y, 5R) and (X, Y, 17L), do not increase the power of a Turing Machine?
I am designing a poker agent with different heuristics to decide whether to raise, fold or pass (in Texas holdem poker). I am planning to have 4 heuristics with the agent biased to one of them. The poker game will consist of 10 agents playing against each other. I have two heuristics now: bluff - Agent would keep bett...
On page 16 of this algorithms book, it states: For example, suppose we are choosing between two algorithms for a particular computational task. One takes $f_1(n) = n^2$ steps, while the other takes $f_2(n) = 2n + 20$ steps (Figure 0.2). He then goes on to say: This superiority ... (of $f_2$ over $f_1$) ... is captur...
I thought associative array (i.e. map, or dictionary) and hashing table were the same concept, until I saw in Wikipedia that For dictionaries with very small numbers of bindings, it may make sense to implement the dictionary using an association list, a linked list of bindings. ... The most frequently used general...
I would like to ask you some clarification on the following question: know that ${\sf NP}$ is a subset of ${\sf IP}$ and also ${\sf coNP}$ it is a subset of ${\sf IP}$. So ${\sf IP}$ is a biggest class, but how much it is big? May i say that ${\sf PSPACE}$ is a subset of ${\sf IP}$? or that they may intersect? Can you...
From Wikipedia A hash function is any algorithm or subroutine that maps large data sets of variable length, called keys, to smaller data sets of a fixed length. For example, a person's name, having a variable length, could be hashed to a single integer. The values returned by a hash function are called hash va...
There are $N$ number of people and $X$ amount of objects with different values. Each person will choose an object and will obtain that objects value. If multiple people choose the same object then the value of the object is shared among the people. For example, If there are 2 objects and 3 people, one of the objects wi...
We are given a labelled directed graph, where both vertices (or states) and edges (or transitions) have labels. Informally, two states are bisimilar when they have the same label and they can simulate each other's transitions. On the states the two states evolve to, the same again is true. More formally, a binary relat...
I'm having difficulty with the following question: Given a bit pattern with mantissa $10110000$ and exponent $0111$, what does the bit pattern represent in denary (i.e decimal / base 10)? I got the right answer(!) but the wrong (or alternative) work: Convert the exponent to denary: $0111$ is $7$ Apply this exponen...
I'd really like your help with proving the following. If $\mathrm{NTime}(n^{100}) \subseteq \mathrm{DTime}(n^{1000})$ then $\mathrm{P}=\mathrm{NP}$. Here, $\mathrm{NTime}(n^{100})$ is the class of all languages which can be decided by nondeterministic Turing machine in polynomial time of $O(n^{100})$ and $\mathrm{DTime...
Given a max heap with extract-max operation. The basic version takes $2 \log n$ comparisons. How can I make the running time just $\log n + \log\log n$ comparisons? How about $\log n + \log\log\log n $ comparisons? I thought of putting $-\infty$ on the heap root but not really sure what to do with it as it can go anywh...
A book I am reading demonstrates how $5n^3 + 2n^2 + 22n + 6 = O(n^3)$, which I believe is true. After all, there exists a value $c$ for which $cn^3$ is always greater than $5n^3 + 2n^2 + 22n + 6$ for all $n$ greater than or equal to some value $n_0$. However, the book then casually notes that $c = 5$ and $n_0 = 10$. Wh...
Hopefully this is the right section. I need to prove that $2^{(log(n)^{1/2})}$ is $O(n^a)$. From the basic principle of Big-O notation, I know I need to find two numbers $c$ and $N$ so that $f(n) \le c\cdot g(n)$ for all values of $n \ge N$. In this case, $f(n)$ is $2^{(log(n)^{1/2})}$, and $g(n)$ is $n^a$. The first p...
I'm currently working on this question as part of some homework, it has me stumped. I'm familiar with finite state automata (FSA), I know how they work and I've read everything I can find on Google, but nothing's helped me come any closer to a solution. If I don't know the length of the input string, or I'm not search...
I have been told than $n^{1000001} = O(1.000001^n)$. If that's the case, there must be some value $n$ at which $1.000001^n$ exceeds $n^{1000001}$. However, when I consult Wolfram Alpha, I get a negative value for when that occurs. http://www.wolframalpha.com/input/?i=1.000001%5Ex+%3D+x%5E1000001 Why is that? Shouldn't ...
I'm trying to understand a formalization of the shortest path algorithm to a linear programming problem: For a graph $G=(E,V)$, we defined $F(v)=\{e \in E \mid t(e)=v \}$ and $B(v)=\{ e \in E \mid h(e)=v\}$ where $t(e)$ is a tail of a node, and $h(e)$ is a head of a node. Also the solutions for the conditions for the...
I am trying to understand if someone can apply an NTM to recognize a $coNP$ language. From the definition we know that: $NP$ - set of languages that can be recognized by NTM in polynomial time. $coNP$ - set of all languages that are complement to $NP$ language. as with $P$ vs. $NP$ question, we have $NP$ versus $coNP$ ...
I gotta make a CFG and PDA for the grammar that has perfectly nested parentheses and brackets. $\qquad\begin{align} S &\to [S] \\ S &\to (S) \\ S &\to SS \\ S &\to \varepsilon \end{align}$ Not sure if this is correct, or how to make the PDA from it?
I'm just curious about the pseudocode (or real source code, doesn't matter) of the recursive version of this algorithm. In almost every book chapter/paper when describing this topic, they mention that the recursive version takes exponential time and then they give the code for the dynamic programming approach. I unders...
In the theory of distributed algorithms, there are problems with lower bounds, as $\Omega(n^2)$, that are "big" (I mean, bigger than $\Omega(n\log n)$), and nontrivial. I wonder if are there problems with similar bound in the theory of serial algorithm, I mean of order much greater than $\Omega(n\log n)$. With trivial...
I was offered by a professor to give some tutoring in his course of Algorithm Design, based on Kleinberg and Tardos' book. He suggested me to prepare two exercise on dynamic programming, one exercise for polynomial reduction, and another one for approximation algorithms.The exercise should be not too advanced, but not ...
Given that the Hamiltonian cycle problem is NP-complete, I want to prove that the following problem is NP-complete: Given an undirected graph $G(V,E)$ and vertices $s,t\in V$, does there exist a path from $s$ to $t$ with at least $k$ edges such that all vertices in the path are distinct? I thought of assigning a ...
I'm trying to solve a problem: I have 11 ciphers encoded with the same key. My aim is to decode target cipher. If I do xor C1, C2 (ciphers encoded with the same key) I do get M1 xor M2 (where M1, M2 are plain text messages). Please say what to do next. I don't understand how to get plain texts from M1 xor M2 UPD: it's ...
I have a contiguous ordered data structure (0 based index): x= [1/3, 1/3, 1/3] Let's say I selected index 1 and increased the probability by 1/3. Rest of the probabilities each decrease by 1/6 and the total probability remains P = 1. x= [1/6, 2/3, 1/6] Let's say I selected index 2 and increased the probability by 1/...
There may be a large number of algorithms proposed for generating graphs satisfying some common properties (e.g., clustering coefficient, average shortest path length, degree distribution, etc). My question concerns a specific case: I want to generate a few undirected regular graphs (i.e., every node in these graphs ha...
A depth first search produces a spanning tree. If you perform DFS using all possible orderings of the adjacency list, wouldn't you find the minimum spanning tree? In other words, there is no example of a graph where a DFS won't find the minimum spanning tree regardless of how the adjacency list is ordered. Is this corr...
I recently came across the following interesting problem - one is given a sequence of Xs and Ys such as XXYXYXYYXYXXXYX, and consider a sequence to be good if, as you start at the left and move right, the number of Xs is greater than or equal to the number of Ys at any point except at the very end, at which the two qua...
Could anyone please explain Cantor's diagonalization principle in simple terms?
I want to draw a Voronoi diagram with 9 sites and with no vertex, 1 vertex, 4 vertices, and 7 vertices. How do I approach this question. The one with no vertex is easy, it can be done by collinear points. What about the others. A figure for each would be appreciated.
Given a set $A=\{a_{1},a_{2},a_{3},\ldots,a_{n}\}$, then construct a set $P=\{p_{1}, p_{2}, p_{3}, \ldots , p_{n}\}$ such that $|p_{i}|=a_{i}$, and $\sum_{i = 1,}^{n}p_{i} = 0$. This problem is NP-complete, which I want to prove. How do I do it? I am thinking of a reduction from the subset sum problem. But the pro...
Assume that we are given a real life graph, DBLP network in my case, where degree distribution of nodes follows a power law (many nodes have 1, 2 neighbors, and only a few nodes have hundreds of neighbors). A random walk ends when it returns to the initial node or when the walk takes 3 steps. If we start random walks f...
I have a complex query $Q$ used to search a dataset $S$ to find $H_\text{exact} = \{s \in S \mid \text{where $Q(s)$ is True}\}$. Each query takes on average time $t$ so the overall time in the linear search is $t\cdot |S|$. I can break a query down into simpler sub-queries q_i and find $H_\text{approx} = \{s\in S \mid ...
Topic: The maximum feasible subsystem problem, which is generally NP-hard [1]. Question: Are there special algorithms in case of only 2 variables (2D linear constraints)? The problem seems to be a lot less complex in my humble opinion but is this true? Can you guys point me to any algorithms/papers for this limited cas...
Having a unsupervised algorithm done on a dataset (e.g. K-means), how can I determine which cluster is normal and which is anomalous (for 30 clusters, for example)? If the dataset contains normal traffic much more than anomalies (99%), then the radius of clusters associate to normal traffic is bigger. Is this true? Wh...
This is a question from the Dragon Book. This is the grammar: $S \to AaAb \mid BbBa $ $A \to \varepsilon$ $B \to \varepsilon$ The question asks how to show that it is LL(1) but not SLR(1). To prove that it is LL(1), I tried constructing its parsing table, but I am getting multiple productions in a cell, which...
So I have a fun little problem. It will take a minute to explain, but the situation is conceptually very simple. Suppose you have a string of characters, which is interpreted as groups of one or more contiguous characters. This is for run length encoding or something. For example: zz22344a is two z's, two 2's, one 3, ...
I am having diffuculties understanding the principle of lookahead in LR(1) - items. How do I compute the lookahead sets ? Say for an example that I have the following grammar: S -> AB A -> aAb | b B -> d Then the first state will look like this: S -> .AB , {look ahead} A -> .aAb, {look ahead} A -> .b, {look ahead} I ...
I am implementing the cycle-canceling algorithm to find an optimal solution for the min-cost flow problem. By finding and removing negative cost cycles in the residual network, the total cost is lowered in each round. To find a negative cycle I am using the bellman-ford algorithm. My Problem is: Bellman-ford only finds...
There are N players and M objects, each of the objects has a value. Each player has a strategy in choosing an object. Each round a player will choose an object, many players can choose the same object. However the value of each object is divided evenly among every player that has chosen it. There will be 9000 rounds(ch...
I'm looking for an efficient algorithm to find the longest repeated pattern in a string. For example, consider the following string of numbers: 5431428571428571428571428571427623874534. As you can see, 142857142857 is the longest pattern which is repeated for a couple of times (at least twice) in this string. The rep...
A TM to accept EVEN-EVEN (a collection of all strings with an even number of a's and an even number of b's) can be based on the algorithm: Move up the string, changing a’s to A’s Move down the string, changing b’s to B’s Modified algorithm: To avoid the problem of crashing on the way down the $Tape$, change the lette...
When I read about NP-completeness for the first time, I really wondered why is the concept of reductions given such high emphasis, after all we have been looking at concepts such as reductions and 'special case of one another problem' in mathematics since elementary algebra. What I mean by reductions in algebra is the ...
I have a question about inheritance in Java-like OO programming languages. It came up in my compiler class, when I explained how to compile methods and their invocation. I was using Java as example source language to compile. Now consider this Java program. class A { public int x = 0; void f () { System.out.printl...
Taking an NP-complete problem like vertex cover if we can find a reduction which is exponential and not polynomial and the reduction we do to a problem can be solved in polynomial time, then what would be it's implications? Based on Yuval's answer, I wanted to throw this scenario into the place also. If we have a probl...
I have to sketch an IP proof for the minSAT problem. The minSAT problem is define in this way: For a given formulae find a satisfying assignment with a min subset of variables assigned to True; My sketched IP protocol is: Prover and Verifier share the input formula Prover sends to the Verifier a set of variables ass...
Given a binary expresion tree, with addition and multiplication operations, how can we optimize it's evaluation? Can we learn from matrix chain multiplication? A generalization of matrix chain multiplication is defined as: Given a linear sequence of objects, an associative binary operation on those objects, and a way ...
I'm a university student, and we're currently studying Lambda Calculus. However, I still have a hard time understanding exactly why this is useful for me. I realize if you do loads of functional programming it might be useful, however I reckon that it's not really needed for learning functional programming, what do you...
Suppose I have a directed graph with edge weights drawn from range $[1,\dots, K]$ where $K$ is constant. If I'm trying to find the shortest path using Dijkstra's algorithm, how can I modify the algorithm / data structure and improve the time complexity to $O(|V|+|E|)$?
I know the term order of a B-tree. Recently I heard a new term: B tree with minimum degree of 2. We know that the degree is related to a node but what is the degree of a tree? Does degree impose any kind of a restriction on the height of a B-tree?
I have ordered a few leather sheets from which I would like to build juggling balls by sewing edges together. I'm using the Platonic solids for the shape of the balls. I can scan the leather sheets and generate a polygon that approximates the shape of the leather sheet (as you know, it's animal skin, and it doesn't com...
If a graph with $n$ vertices has more than $\frac{(n-1)(n-2)}{2}$ edges then it is connected. I am a bit confused about this question, since I can always prove that for a graph to connected you need more than $|E|>n-1$ edges.
Let us say you have a group of guys and and a group of girls. Each girl is either attracted to a guy or not, and vice versa. You want to match as many people as possible to a partner they like. Does this problem have a name? Is it feasibly solvable? Sounds hard to me... Ps. note that since the attraction is not neccess...
I am studying formal languages and playing with writing my own parsers for them. I have a context free grammar parser already that works well. I am wondering if anyone can point me towards actually implemented examples of rewriters. For example, suppose I had the rules WORD: [A-Z]+ QUOTE: " And I wanted to input a lot ...
Why LL(k) and LL(∞) are incompatible with left-recursion? I understand that a LL(k) language can support left-recursivity provided that with k-overahead tokens can be resolved any ambiguity. But, with a LL(∞) grammar, which type of ambiguities can't be solved?
I've been searching google scholar for references and narrowed down the first mention to somewhere around 1963 with a very weird jitter in 1949. So, I'm trying to track down the original paper introducing interval graphs for citation, but it's been rather elusive so far.
If we let the physical memory size remain constant, What effect does the size of the page have on the number of frames? What effect does the number of frames have on the number of page faults? Also, please provide reference strings as an example.
We covered this in class today. I understand the mechanics of it, but aside from being a nice example of recursion does it serve any purpose? Searching the web reveals lots of pages with the formula and it's implementation in code, some talk about the author, but nothing about it's purpose.
Possible Duplicate: A variant of the Assignment Problem (Not a comp.scientist, but have the basic research. Please excuse me if I've overlooked anything obvious.) In my variant of the problem I have a set $A$ of agents and a set (of possibly different cardinality) $T$ of tasks. Each agent needs to be assigned exactl...
I have a bunch of databases, each having different access patterns, such that each puts a different amount of load on its database cluster. I would like to distribute them around my set of database clusters such that the workload for the clusters is evenly distributed. I looked at the k-partition problem, which sounds...
I'm currently studying for an algorithms midterm in about 2 days and am reading from the beginning of the course, and stumbled upon this when I actually looked at the examples. The question equation: $f(n) = 6n^3 + n^2\log n$ The exact line written for the answer is: $f(n) \leq 6n^3 + n^2 \centerdot n \text{, for all }...
Consider a straight highway in the plane which can be modelled by a horizontal strip in the plane. A finite set T of targets are located on the highway, and a finite set S of wireless sensors are located outside of the highway. A sensor s can monitor a target t if and only if the Euclidean distance between s and t is a...
$T(n)=2T(n/2) + n\log^2(n)$. If I try to substitute $m = \log(n)$ I end up with $T(2^m)=2 T(2^{m-1}) + 2^m\log^{2}(2^m)$. Which isn't helpful to me. Any clues? PS. hope this isn't too localized. I specified that the problem was a squared logarithm which should make it possible to find for others wondering about the sa...
I am unsure if I have even identified the problem correctly, but reading up on knapsack problem seems the closest to what I am trying to solve: A cook has $k$ ingredients of $p$ quantities. Given a list of $n$ unique recipes, each consisting varying ingredients of varying quantities. Now, the cook would like to...
I have a dynamic programming problem: If I have a set of sensors covering targets (a target might be covered by mutiple sensors) how can I find the minimum cost subset of sensors covering all targets given each sensor has a cost? I have thought a lot about this, but I can't reach the recursive formula to write m...
Are there programming languages(or logic) that can implement(or express) a function $f:\mathbb{N}\to \mathbb{N}$ if and only if $f$ is a computable bijective functions?