instruction
stringlengths
35
11.4k
The "Common successor"-heuristic ist described here: Motamedi et al.: A Survey of Techniques for Internet Topology Discovery, p. 11, 2015 http://ieeexplore.ieee.org/abstract/document/6970764/ From the above named source: The “common successor” heuristic suggests which two IP addresses may be aliases. This heuristic re...
Will the Traveling Salesman Problem (TSP) become easier if the simple path constraint is omitted? That is, each node in the topological graph should be visited once at least (instead of exactly). Is it still NP-complete or reduced to a P problem? How would this modification affect classical methods for solving the orig...
If I have two number consider a and b and let their division quotient is c. I know the value of c but I don't know either value of divided(a) or divisor(b). If I came to know the value of divisor is increased by one, can I somehow calculate the new value of quotient(c) I guess, maybe using some bit manipulation rules o...
By integers, I mean a whole number. Example: Input : 2, 4, 7, 9, 3, 1, 11 Output: 1,2,3,4 forms an AP (of difference 1) with length 4. An obvious solution is to sort the array with a comparison based algorithm O(nlogn) and then do a second scan through the unsorted array to find the longest sequence. Can we have a b...
Question I want to Implement Rod cutting Algorithm without Dynamic Programming Approach. Let me Describe the problem statement. Given a rod of length $n$ inches and a table of prices $p_{i}$ for $i=1,2,3,4,\,.\,.\,.$ determine the maximum revenue $r_n$ obtainable by cutting up the rod and selling the pieces. In corme...
Link: http://www.spoj.com/problems/MINUS/ I have an Idea, after doing n-1 operations one can see that there is just + and - coefficients before each number that matters. For eg. given sequence: 12 10 4 3 5 and we need to make it a mathematical expression using + and - signs only to get 4 ,one solution will be +12-10...
Let $\Phi$ be a k-CNF and $\Phi_{min}$ be a minimal CNF (one that contains smallest amount of literal occurences) that is equal to $\Phi$. Can $\Phi_{min}$ contain a clause of size $m > k$? What I have tried: Let's define the concept of partial assignment: an assignment that has free variables. Example: $x_1 = 0, x_2 =...
I am learning lambda calculus as my previous questions indicate . But in a different book , namely , The structure and interpretation of computer program I cam across the concept of "church numerals " and the stumbled upon the following link about church numerals : https://www.cs.rice.edu/~javaplt/311/Readings/supplem...
Definitions: An up down language is a language whose alphabet is a set of pairs, but not characters, of two characters, where the one character in the pair is the opposite of the other character in the pair. Each word in the language is concatenation of some characters from the alphabet given in the pairs of the alphab...
I'm reading the AKS primality test paper as it is found here. I'm confused about a statement in Lemma 4.3: "Note that $(r, n)$ cannot be divisible by all the prime divisors of $r$ since otherwise $r$ will divide $n^{\left \lfloor{log(B)}\right \rfloor}$ by the observation above." Here $(r, n)$ is short-hand for $gcd(r...
How can I prove that $NDFA = \{ \langle M_1,M_2 \rangle | M_1$ and $M_2$ are $DFA$s such that there is at least one string $x$ that is accepted by neither $M_1$ nor $M_2\}$ is decidable using the fact that $ANFA = \{\langle N \rangle | N$ is an $NFA$ with some input alphabet $\Sigma$, and $L(N) = \Sigma^*\}$?
I'm trying to create an algorithm for time spent on a blog post which gives a number in the -1 to 1 range. Negative numbers will mean that users spent less than expected time on a post, while positive numbers means the opposite. Now, what I've tried to do so far is to: Set an expected time (in seconds): Expected time ...
I sort of need an explanation on how can I demonstrate that a language formed by strings that are multiples of k, is a regular language I really dont know how
Excuse any mistakes in my description as I'm new to ML. But I have an application that takes user input to generate paths/curves (All symbols are single paths) and I would then like to attempt identification. This seems, generally, to be a pretty well studied problem, and there is a lot of reference I can find. However...
$L = \{wtw' \mid w,w' \in \{a, b\}^*, \hspace{0.3cm} |w|_a = |w'|_a, \hspace{0.3cm} |w|_b=2|w'|_b, \hspace{0.3cm} t\in\{c\}^* \}$. Note : $|w|_a$ means the number of $a$ in substring $w$. To substring $w$, the number of symbol $a$ and $b$ is not relevant to each other. It's also applied to substring $w'$. To make mat...
Assume that we have access to a generative model $G$, that takes as input a state-action pair $(s,a)$ and outputs a sample consisting of a successor state-observation pair $(s',o)$, that is, $(s',o)\sim G(s,a)$. It can be assumed that the states, actions, and observations all take on a finite number of values (can be p...
The graph coloring problem, in which we have to decide whether a given graph can be legally colored using $K$ colors, is NP-complete for any $K>2$. Consider the following more restricted variant of the problem: Given a graph with $N^2$ nodes in which each node has degree at most $2N$. Provided that we can color the giv...
I was given the following CFG : $S \rightarrow A\ |\ B$ $A\rightarrow aAa\ |\ abAb\ |\ bAc\ |\ aca\ |\ abcb\ |\ bcc$ $B \rightarrow bBa\ |\ aBb\ |\ babBc\ |\ bca\ |\ acb\ |\ babcc$ And I have to show if it is ambiguous by giving two leftmost derivations for the same word. I am pretty sure that there are two leftmost de...
Let's say we have a string $s$. We define a unique substring in $s$ as a substring that occurs only once in $s$. How can we efficiently find such a substring with the smallest length in $s$? The most obvious solution is in $O(n^3)$ by checking every substring. What if we can preprocess the string?
I have the following greedy algorithm for max cut problem: Initialization: $A \leftarrow \{v_1\}$ , $B \leftarrow \{v_2\}$ For $v \in V − \{v_1, v_2\}$ do: if $d(v,A) \geq d(v,B)$ then $B \leftarrow B \cup \{v\}$, else $A \leftarrow A \cup \{v\}$. Output $A$ and $B$. Here, $v_1$ and $v_2$ are arbitrary vertices in $...
I am having some trouble understanding the equivalence of DTM's and NTM's. If you have Sipser its under 7.11; where he says that any NTM $N$ that halts after $t(n)$ steps has an equivalent DTM $D$ that halts after $2^{O(t(n))}$ steps. He says that $N$ 's "computation tree" has at most $b^{t(n)}$ leaves, where $b$ is ...
I just started working on algorithms and am having some trouble understanding how you can correctly analyze the number of operations of computations that are done. According to the paper I am reading, the following two steps take 3 multiplications and 2 exponentiations. $$m' = m \cdot \frac{P}{p_k} \cdot (P^{-1}\mod p)...
Is it possible to perform some sort of pre-processing that would allow to answer the question efficiently (fast)? The graph is connected, undirected, has no self loops neither parallel edges (a cycle is formed by at least three nodes). Note that this a yes/no query, meaning that I just need to know whether such a cycle...
I'm trying to write a regular expression over the alphabet {0,1,2} for the language in which every 1 is preceded by 0. For example 2200201010, 01022020102012 are strings of the language. I've tried with this: (0+2)*(01)*(0+2)*(01)*(0+2)* , where '+' means {0,2,00,02,20,22,.....}. Is this reg-exp correct? Thank you
I am studying Quantum Computing using the book Quantum Computation and Quantum Information of Michael Nielsen and Isaac Chuang. I am confused by the meaning of the $\oplus$ (addition modulo 2) symbol in the notation. Given a starting state $|\psi\rangle|\phi\rangle$ and a unitary gate $U$ such that $U|\psi\rangle|\phi\...
Suppose there is a language $L$ that is not Turing-recognizable. Now suppose, for every word in $L$, you would concatenate a "0" as prefix, resulting in $L' = \{0w | w \in L\}$. Does this mean that $L'$ is also not Turing-recognizable? I would argue that $L'$ is also not Turing-recognizable: No Turing machine recognize...
This question is about modern CPU architectures and multi-threading. I'm mainly interested in personal computers or servers having 2, 4, 8, 16... cores like for example an Intel core i7. I mean not a NASA supercomputer or GPU vector processing. You have N cores. You write an algorithm in a low level language such as C,...
I've seen to explanations for the quick sort algorithm. One in which a pivot is chosen, and put into place, before both sides of the pivot are recursively pivot-sorted. Another involved a more complicated solution involving two pivots which interchanged. What are the benefits of either solution, why was the dual-pivot ...
I came across this paper, which mentions an interesting variation on SAT: We call a CNF formula F insensitive if every total assignment α satisfies the same number of clauses of F. I hadn't come across this before. You can easily define the same property for DNF formulae as well. Which brings me to the following que...
Given an array with $n>2$ elements of integer sets intervals, where each set is represented as a tuple of the form $(inf, sup)$ (with $inf $ ínfimum and $sup $ maximum of the set), we want to obtain the two intervals such that the number of elements of the intersection is maximum. $e.g: A=[(1,2),(1,4),(3,7),(4,7)]$...
I have an IPv4 packet, 3523 byte of information Data a MTU (maximum transmission unit) of 516 (496 byte + 20 byte IP header), also an TCP header with 20 byte. How does this result is created from the above information? I always come out at 51 byte Information data for the last package. 3523-(496*7) = 51 Maybe someone ...
I want to work on a model where I make some manual corrections in my clinical notes data and want the neural network to learn those corrections.The algorithm will be supplied with both corrected and initial documents for supervised learning. I am now looking for some survey or research papers to start with. I have sear...
I would like to show a language $A$ is in $NP$. I can find a TM for $A$, but I wanted to try a different approach and see if it is correct. Let $B$ be a known problem in $NP$. If I show a polynomial time reduction $A \leq B$, will this imply $A\in NP$? I believe it will, but I am not 100% sure.
I have $8$ sets $E_1, \ldots, E_8$, each one of size $256$, whose elements are $4\times 4$ matrices of (nonnegative) integers. I'd like to design an algorithm to find: $$\underset{M_1 \in E_1, \ldots, M_8 \in E_8}{\max} ||M_1 \times \ldots \times M_8||_1$$ where: $$||M||_1=\sum_{i=1}^4\sum_{j=1}^4 M_{i,j}$$ A reasonab...
I've already programed a grammatical evolution on GPU with a very satisfactory result (an improvement on time of about 140% with relative small datasets, expecting better results whith big ones). Currently, using CUDA, I just 'fill' one core on my GPU, having a low memory usage so i'm thinking about filling every multi...
As the title states. Let's say we have a set of inputs that define a tree structure. Is it possible to construct an automaton that can perform depth-first search on this data that is not Turing-complete? If so, can we state that the ability to do DFS a sufficient proof of Turing-completeness? For the purpose of the que...
What maps to Semantic Analysis the way automata like Finite State Machines and Pushdown automatons map to Lexing and Parsing? A couple of years ago I came across a paper that presented such a construct; I don't remember much about the paper to be useful, but here's what I think I remember: I think the paper was from t...
Given a set of intervals $S = I_1, ..., I_n$, what is the fastest way to find all intervals of $S$ that are completely contained in an interval $I_\text{query}$? It should also support incremental (dynamic) insertion of new intervals to $S$. Interval trees are not suitable for this, since they are designed to query ove...
I am interested in implementing abduction over a full first order theory ie it may be non-Horn. (Aside: Almost all the references I've seen for abduction operate over Horn theories eg "Modeling Abduction over Acyclic First-Order Logic Horn Theories in Answer Set Programming: Preliminary Experiments". Is there a reason ...
I am studying computing as part of my A level course, and my understanding is that all instructions in a RISC architecture should execute in roughtly the same, small number of clock cycles (ideally one). This leads me to ask how multiplying two (possible very large) numbers takes (roughly) the same time as all the oth...
I've been struggling with the following problem: how do I find all possible sub-ranges in a range of integers where each segment is at least length 1, and I specify the total number of segments? A couple examples: segments=2, range=(0,5) > [0,1],[2,5] > [0,2],[3,5] > [0,3],[4,5] segments=3, range=(0,8) > [0,1],[2,3],[...
I was reading the Modular Multiplication page on wikipedia...and could not understand the algorithm to compute $a \cdot b \pmod{m}$. uint64_t mul_mod(uint64_t a, uint64_t b, uint64_t m) { long double x; uint64_t c; int64_t r; if (a >= m) a %= m; if (b >= m) b %= m; x = a; c = x * b / m; r = (int64_t)(a ...
I have a reducible control flow graph with only natural loops, produced from a simple DSL. Every node keeps a list of successors and a list of predecessors. I need to make a sequence of nodes out of this CFG with following properties: All predecessors of a block are located before this block, with the exception of bac...
I am designing a programming language and I want to give everything the ability to return a value. For example, if I use a block as a right-hand side value, I can assign it to a lvalue: sum := { if (a < 0) { a := -a; } if (b < 0) { b := -b; } return a + b; }; Also, if and while statements could return a va...
I developed an algorithm but just not sure what is the complexity of the algorithm. I provide a brief description of it below: "For $N$ user case, there are $B(N)$ Decision Variables. $B(N)$ is Bell Number, for those of you who are not familiar with Bell Numbers please be noted that $B(N)$ grows exponentially with $N$....
There are plenty of libraries around allowing to draw Bézier paths, but not that much information about how to implement one of those libraries. The question is: What algorithms are used for drawing Bézier paths? Current work: Searching on Internet, I found many documents about drawing Bézier lines (unfilled) using se...
Def MKP (Multiple Knapsack Problem): Given a set of n items and a set of m bags (m <= n), with pj: profit of item j wj: weight of item j ci: capacity of bag i select m disjoint subsets of items so that the total profit of the selected items is a maximum, and each subset can be assigned to a different bag whose capac...
Which algorithm is used for generating random permutations in shuf command in linux
Is NP defined as verifiable in polynomial time, or solvable in polynomial time? Verifiable meaning that the solution can be checked in polynomial time, and solvable meaning that the solution can be found in polynomial time?
Suppose we have a DAG $G$ with one source node $s$, ie. it has a path to every node, and target node $t$ which every node has a path to it. For a pair of paths from $s$ to $t$ we can define a distance function $d(\cdot,\cdot)$ as: $$d(P_1,P_2) = |(P_1 - P_2) \cup (P_2 - P_1)|$$ We want to find the maximum value of thi...
A while ago, I think on Stack Overflow, I saw someone say that Haskell literals can be thought of as functions that don't operate on anything. This makes sense to me but I remember someone else vehemently disagreeing with him. If I understand correctly, all values in primitive types, or at least those in Bool, are type...
Let I have 3-QCNF formula. Classic recursive algorithm for TQBF takes exponential time. However, following divide & conquer modification allows to do it in quadratic time (not sure about correctness, and that's the question). ctr = 0 for i = 0..n Step 1. Take i'th clause, find E-quantified variable inside it. ...
If for every $\epsilon$-NFA their exists an equivalent NFA what is the purpose of ever using an $\epsilon$-NFA? I am having trouble understanding what the practical purpose of using one would be.
I need to implement a collection DS that exposes an iterator which can be used to iterate an underlying collection and possibly remove the current item. I can use either a vector (dynamic array) or a linked list as an underlying DS. I'm inclined toward toward linked list because of the easiness of operations. Is it a g...
Recall that $G$ has a clique of size $k$ if it has a complete sub graph consisting of $k$ vertices. Let us define the problem $Clique-k$ as follows: $$\{ \langle G \rangle \mid G \text{ is an undirected graph that contains a clique of size } k\}$$ Question: Find a reduction $f$ from $Clique-6$ to $Clique-3$ such th...
I wanna determine whether an image belongs to warm/neutral/cool tone. I find Kelvin color temperature to calculate the average temperature of an image over all piexls. But the result seems not good. Can anybody point in the right direction to determine the tone of one image?
I have been trying to come up with a better algorithm that detects conflicts in the scenarios below. Let's say we have 4 dancers. We pair them up and find out which ones can dance together. So, we have the dancer # combination and whether they can dance together or not. (1,2) True (1,3) True (1,4) False (2,3) True (2,...
I'm trying to understand the paper Incentive Compatibility of Bitcoin Mining Pool Reward Functions (Schrijvers, Bonneau, Doneh and Roughgarden, in Financial Cryptography and Data Security – FC 2016 Workshops, BITCOIN, 2016; PDF). In page 3 Section 2.1, they say pool operator does not know actual $\alpha_i$ mining power...
Say I have a bidirectional graph G and I have the list of articulation points and bridges of this graph. Say, the list of articulation points is ap[] and the list of bridges are bridges[]. Now, if I remove a node which does not belong to the list of ap[], meaning, this node is not an articulation point and deleting thi...
The below example confused me: lw $r0, 4($r0) sw $r0, 4($r0) add $r0, $r0, $r0 Using MIPS 5 stage execution what are the hazards we have 1) without forwarding 2) with forwarding only in the stage of execution (exe or alu) 3) with forwarding. Add nops to eliminate hazards.
Since if I want to increase the priority of a specific node, how do I find the node without linear searching it. I need to pass the index to this function, which is in a way a bottleneck. So the question is, how can I avoid it? Or exactly this data structure doesn't provide any solution for this problem? Link: web.cse....
Let $G$ be an undirected graph, seen as a network of 1 Ohm resistors. As explained by this article (or stated on Wikipedia), the effective resistance between any two vertices can be obtained by taking the pseudo-inverse of the Laplacian matrix $L$ of $G$. Are there any efficient ways to compute this? Say I am only inte...
I've been trying to internalize some of the basic sorting algorithms recently, and to do so I've been looking at their wikipedia pages to refresh myself with how they work, and then coding my own "version" of the algorithm from there. I did this with MergeSort recently, and I got an algorithm that for what I can tell...
I'm learning about floating point numbers and I don't quite understand when one should interpret an exponent as moving the decimal point to the left. By book shows an example of converting -10.5 into binary in normalised form (using 8 bits): First we convert it into binary without normalisation and use a fixed floati...
We know that linear bounded automatons accept context-sensitive grammars. Now suppose that we modify the LBA such that any location of the tape except the input part can be changed.What language does this automaton accept? I think it is as strong as the standard Turing machine because we can copy the input part som...
Assume one wants to store $1000$ distinct integers of $5$ digits in a hash table that is defined once for all (the intent is to hard-code it). We have some freedom to change its behavior by changing the number of buckets and/or the hashing function. Is there a theory that can help minimize the worst-case or average-cas...
Note: this is from JeffE's Algorithms notes on Recurrences, page 5. (1). So we define the recurrence $T(n) = \sqrt{n}T(\sqrt{n})+n$ without any base case. Now I understand that for most recurrences, since we're looking for asymptotic bounds, the base case wouldn't matter. But in this case, I don't even see where we cou...
I am building a small library for computing information retrieval metrics for classifiers (precision, recall, f1, accuracy, whatever). Typically each metric is built by calculating a single value for each object being classified (each metric will have its own formula there) and then calculating a single value (an avera...
I read that recursive definitions, refer to the definition of a function in that function body, cannot be done in $\lambda$-calculus, but recursion can be achieved by using $Y$ combinator. As I know, nominal logic is the theory of handling bindings. So wondering how it handles recursive definition of functions? Does i...
I have to prove that $$\mathcal{O}(g(n))\subseteq\mathcal{O}(f(n))\implies\mathcal{O}(f(n)+g(n))=\mathcal{O}(f(n))$$ The functions are non-negative. Clarification: $$\mathcal{O}(f(n)+g(n))=\mathcal{O}(f(n))$$ it means $$\mathcal{O}(f(n)+g(n))\subseteq\mathcal{O}(f(n))\land\mathcal{O}(f(n))\subseteq\mathcal{O}(f(n)...
Following the blog post, where the dropout in the deep learning models has been approximated to a Gaussian process. Research paper and its appendix. Looking at the suggestion of the author from the blog post that the variance in the prediction is given by the following piece of code. I found it counterintuitive as the ...
I have an equation $x = 3a+4b+2c+4d$, where $a$, $b$, $c$ and $d$ are nonnegative integers such that $a+b+c+d=5$. What algorithm can I use to calculate maximum value of $x$?
I came across a set of articles back from the 2000s that stated Intel was planning a 10Gz CPU by 2011. Obviously, this didn't pan out. But how well are Moore's law and it's cousins holding up in terms of: Transistors per \$1000 Floating point operators per \$1000 The performance of the world's most powerful supercompu...
I don't have much experience with ML but am looking for some guidance on where I should start. I have timestamp data mapped to a certain category, e.g. travel, food, groceries, etc. Judging by some other posts and answers, would it be correct to break the data into these intervals (day, week, month, year) and then tr...
Consider a standard LP minimization problem of the form $$\begin{array}{ll} \text{minimize} & c^\top x\\ \text{subject to} & A x = b\\ & x \geq 0\end{array}$$ Should I expect, on average, an improvement in the number of iterations needed to achieve optimality if adding a (tight enough) constraint of the form $c^\top x ...
How can I demonstrate that the EXP class is closed under union, concatenation, and complementation?
I'm missing two details from Paxos made easy P1. An acceptor must accept the first proposal that it receives. What exactly is the reason for rule P1? What if the rule P2 was different, i.e. Upon receiving a proposal: acceptor memorizes the proposal as most recent proposal; if acceptor is not waiting with a running cou...
Given are two following languages: $L_1 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ visits each of its states at least once} \}$ $L_2 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ does not visit at...
For a numerical simulation framework, I use a hierarchical Cartesian grid in 3D to discretize the computational domain. I am thus looking for the most space-efficient way to store the resulting octree on disk, given the following conditions: It is very sparse (i.e., not all nodes exist), but potentially deep (a depth ...
Suppose I have a number of airports which have a set number of routes. Large airports have 7, medium airports have 4, and small airports have 1. First of all, what would I call a graph of this type where it is undirected, has no parallel edges, no loops, and every edge is connected to another (that is no route goes unu...
I am currently doing a research on data sensing and I came across the following concept. The requirement for me is to identify different data types using neural networks. Please note that I don't want to use regular expressions for this since it is suggested by most when I explain what i want to do. The neural network ...
I have a set of several geometric segments, they can be defined with two points (for example a segment could be (4,6)--(2,7)). Now, I want to query this set with another segment, and I want the operation to return whether it intersects with any of them or not. (And as a bonus, to return the instance or pointer to that ...
Let U be a pre-determined and fixed universal set (and |U| = n = 2k for some integer k, so the set may be huge). I create many arbitrary subsets of U in running time (These sets may be or may not be sparse). I do not need to check whether an element is in a set. But I need to be able to check whether a set is empty, ...
Regular expressions are equivalent to DFA's and describe regular languages, but is the language used to construct regular expressions regular? My guess is that the original syntax (concat, | and *) is, but the Perl-style syntax is not (backtracking). As the newer syntax recognises non regular languages they must also g...
In a previous question there was a definition of weight-balanced and a question regarding red-black trees. This question is to ask the similar question, but for treaps. The question is: Is there some $ \mu > 0 $ such that the expectation of $ \frac{|N_L| + 1}{|N| + 1} $ not less than $ \mu $ and not greater than $ 1 -...
I would be very glad if someone could help me with my machine learning task. I have palettes of 5 colors each (in RGB format), and would like to train the neural network so that I can input a color, and the model would give me 4 other colors that would go best with it. My training set consists of 1500 palettes (1500 * ...
To frame the question, in computer science often we want to calculate the product of several probabilities: P(A,B,C) = P(A) * P(B) * P(C) The simplest approach is simply to multiply these numbers, and that is what I was going to do. However, my boss said it's better to add the log of the probabilities: log(P(A,B,C)) =...
While Going through Exercise problem of " Computer Networking A Top-Down Approach" by Kurose and Ross, i encountered this problem.I am giving my approach and the point where i am stuck at. Question Suppose Host A sends 5 data segments to Host B, and the 2nd segment (sent from A) is lost. In the end, all 5 data segmen...
Let's assume that we have to generate huge number of 256-bit symmetric keys. How to do it and how to be sure that it is safe. Perhaps it requires a strong mathematical backend. Don't hesitate to reference me somewhere.
I would like to find cycles in a finite length list of numbers where there is no function: xn = f(xn-1). For example, in the list: 3, 12, 11, 46, 1034, 23, 12, 11, 46, 1034, 5 x0 = 3, x1 = 12, etc. and the cycle starts at x1 with a length of 4. There is a Java implementation of Brent's Cycle Algorithm here which includ...
How can I teach random number generator algorithms? I'd like to show how seeding makes randomization closer to truly random. Details of the task to be given are as follows: Code should read a text file. The file has random words (one word on each line). This is the dataset from which words will be selected randomly. ...
Currently reading a recent draft of Reinforcement Learning: An Introduction by Sutton and Barto. Really good book! I was a bit confused by exercise 4.7 in chapter 4, section 4, page 93, (see attached photo) where it asks you to intuit about the form of the graph and the policy that converged. I do not understand why t...
I've been stuck on this problem for some time, and I don't want to just look at an answer. I'd like a hint(s) so that I can get myself thinking in the right direction so that I might gain more insight into solving similar types of algorithm problems. This exercise is actually from CLRS on the section on Divide-and-Conq...
Given an array with $2n$ elements, we want to select the greatest $n$ elements, i.e. obtain new array with these elements, no matter of the ordering (it's not necessary to be sorted). Can we do this in $O(n)$ time?
Suppose we have a graph $G = (V,E)$. Every edge $e \in E$ has a unary cost $f(e) > 0$. Also, for every two edges $e_1,e_2 \in E$ we have a binary reward function $g(e_1,e_2) \geq 0$. Given two vertices $s$ and $t$, is it possible to find the path that minimizes the following objective function efficiently? $ \sum_{e \i...
I have a problem where the values are represented to humans as [0, .5, 1, ..., 8] But the function is massively recursive (game trees for a set of increasingly intractable problems) so I'm wondering is it more computationally efficient to use the values [0, 1, 2, ..., 16] and only divide by 2 when outputting for humans...
I am trying to understand tick lines in Fig 2 on Page 2 of "Time, Clocks, and the Ordering of Events in a Distributed System" paper [1]. Below are 2 things which I did not understand What is the relation between the total no of tick lines and the events on different processes? According to his explanation (i) there mu...
Let us have a set of N men and N women, and we have two matrices of affinities $M$ and $W$ such that $M(i,j)$ is the affinity of the ith man towards the jth woman and $W(i,j)$ is the affinity of the ith woman towards the jth man. The problem at hand is to find an optimal stable marriage, which satisfies that: There is...
Data is read in terms of a block from a storage device(magnetic, optical, flash). Size of the block depends upon the filesystem and os. The physical device may have different units of storage like sectors. Do filesystems create the abstraction layer directly over the physical device, or do they work over something cal...
I have a set of points in a 2D plane. I'm searching for an algorithm that: Draws a continuous line passing through all the points starting from a random point. Optimizes for the minimum total line length in Euclidean distance. The line should end at the point it started but not cross any other point more than once. ...