instruction
stringlengths
35
29.1k
I read that tiling problems can be modeled as satisfiability problems (2-SAT?), but the author did not explain how. Is this true? What would be an example? By a "tiling problem" I mean you have a matrix and have to fill it up according to some constraint. For example, you might have to fill the matrix with a particular...
The following undirected version of Bounded Diameter Spanning Tree problem is solvable in Polynomial Time. Undirected Version: Given an undirected Graph $G = (V, E)$ with each edge weight either 1 or 2; 2 positive integers $B$, and $D<=3$. Problem Statement: Is there a spanning tree $T$ of $G$ such that the sum of ...
$L=\{\langle M \rangle \mid \text{There are infinitely many words accepted by M in less than 10 moves}\}$ I am having hard time understanding this language and I have several questions: How is it possible to derive infinite amount of words in finite moves? How can we determine if a word is or isn't in the language at...
In textbook by Vazirani's textbook, chapter 9 about Bin Packing. He give the following lemma. Lemma 9.4 Let $\epsilon >1$ be fixed, and let K be a fixed nonnegative integer. Consider the restriction of the bin packing problem to instances in which each item is of size at least $\epsilon$ and the number of distinct ite...
I have an optimization problem and I'm looking to find an algorithm whitch best fits this. The problem is the following: There are several points of interest (POI), each has a value (for the user), the distance to each other POI is also known. Now I want to generate the best tour (ordered list of POIs) with the most va...
I have a binary $m \times n$ matrix of rank $m$ (hence $m < n$). I need to count how many subsets of its columns form matrices with a full column rank, i.e. columns in the subset are linearly independent. Straightforward approach would be to iterate over all subsets of columns of size up to $m$ (because column rank can...
Interpretation: Consider the comic strip below, where a person tries to prevent a robot from dismembering them by asking the robot to compute $\pi$ - the robot quickly produces an algorithm to calculate all of the digits of $\pi$ and begins dismembering the person. This is possible because $\pi$ is a computable number....
In this question : Does $NP^{NP}=NP$? , it says that one of the reason is that we don't know how to detect 'no' answers from the oracle. Why is that true though? There is an NTM for any language L in NP, that runs in polynomial time. IIRC we can simulate the NTM with a deterministic TM M that runs in exponential time, ...
I already saw similar question Counting elements that are greater than the median of medians but I couldn't find my answer in there. CLRS (3rd ed.) give an algorithm for $O(n)$ worst case arbitrary order statistic of $n$ distinct numbers. This is the algorithm: Divide the $n$ elements of the input array into $\lfloo...
We were said at school that the language $L$ over an alphabet $\sum = \{a,b\}$ where the number of $a$'s is twice the number of $b$'s, formally $L = \{ w \in \{a,b\}^* \mid |w|_a = 2|w|_b \}$ cannot be generated by linear grammar. I was wondering, is there a way to prove it, to make it clear why is that so? I was thi...
Problem: Let $G = (V,E)$ be an infinite digraph, such that $V = \mathbb{N}$, and $E \subset \mathbb{N}\times \mathbb{N}$ is decidable set. Does it imply that $\delta (i,j)$ is a total function? *(where $\delta (i,j)$ is the shortest path function between vertex $i$ and $j$). I'm having a hard time trying to und...
Given an automata [DFA $A=(Q,Σ,δ,q_0,F)$], is there a way to determine whether it accepts an infinite or finite language?
I have $N$ data points of some dimension $D$. I want to know the dimension of the shape that those data points represent - for instance they might be a 2 dimensional triangle, even though they are in 8 dimensional space. A way of doing this mathematically is to pick one of the points and subtract it from all of the oth...
I know this question may seem weird, mainly, why the context (OS, kind of system, etc) isn't explicit. I am studying for an exam, and, according to the studies guide, one of the questions types can be: "Assuming that a system has a large volume of access, and has a restricted capacity of devices. What difficulties woul...
A 1-bit register: Credit: Elements of Computing Systems by Noam Nisan and Shimon Schocken ISBN-13: 978-0262640688 I know that the data flip flop outputs the input at the previous time step. Based on this, I created this table (not sure if correct): Note: For the Mux, 1 is for in and 0 is for DFF output. $$ \be...
I am exploring variations of trees. I know that a quality which is sometimes desired is balance in the tree so that tree depth is reduced. But I am imagining that in situations in which several paths of a tree have to be explored such as in an R-tree, balance might not always be necessarily desired?
This one goes both ways at this point in my computer science studies... Is it scripting in the same sense as a Python script (for example)? Are they the same? I'm learning Javascript at the moment as part of a Web design textbook but at the very start of my programming lessons I got quite far in programming with Pyth...
For example we could say alg(x) runs big omega(n) but this bound is not "tight". What is meant by "tight"? Is it that the bound isn't at its maximum? So maybe a tighter bound could be big omega (1)??
Ultimately, when you compile them to machine code, algorithms are just 1's and 0's. So then - could you brute force the genesis, and thus the discovery of new, useful algorithms? Say, in pursuit of polynomial time algorithms for NP-complete problems. Of course, rather than pure brute force, perhaps some intelligent for...
Given $n$ strings consisting only of '$($' and '$)$', how one can compute the length of the longest string that can be built by concatenating a subset of these strings in some order such that the resulting string is a balanced parenthesis? Example: If we have the strings $\{"(()",")(",")","(("\}$, one can build the str...
Is there any known lower bound on the complexity of subset sum problem? For example, could it be solved in linear time using logarithmic space?
I have a DAG of tasks designed as: DAG { Dictionary<NodeAddresses,Node> } Node { List<Node> Parents; List<Node> Children; Task T; } This DAG is assumed to never change over time. Now, I want to create an algorithm that, when given a NodeAddress, will execute the corresponding task, and all subsequent tasks in ...
The question is as follows: Let's observe the following Post correspondence problem. Input: Two finite lists of words $A$ and $B$ and a natural number $k$. Question: Is there any words correspondence with a length of $k$ at the maximum? Describe an algorithm to solve the problem and analyze its runtime. I really don'...
I'm asking this question because I was confused by some of the articles in the internet. I already know that the asymptotic lower and upper bounds of insertion sort is $\Omega(n)$ and $O(n^2)$. Therefore according to my understanding of the $\Theta$ notation, we cannot make a statement about the $\Theta$ for all cases....
Let $G=(V,E)$ be an undirected graph,such that ever $e\in E$ has a color-blue or red. Given $G$ and some $s,t\in V$ ,find an efficient algorithm that find from all pathes from $s$ to $t$,one with an even amount of red edges,and minimal amount of blue edges. For the part of the even amount of red edges,I know that I c...
Theorem 6.20: If $\mathsf{EXP\text{}} \subseteq \mathsf{P_{poly}\text{}}$ then $\mathsf{EXP\text{}} = \Sigma_2 ^{p}$. My attempt : Let $L \in \mathsf{EXP\text{}}$. Then $L$ is computable by an $2^{p(n)}$-time Turing machine $M$, where $p$ is some polynomial. Let $x \in \{0,1\}^n $ be some input string. For every $i ...
I know the general basics of how RISC and CISC processors differ, but I also want to know whether the two differ in the way they handle interrupts.
According to the Wikipedia articles, In information science, profiling refers to the process of construction and application of user profiles generated by computerized data analysis. This involves the use of algorithms or other mathematical techniques that allow the discovery of patterns or correlations in la...
I tried to follow with SAGE the solvability of solvable quintic polynomial. I took the example of the solvable polynomial $f=T^5+15T+12$, fully studied in Dummit. I understand that the splitting field $L$ is radical with $[L:\mathbb{Q}]=20$. The square root of the discriminant is (SAGE) $2^53^25^2\sqrt5$ so we have a ...
The context is IEEE 754-2008 floating point number systems. The systems defined by the standard comprise, as far as I understand it, a bit-level representation and a set of guarantees on the precision for a given number of computations. Now, I am wondering whether floating point numbers, i.e., the objects represented a...
I'm trying to understand this proof in Peter Linz's book The math just doesn't make any sense, I don't understand how this is a proof. First of all, the author says let's define a language such that: for all i>0: a^i ∈ L(Mi) That seems ok. Then he says let's consider the complement of L. L'={a^i:a^i ∉ L(Mi)}. How is t...
I know this might sound like a newbie question but let's say we have a priority based scheduling algorithm (non-preemptive) where all processes arrive at time 0 and based on priority the order is P1, P2, P3 ... The processes will run P1, P2, P3 without having to block one to let another one run, each processes will ru...
Let G be a directed graph such that every two vertices are connected by a single edge. How do I proof that such G has an hamiltonian path?
In Sipser, It is given Pg. 284 Let t(n) be a function, where t(n) ≥ n. Then every t(n) time non-deterministic single-tape Turing machine has an equivalent 2 O(t(n)) time deterministic single tape Turing machine In the given proof, at end they conclude O(t(n)bt(n)) = 2O(t(n)). where b is the maximum number of legal c...
Under the assumption that P would be equal to NP, it could exist a NP-complete problem that is solved in constant time?
Is it necessary to have a separate IO chip for each peripheral in the system? If not, how would this be handled? Where would any additional circuitry be located?
I'm new to coding theory and formal proofs, and am struggling to understand how to construct and reason about prefix-free encoding algorithms on algebraic data types. I hope it's clear if I use notation from haskell below. I'm tasked with writing a generic prefix encoding algorithm (encode) on ADTs, as well as giving g...
I am trying to build knowledge base in OpenCog cognitive architecture (http://wiki.opencog.org/w/The_Open_Cognition_Project) and I see that OpenCog lacks usual means to express notions of object-oriented modelling paradigm. E.g. OpenCog has no classes, but it has concepts (concrete concept can be class or instance, or ...
What are the steps required to perform average case analysis? Basically, how do you attempt average case analysis? There exists a series of steps that need to be taken to perform it right? I am just not sure what these are (and can't seem to find any good material explaining how to do it).
I am trying to understand the time complexity of the word break problem which uses the backtracking recursive approach. It is O(2^N). Well lets take an example abcd as input with the recursive approach naive, the recursion tree will be something like this abcd /.... \ ...
In The (New) Turing Omnibus by A K Dewdney, chapter 2, it says: Moreover, for every regular expression there is an automaton which accepts the language symbolized by that expression. Thus, in a sense, regular expressions capture precisely the behavior of automata in terms of the language they accept. However, for ever...
I have a normal (7,4,3) Hamming Code over GF(2) and a parity check matrix for it (not posted, because I don't think it's involved). I have a set X of 4 bit source vectors called x. They all have equal probability to be sent. So I would assume p(x) = 1/16. They are sent over a BSC with the bit error probability p=0.15. ...
The idea is to find an anomalous value (i.e. it's less than X) in time series data (sorted by time), and check if this behavior continues during specified time (Y=2 hours). If all values in sub-array (which represents 2 hours period) are ≤ X, the subarray is returned as a result, and we do not continue further. Else ...
Claim : $\cup_{c,d} $ DTIME$(n^c)/n^d \subseteq$ $P_{poly}$ Proof : if $L$ is decidable by a polynomial-time Turing machine $M$ with access to advice family $\{\alpha_n\}_{n\in \mathbb{N}}$ of size $a(n)$, then we can use the cook-levin construction for every $n$ a polynomial-sized circuit $D_n$ such that on every $x...
Following are some definitions from CLRS: DEFINITIONS : 1. Cut (S ,V-S) : of an undirected graph G = (V,E) is a partition of V(as defined in CLRS Book) .You can think it as a line that divides graph into two disjoint sets of vertices on its either side. 2. Light edge:Any edge crossing a cut is light edge if its we...
I'm reading Combinatorial Optimization book by Bernhard Korte and Jens Vygen. There's a part that they said: It is an open question whether each $NP$-hard decision problem $A \in NP$ is $NP$-Complete, because of the difference between polynomial reduction and polynomial transformation. I understand that, but when I r...
I was under the impression that our computers, being finite, are ultimately no more powerful than (extraordinarily large) Finite State Machines. However, Linearly Bounded Turing Machines are also finite, but it seems that Regular Languages are strictly an improper subset of Context-Sensitive Languages. Obviously, I'm ...
Floating point number formats can be normalized or not, meaning that ‘normal’ floating point numbers have an implicit (hidden) leading bit 1 in the significand. For example, the binary IEEE 754 formats are normalized, but the decimal IEEE 754 formats are not, i.e., they have an explicit leading bit (or number). The adv...
I am working on a algorithm for acoustic scattering in two dimensions using MatLab, and one of the advantages of this algorithm is that Hankel functions can be replaced with log functions. For example consider the following: value = 0; tic; for t=1:100000, value = value + besselh(1,1,abs(1+1i)); end; toc value = 0; ti...
I was taught in my operating systems class that sections of memory in the heap are marked as free/occupied through the use of memory control blocks (MCB). The generalized definition of an MCB that was given to us is that they hold two memory addresses (one for the next MCB and one for the previous MCB), the size of the...
I'm reading a paper by David Monniaux An encoding of array verification problems into array-free Horn clauses. Second page Line 10: "Very often, desirable properties over arrays are universally quantified; e.g. sortedness may be expressed as : $\forall k1,k2\, k1 < k2 \supset a[k1] \leq a[k2]$ Formulas with universal q...
Suppose I have a language $L$ (over alphabet $\Sigma$), such that $$ w \in L \iff (\forall x \in \Sigma^*) (\exists y \in \Sigma^*) P(x,y,w). $$ and I can give a turing machine that decides $P(x,y,w)$ in polynomial space in $w$, where $x$ and $y$ are given as separate read-only, forward-only tapes. That is, on input $x...
I want to dive in alghorithms and data structures and maybe AI this year. When I searched on internet everybody was recommending to read clrs. But I found it very complicated, because of the amount and the level of math in it. Is reading clrs really important to be a true computer scientist. If yes, how it can be easie...
Let us assume that we have the following (non linear) program : R = min { ( (c1^T)*x + d1 ) / ( (c2^T)x + d2 ) : Ax<=b , (c2^T)*x+d2>0} We also assume that the feasible solution area is bounded and that the objective value of the optimal solution belongs to [L,U]. We assume that we know a δ >0 , so that for every feasi...
Could a programming language be designed so that there is an inheritance relationship between string and character (both of which are native types), such that the inheritance alone resolves the use of an arbitrary binary operator between the two types: <string> @ <character>; coercion and overloading cannot be used. My...
Consider the model $(\mathbb{N},+)$; that is, the natural numbers equipped with the addition relation, PLUS($x$,$y$,$z$), where PLUS($x$,$y$,$z$) is true iff $x + y = z$. Let Th$(\mathbb{N},+)$ be the theory of this model; that is, the set of true sentences in the language of the model. For example, the sentence $\fora...
I understand how radix sort works and how to implement it, but I don't understand why it works. Are there any underlying mathematical or logical principles that it relies on?
Name a data structure that you could use to implement a queue such that all of the standard queue operations are O(1). If you are thinking of a data structure based on Python's built in list, you need to be more specific then just writing "list". O(1) is constant time and I know that you can use lists to replace using...
Suppose we have the language $ \overline L = \{x∈\{0,1\}*:x∉L\}$ And we know that $A ≤ HPL ≤ \overline A$ where HPL is the Halting problem. We need to state whether A is finite, countably infinite and whether $A$ and $ \overline A$ is recursive or not or re or not. We know that A reduces to HPL and HPL is re and t...
It seems that if we only have object-key cache then we won't have spatial locality and only temporal locality. I use memcached in a python application and that has only object-key pairs and no hierarchy. Is this observation correct and why don't object-key caches behave more like physical cache memories where the latte...
This is a question from a past paper. I am struggling to get my head around the concept of a PDA. I understand that it is a Finite Automaton with a stack but am stuck as far as answering questions like this one. Thanks.
I have been studying unification, especially nominal unification (paper) gets my attention. I read the theory and examples. But I am wondering that what kind of problems occur in unifications. For examples, The following examples are from nominal unification paper. (I write distinct bound variables, so easier to see th...
Let's say I want to define a function: This function multiplies an input by two, adds one to this integer, then divides it by two in that order. f represents the multiplication, g represents the addition, and h represents the division. Could I represent this as λx.fxgh, when explicitly defined with parentheses is shown...
I implemented my ANN using SKlearn module's class MLPClassifier. Fitting it on some data and testing it on a very specific subset of said training data, it gives a score of 1.0, but actually using the ANN to generate outputs for said testing data almost always gives incorrect output. What could be the possible reasons ...
Input: A set $N = \{1, \dots, n\}$, subsets/consecutive pairs $S_1 = \{1,2\}, \dots, S_n = \{n,1\}$ with associated costs $c_1, \dots, c_n \in \mathbb{N} \cup \{0\}$, and a subset $B \subseteq N$. Output: A collection $\mathcal{S} \subseteq \{ S_1, \dots, S_n \}$ that minimizes $\sum_{S_i \in \mathcal{S}} c_i$ and cove...
I'm having trouble coming up with a 5-state DFA that, on all inputs of length 8, recognizes the string 00001111 and no other string (of length 8). The DFA must have an exiting transition for every symbol in the alphabet (namely {0, 1}). The behavior on input of other lengths does not matter. A 6-state solution is prett...
I am having a bit of trouble wrapping my mind around what a ranked binary search tree is and why having a rank is important. I am hoping that someone can clarify a few things for me. What I have looked into: From what I have read, a ranked binary search tree is a tree where each node has a variable "rank" attached to i...
Question: Suppose you launch a job on 10,000 machines in your own data centre. The job is slow to start because all the machines are trying to load the same large executable file. Name two networking technologies you could use to distribute the file faster, in addition to storing it on more replicas. Explain why each is ...
I understand that many algorithms have space/time tradeoffs-that is, to run faster, you can do things like caching data, which reduces time taken in exchange for space consumed. Given conservation of energy and spacetime equivalence, is there any relationship between the time saved by using extra space and vice versa? ...
I have always tried to understand the difference between all the above, but I always ended up being confused. The field I am referring to is cryptography in particular, but I guess this question is valid for all of computer science. Is there a proper way to understand and differentiate them all? -- In my notes so far: ...
A Horn clause is a disjunctive clause of literals containing at most one unnegated literal. Examples are $$ \neg p \lor \neg r \lor \neg q,\\ \neg s \lor q,\\ \neg s \lor \neg q\lor r,\\ s,\\ \neg r \lor t,\\ \neg q \lor \neg t\lor p. $$ Determining whether or not a set of Horn clauses is simultaneously satisfiable tak...
I need to create a correct evaluation of the method I'm proposing. The problem is that in the field I'm working on there is no benchmark that I can use for this purpose. On the other hand, my method has to run, as much as possible, on top of "real documents", but these documents are mostly private and created by indust...
Let $x_i,x_{ij}\in\mathbb{R}$ and $b_i\in\{0,1\}$ for all $i,j\in\{1,2,\ldots,n\}$ and $j>i$. I want to know which of all the possible boolean combinations make(s) the following expression maximal: $$\sum_i b_ix_i+\sum_{j>i}b_ib_jx_{ij}$$ I can think of greedy heuristics (for example, identify the $x_{ij}<0$ and then s...
I was wondering if this is true. I already proved that it is true for regular languages and I assume it is similar in context free languages (correct me if I am wrong), but what about languages in R that are not context-free?
def f(n): i = 2 while i < n: print(i) i = i * i I evaluated an expression that becomes something like 2^n or 2^2^n and set that equal to when the loop breaks or (2^2^n ) (>=)n but can't figure out how to get a runtime. Can someone show how to do complete this analysis and get a runtime?
I have two problems, one of which is solved using dynamic programming. I showed that it is NP-complete (a knapsack variant), therefore having this dynamic programming solution says that this one is weakly NP-complete. Right? Then, in the second problem I have added a new dimension to the problem which makes is more com...
Visibly pushdown automata [1] are pushdown automata in which input symbol determines whether push or pop operation happens in the stack. Does anyone aware of tight lower bound for their emptiness checking complexity? [1] Rajeev Alur and P. Madhusudan. 2004. Visibly pushdown languages. In Proceedings of the thirty-sixth...
Problem description I am trying to understand the first example of Big-Oh notation in Computational Complexity:A Modern Approach page 9. If $f(n) = 100nlogn$ and $g(n) = n^2$ then we have the relations $f = O(g)$, $g = Ω(f)$, $f = o(g)$, $g = ω(f)$. I understood why $f = O(g)$ and $f = o(g)$ . As for the rest I didn't...
Can someone please show me examples of what is the difference between OLR (one literal rule) and PLR (pure literal rule) using the DPLL algorithm?
Alan Turing states that, there can't be a program that can decide if a program will ever stop. But with such advances in AI, won't computers will be able to analyze code and decide like humans on whether a program will halt or not. Am I missing something in his claim? Or is it too fictitious?
Given: Collection $C$ of Subsets of a finite set $S$, positive integer $K <=|C|$ Problem Statement: Is there a collection $B$ of subsets of $S$ with $|B| = K$ such that for each subset $c$ in $C$, there is a sub-collection in $B$ whose union is $c$ ? This Set Basis Problem is NP-Complete. If we enforce an additional c...
I am interested in some kind of algorithm to achieve this. Basically here is the regular expression aa*(ab+ a)* and I want to construct a regular grammar for this. How I can achieve this ? Following are some correct regular grammar for above expression :- S-->aAB A--> epsilon | aA B--> epsilon | aB | abB S-->AB A-->a...
Given an acyclic undirected graph alike to this one : (Here the center is the node '2', and the radius is 5) What is the most efficient (ideally in O(n)) way to compute the radius of the tree ? I've already used different methods like : Computing the eccentricity of every node, and retrieving the minimal value (the ...
Is it possible to reverse engineer sorting algorithm (sorting by comparisons) by sequences of indices of compared elements? We can input any lists of numbers arbitrarily many times. Comparison to existing algorithms and their corresponding sequences is not allowed. Further tests can alter algorithm, so task can be rest...
How many bits we can negate using two/three NOT gates ? I am newbie at this subject so I ask for help. It is about circuits. Edit After reading link given in comments by @D.W I think that I can negate bits without NOT gates. I know that it is impossible, however I don't know where I am wrong. Simply, I can sort...
This Question is taken from the book Neural Networks and DeepLearning by Michael Nielsen The Question: In a single-neuron ,It is argued that the cross-entropy is small if σ(z)≈y for all training inputs. The argument relied on y being equal to either 0 or 1. This is usually true in classification problems, but for other...
I was trying to solve problems in max flow algorithms. And I came across this MIT Lecture Quiz. http://people.csail.mit.edu/moitra/docs/6854hw4.pdf solution : http://people.csail.mit.edu/moitra/docs/6854hw4solns.pdf Questions : (a) In any maximum flow, and for all vertices v and w, either the amount of flow from v to w...
I'm coming to Computer Science from Mathematics and am familiar with the idea of building classes of objects using Propositional Logic. Namely, start with some universe of objects, define some proposition $P \left( x \right)$, and then iterate over the universe of objects, applying $P \left( x \right)$ to each; keep th...
I'm coming to Computer Science from Mathematics and am familiar with the idea of building classes of objects using Propositional Logic. Namely, start with some universe of objects, define some proposition $P \left( x \right)$, and then iterate over the universe of objects, applying $P \left( x \right)$ to each; keep th...
Given a un-directed weighted graph G=(V,E) where V is the set of vertices and E is the set of edges between vertices, and weights are the time delays on each link between two user. The goal is to construct a multicast tree T (that connects source node to a set of nodes say K) such that to minimize the maximum (longest)...
What does the symbol $::$ mean in the following statement? $\forall{x}\in K :: x \longrightarrow x$ A cycle in a graph is a path that starts and ends on the same node. Clearly, if nodes in K lie on a cycle, then $\forall{x}\in K :: x \longrightarrow x$. Look at page 56 in the following. https://books.google.co.in/books...
Let $f$ be some function in some programming language (like C), and we need $n$ bits to store this function. Suppose we have some fixed value $v$ for the argument, then let g() { f(v) } be the function with no argument which just calles $f$ with $v$ as an argument. Then we need $n + |v| + C$ bits to store it, where ...
How to do or implement Lambda Calculus in a Rewriting systems? Rewriting systems are Turing complete. But I can't figure out how to do lambda calculus or functions with them.
I've been given a set $S$ of natural numbers (non-negative integers) $s_1$, $s_2$,...,$s_n$ where $|S|=n$. My problem is to figure out if there is way to get a total sum of 0 when using all the numbers of $S$ but we get to "choose the sign" for each number: that is, for $s_i$ we get to choose if we're going to add or s...
I'm wondering about the time complexity of writing a number as power of 2's. For example writing $n=218$ as $2 + 2^3 + 2^4 + 2^6 + 2^7$. It seems to me that we do $\lceil \log_2n \rceil $ divisions. Each division costs $O(n^2)$ so an upper bound is $O(n^2 \cdot \log_2n)$. However, this seems like a very loose upper bou...
It has been my understanding that, technically, our computers are Finite State Machines. And, since FSMs halt when they run out of input, the halting problem is technically solvable. At some point, we must reach an identical state without consuming input if there is an infinite loop. I also understand that doing this...
Using the diagram of a binary tree and algorithm answer the following: If the following commands store(1,laurence), store(1, ron), store(1,graham), store(1,abe) and store(1,martin) are executed what will be stored at location (3)? ron abe graham empty The answer is ron but I am struggling to work out why. How does t...
Given the recursive function: ($c$ is a constant) $\qquad T(n) = \begin{cases}1 & n ≤ c\\2T(f(n)) + 1 & n > c\end{cases}$ I need to find a $f(n)$ such $T(n) ∈ Θ(log^4 n) = Θ(\log \log \log \log n)$. I tried the iteration method, and it gave me $\qquad 2^i*T($$f1$($f2$(...$fi$($n$)..$))) + i $ which revealing the pretty...
Synopsis Imagine the secretary problem, except the goal is to hire two secretaries with the greatest possible difference between the two. The Problem I'm not particularly comfortable with this type of math so below are the modified constraints. The original constraints are from Wikipedia's page on the secretary proble...
Suppose there exists an algorithm that solves 3SAT in a polynomial number of steps. However, this algorithm requires some 'tuning' parameters, and the value of these tuning parameters take an exponential number of steps(given the input) to determine. Would this place 3SAT in P? (since it can be solved in polynomial ti...