instruction
stringlengths
35
29.1k
I could use some help coming up with the best way to solve this problem. I've been curious as to how something like this would work, as the worst case seems way too bad. Problem Given a group of students and the courses they are enrolled in, and a schedule with 8 class blocks in it, how could you place them in specific...
I attempted this question on hackerrank. It seemed simple enough, and my program ran on small inputs. But my approach was "naive". And failed for more computationally intensive inputs. Here is the question: Problem Statement You are given a list of size , initialized with zeroes. You have to perform operations on the ...
I have a polyhedron defined as a set of connected voxels (from a 3D array). I'd like to get a representation of this polyhedron by its polyhedral surface (since it's going to be much sparser). Can I get that in quasilinear time? Do I need my set of voxels to be represented in a particular form? I don't even know the an...
Some of Conor McBride's works, Diff, Dissect, relate the derivative of data types to their "type of one-hole contexts". That is, if you take the derivative of the type you are left with a data type which shows you how the data type looks from the inside at any given point. So, for instance, if you have a list (in Hask...
I'm trying to create a TM that changes all $a$'s to $b$'s and all $b$'s to $a$'s in a given string and then halts on the first blank space it encounters. What I have is: $$ \langle q_1,a,b,q_1\rangle \\ \langle q_1,b,R,q_2 \rangle \\ \langle q_2,a,L,q_1 \rangle \\ \langle q_2,b,a,q_2 \rangle \\ $$ I'm new to Turing ma...
I have two recurrences: $T_1(n) = 2 T_1(n-1) + n$ if $n > 1$, $1$ if $n = 1$ $T_2(n) = 2 T_2(\frac{n}{2}) + n^2$ if $n > 1$, $2$ if $n = 1$ Does this mean $T_1$ is better than $T_2$ because it has less operations to do? Edit: I looked at the master theorem and found out that the 2nd one has an $O(n^2)$ runtime.
A set of functions from a universe U of keys to n buckets is universal if for every pair of keys in U, say x and y, such that x != y, the probability of h(x) = h(y) is less than or equal to 1/n, for a random function h in the set of functions. Say you're given a prime number p, and a random integer n, such that p is gr...
I wrote a simple C++ implementation of the revised simplex method that recomputes the LU decomposition of the basis from scratch on each iteration. I have to solve problems with many variables but few constraints (say, 50 constraints and 5000 variables or more), so I thought that was ok. Then I decided to implement a b...
What is the significance of reversing string $v$ in the following? Can't the string $v$ contain exactly what is in the string $v^R$, since you are just choosing from the alphabet $\Sigma^*$? I don't fully comprehend this question. Consider the language $$L = \{uabcv\mid u,v\in\Sigma^*\}$$ over the alphabet $\Sigma...
Could someone explain to me which function grows faster? $f(n)=\log(\log^an)$ or $g(n)=\log^a(\log n)$
If you have a language $L_1 = \{ w | w \in \{a,b\}^* \}$. Then does the language $L_1^R$ (the reversal of $L_1$) have the exact same elements as the language $L_1$? My Logic: Since $L_1$ can contain a string as well as the reversal of the string (ex. $L_1 = \{ababba, abbaba\}$), then $L_1^R$, over the same alphabet, c...
Given alphabet $\Sigma=\{a,b\}$, is the language $$L = \{ w \mid w\text{ contains an equal number of substrings }aa\text{ and }bb \}$$ regular? My initial though was no, because the language $L' = \{a^nb^n\mid n\ge0\}$, is not regular, and is of the same general form as $L$. However, I am confused about how $aa$ and $...
How do I prove or disprove the following statements: $$(a) ∀n ∈ \mathbb N, ∃k ∈ \mathbb N, ∀x ∈ \mathbb R , \lfloor nx \rfloor − n \lfloor x \rfloor ≤ k$$ and $$ (b)\exists k \in \mathbb N, \forall n \in \mathbb N, \forall x \in \mathbb R, \lfloor nx \rfloor − n \lfloor x \rfloor ≤ k $$ I've also been given the followi...
A message I sent to a CS professor: So I have a question about computer science in general. I would like to build "stuff" in the future, not just program my whole life. I'm not sure if I did right by majoring in Computer Science instead of an engineering field. I could always get my masters in Software Engineering but...
For quadratic hashing, i.e an open-addressed table with the hash function of the form - $h(x, i)= (h'(x) + c_1i + c_2i^2) \mod m$ Setting $c_1 = c_2 = 1/2$, and $m$ to some power of 2, leads to a hash function $h(x, i) = (h'(x) + 1 + 2 + ... +i) \mod m$ I have read that the load-factor of a quadratically probed table s...
In triangulating a simple polygon, using the concept of sweep line helper vertices etc, the very first step is sorting the vertices of such polygon. Apparently this very step can be done in $O(n)$ (where $n$ is the number of vertices). I'm trying to work out why... Assume there's no degenerate case (for any pair of poi...
Assume a well-founded relation $<$ over a set $S$ and a property $P$ on $S$ such that: $P$ holds for all minimal elements of $S$. For every $b \in P$ and $a < b$ we have: if $P(a)$ then there exists $c < b$ such that $P(c) \Rightarrow P(b)$. Question: does it follow that $P(c)$ holds for all $c \in S$?
Often, I see people using networks like AlexNet, GoogLeNet, etc to train it on their dataset. These networks are trained or pretrained with a specific dataset, and people fine-tune it to their dataset. However, is this really suitable? What if the custom dataset had a lot more images than the original or is detecting c...
Since Knapsack give Optimal solution as LP so is it also a LP or not ?
I'm writing about a problem that could be caused by race conditions between multiple threads, or OS-level processes on the same machine or different machines, or VM-level processes like the Erlang VM has. In this context, the fact of parallel execution is the important part; the language or memory-sharing model is irre...
Given a grammar as follows: $\left<stmt\right> \rightarrow \left<id\right> = \left<expr\right>$ $\left<const\right> \rightarrow A | B$ $\left<expr\right> \rightarrow \left<term\right> \times \left<expr\right> | \left<term\right>$ $\left<term\right> \rightarrow \left<factor\right> + \left<term\right> | \left<factor\rig...
I'm confused by the running time of the following algorithm. I've been told it's $O(n^3)$, but there are only two loops. How can that be? for(int i = 0; i < s.length(); ++i) { for(int j = i; j <= s.length(); ++j) { String sub = s.substring(i, j); if(isPalindrome(sub) && sub.length() > maxCount) ...
Suppose I am trying to construct a simple AVL tree: Upon inserting 'B' the tree becomes imbalanced. How do I exactly know that I need a LR or RL rotation without making any guesses? From what I heard is that if you insert at right side of tree and it becomes imbalanced then you need a LR rotation and vice-versa. I wan...
I have two series of tuples $$ A = \{(x_0,t_{01},t_{02}),(x_1,t_{11},t_{12}),\ldots,(x_n,t_{n1},t_{n2})\} \\ B = \{(y_0,tt_{01},tt_{02}),(y_1,tt_{11},tt_{12}),\ldots,(y_m,tt_{m1},tt_{m2})\} $$ where $m \neq n$ and $t$ and $tt$ are both time observations. $t_{i1}$ and $tt_{j1}$ are both the start of some epoch for arbi...
The purpose of performance profiling is to measure program performance. One part of your PA1 assignment asked to measure performance of your d-smooth algorithm to verify if the running time of the program corresponds to the desired $O(n \log n)$. Assume that you have performed an experimental analysis of an algorithm, ...
Let $M$ be a square matrix and $S(M) = \sum_{i<j} m_{i,j}$ the sum of the elements in the upper triangular part of $M$. Is there an efficient algorithm to find a permutation matrix $A$ that minimizes $S(A M A^{\top})$
I am trying to find the weakest precondition and invariant of this while loop. I have read and am trying to understand the concept of calculating preconditions based on postconditions. I was wondering if someone could explain it to me. while i < j do i = i + 1; j = j - 1; end {i = j or i = j + 1}
Implement a one-bit ALU which takes two one-bit operands $a_0$, $b_0$, and produces a one-bit output $z_0$. The ALU has a two-bit control input $cont_0$, $cont_1$, with codes as shown below. |$cont_0$|$cont_1$ |selects |--- 0 ---|--- 0 ---| AND |--- 0 ---|--- 1 ---| NOR |--- 1 ---|--- 0 ---| OR |--- 1 ---|--- 1 ---|...
In the book Introduction to Algorithms of Cormen 3rd edition page 1041 about of Closest Pair of Point divide and conquer algorithm, Is there an error? It's said: "...Create an array Y', which is the array Y with all point not in the 2$\delta$-wide vertical strip removed...", it should be: "...Create an array Y', which ...
Some language A ⊆ Σ∗ is called complementary if A ≤m complement of A. How can I show that there exists an undecidable complementary language?
This is a distributed systems problem, but perhaps the graph theory gurus can help me. I need an algorithm that that tells me which nodes to remove from the graph to completely remove connectivity. See example: The most intelligently thing to do would be to remove the bcasts nodes: Can you help me? One way to solve...
So basically, automated language-oriented programming. I've tried finding info on this concept, but have had some trouble, probably because my brain is having a bit of trouble grasping the subject while thinking about it. It could be better defined as metaprogramming going to a deeper level- rewriting the programming l...
Assume there is an array $A$ of $n$ elements. $A$ contains every number from $1$ to $n$. We are given an array $B$ of $n$ elements. If we move each element $A[i]$ left by $B[i]$ places starting from $i = 0$ until $n-1$, in the end array $A$ will be sorted in increasing order, i.e. it will be $A = [1, 2, 3, ..., n]$. Gi...
The perceptron model describes a linear classifier. Often people use the term "multilayer perceptron" to describe a feedforward neural network that uses perceptrons. This terminology simply sounds wrong to me, since this type of network does not necessarily behave like a perceptron; that is to say - it may act as a non...
so I'm working on a variation of the knapsack problem which includes a constraint on the number of each item from each category in addition to a weight. For instance, we have a number of books each given a genre (1 of 3 genres), and our goal is to maximize the total weight as well as include at least G books from each...
In my opinon the Language recognised is this: $(a + b)^* (ab)^ω$ but the solution provided is: $(a + b)^* (a + b)^ω$ Did I missunderstand the acceptance condition or is the solution wrong? My reasoning is: As far as I understood a Muller Automaton does accept a run if all the set of all infinitely often visited states...
I aim to gain more intuition with regards to the role of a hidden layer in a neural network architecture. And further to understand whether my classification problem is a linear one or not. Here is what I have: I have a input of size 128 which is the output of the FFT of a multi-tone signal. Bellow you can find one inp...
I was going through the following paper: http://www-formal.stanford.edu/jmc/recursive.pdf In the last part of the second section (at the end of page 7) he speaks about the inadequacy of lambda notion for naming functions described recursively. The right hand side of the following expression $$\text{sqrt} = \lambda((a,x...
Im currently enrolled in an AI course and we are starting with state space search problems. My professor always seems to ask, given a certain problem, what is the estimate size of the state space? It's been 3 years since ive taken a course in discrete math which is the type of question I am asking. How can I use things...
I have got some difficulties to solve this algorithm problem. I have been given a set of n points on a number line. Those points are not sorted in the set. For any two points $(a, b)$ in the set, their distance is calculated as $|a-b|$. Now I need to calculated the kth largest among all possible distances of the n poin...
I was wandering if $L = \{\langle G \rangle \mid \ G \text{ is a context free grammar and } \mathcal L(G) = A \}$ is decidable where A is a some regular language. Is $L' = \{ \langle G \rangle \mid \ G \text{ is a context free grammar and } \mathcal L(G) = \overline A \}$ decidable ? I feel like $L'$ should be decida...
I have a very large amount of objects that look like this: DataDict = { id1: {"a": true, "b": true, "bc": true, "hgf": true}, id2: {"bcwe": true, "nKNNn": true, "mjj": true, "AAt": true}, id3: {"h": true, "a": true, "mjj": true, "ABwAU": true}, id4: {"wvzy": true, "zzba": true, "abc": true, "a": true}, ... } or ju...
Having difficulty grasping the concept of how a language and a regular expression are related. For example: (In all cases, the alphabet is $\{0,1\}$) The language $L = \{100,10,011\}$ ------> Regular expression. So far, I have: $(0+1)$ since you can have either $0$ or $1$ in the first part...but...I'm not sure what w...
For languages A and B, let the shuffle of A and B be the language $ \{w| w = a_1b_1···a_kb_k,$ where $a_1···a_k ∈ A$ and $b_1···b_k ∈ B,$ each$ a_i,b_i ∈ Σ^∗\}$. Show that the class of regular languages is closed under shuffle. Approach: If A and B are regular, then there exists an NFA R and T that recognizes them. I was...
How to use algebra in operations that involve asymptotic notation? Like for example: $C_1(n)= O(n)$ $C_2(n) = O(n^2)$ Is $C_2(n)/C_1(n) = O(n)$?
(all automata sizes are expressed in number of states in this question) There exist NFAs of size $n$ for which the smallest DFA recognizing the same language is of size at least $2^n$. Let $\Sigma$ be a vocabulary, and let's consider $n$ regular languages $L_i \subseteq \Sigma^*$ respectively recognized by $n$ DFAs $D_...
Suppose that we have the above graph. The graph is directed and is unidirectional; that is, we can only traverse it from top to bottom. We want to update the count of the nodes such that the count of any given node indicates the sum of the count of the node itself and the previous nodes, avoiding any duplicate nodes....
Consider this question ( 18.2-4 of CLRS) which states that: Suppose that we insert the keys ${1,2,...,n}$ into an empty B-Tree with minimum degree 2. How many nodes does the final B-tree have? My approach: We add each element one by one. We'll need 3 elements at first (namely 1,2 and 3), after which the $4th$ eleme...
It's said that constant references within a program are replaced by the value at compile time, where as, variable references will need to be looked up at run time - making them slower. Yeah, it sounds faster, but won't they ultimately both be locations in memory (that will have to be looked up), with the difference bei...
Can we transform a CNF to ILP without introducing new variables? My question can be seen as a follow up to Express boolean logic operations in zero-one integer linear programming (ILP) as the solution proposed in that post introduces additional variables. Also, my current understanding is that each 0 value in the truth...
Given a DFA $A = (Q, \Sigma, \delta, q_0, F)$ with $n$ states and a homomorphism $h: \Sigma \to \Gamma^*$. It is easy to see that the family of regular languages is closed under homomorphisms using regular expressions or by construction of a grammar. My problem now is to analyze how many states are needed for a DFA $A...
Is there a special term for a cycle containing a single vertex and edge? I feel like I read "self-cycle" somewhere, but can't find where.
Let image $x$ be an original (non-warped) image. Let $I_1$ be $I_1'$ having suffered some projective transformation and possibly some noise. Suppose we have computed SIFT descriptors for both images. Can you explain how RANSAC is concretely used to find the homography that aligns image $x$ and $y$? More concretely, I u...
The minimum spanning tree problem can be solved in polynomial time via Kruskal's or Prim's algorithm. However, every integer program I have seen that corresponds to the MST problem require a constraint for every subset of vertices, so the number of constraints would be exponential. That makes me wonder, is it is possib...
I'm looking for a data structure that stores an approximation of a DAG: If a node $x$ is reachable from a node $y$ in the DAG, then it is reachable in the approximation. For a given fairly small root set of nodes that have no incoming edges, it supports getting an over-approximation of nodes reachable from a root and ...
Let $A = \{ uu \text{ } | \text{ } u \in \{a,b\}^* \}$ be a language. Suppose that we want to prove that A is not regular via the pumping lemma, why is the string w = $a^{p} a^{p}$ not valid to derive a contradiction?
select k sets from a collection of sets such that each selected set has an empty intersection with the non selected ones
I'm new to Operating System, just learnt about process and now is about to learn about threads. From what I understand, a program is an executable file, program code a process is a program in execution a thread is part of a process in a process, there might be multiple threads. e.g. MS Word in a programming code, ther...
Strassen's algorithm uses the divide and conquer approach to divide the matrix multiplication of two nxn matrices to multiplication of 7 2x2 matrices to get an overall complexity O(n^c) where c=log_2(7). I also read a paper which proved that it was impossible to multiply two 2x2 matrices in less than 7 multiplication ...
For my research work, I need to generate dataset by using some standard statistical distribution. I have seen Unknown distribution for dataset generation. I do not have any idea about unknown distribution and how to generate data using this distribution. Could you please clarify what is unknown distribution? My problem...
I read that there is a $\Omega(n^3)$ lower bound for $(max,+)$ matrix multiplication (with $n\times n$ matrices). This is the matrix product defined as: $(A\cdot B)_{ij}:=\max^n_{k=1}\{A_{ik}+B_{kj}\}$, for some $n\times n$ matrices $A$ and $B$. This lower bound means that the trivial algorithm is the best one. Is ther...
according to the Smith-Waterman setup, I have 2 string sequences S and T, and I want to identify their respective subsequences $\alpha$ and $\beta$ whose global alignment have maximum score over all pairs of subsequences. As usual, the scoring system is a substitution matrix and a gap-scoring scheme. However, I want to...
I have two exercises: 1) A 128KB direct-mapped cache, with lines from 32bytes/lines and 36-bit address. 2) A 512KB 2-way associative cache, with lines from 64bytes/lines and 36-bit address. For both exercises i have to find the number of bits needed for the tag,index and offset fields. I tried to do both exercises and ...
I have started learning lambda calculus from the book by Hindley and Seldin. It brought up the concept with the function $x-y$, first as a function of $x$ and then as a function of $y$. In a way, it emphasized the difference between treating the expression as a function of $x$ and function of $y$, giving separate names...
Let $\Sigma$ be an alphabet of size $2$, and let's consider $n$ regular languages $L_i \subseteq \Sigma^*$ respectively recognized by $n$ minimal DFAs $D_i$ whose size are bounded by $m$. As the number $k$ of minimal DFAs of size at most $m$ is finite, there exists a function $f$ that returns this number $k=f(m)$. Let ...
My lecture states that search in a sorted array can be done in ω(n). Why is that? I know it can be done with "normal" search in Θ(n) and with binary search in O(log(n)). My guess would be, make the algorithm so bad that it is in ω(n) but that's a kinda silly guess I think. Thank you all in advance.
Does a process's page table too gets swapped out to secondary storage from main memory when the process gets swapped out to secondary storage from main memory? And gets swapped back in when the process is swapped in? I tried to find the answer in text books and online, but none is clear. Also, it would be helpful if yo...
The problem: Exact Cover by 3-Sets (X3C) The definition: Given a set X, with |X| = 3q (so, the size of X is a multiple of 3), and a collection C of 3-element subsets of X. Can we find a subset C’ of C where every element of X occurs in exactly one member of C’? (So, C’ is an “exact cover” of X). The class US (Unique ...
How would one represent the number -4 as an 8-bit normalised, 2's complement, floating point, with 4 bits dedicated to the exponent? As a normal 4-bit 2's complement number, it would be represented as 1100. How would this be normalised, with the start of the mantissa being 1.0? Would it be 1.000 0010, with the extra 1 ...
I have the following problem: Inputs: A finite collection $V$ of vertices A metric cost function $c:V^2\to\Bbb R$ (interpreted as the edge cost of a complete graph on $V$) An amount of resource $s:V\to\Bbb R$ on each vertex, satisfying $\sum_{u\in V}s(u)=0$ The problem is to determine a transfer function $f:V^2\to\B...
I've spend the last few days searching online for an example of a constructive proof of regular languages being closed under homomorphism, but I have not seen one. I am mostly unsure of how to show the construction of a DFA for a homomorphism in general. For example, if I were to create a mapping between an alphabet $A...
Several times, I saw $\lambda$-terms such as $\lambda x. \lambda x.x$, where $x$ is bound by the inner lambda, which I agree. why not just write it as $\lambda y. \lambda x.x$, so it is clear and you don't need to comment such as "where $x$ is bound by the inner lambda". what is the point of writing $\lambda x. \lam...
I'm reading the book The Annotated Turing by Charles Petzold. In it he mentions the Diophantine equations - which was a joy to read. This then lead to Hilbert's 10th problem - finding an algorithm of solving Diophantine in a fixed number of steps to whole numbers. Interestingly enough - Diophantine sets are Turing Mac...
let T be tree with 10 vertices. what is the sum of degree of all vertices in tree
Given collection of sets S1,...,Sn and a positive number k. Is the problem of selecting some of the sets such that their intersection is of size k NP-hard? So far, I tend to believe it is so I tried to find a reduction (unsuccessful so far), I have tried is to replace intersection by union (which is equivalent if we ta...
* Initial Question * I'm trying to write a logical formula consists of three Boolean variable C1, C2, C3. My program takes graph as input and checks properties about them. C1 represents presence of some structural properties of the input graph (graph being strongly connected). If graph have this property, variable C1 ...
I was studying about naive pattern search algorithm and found that it requires two loops to match the pattern present in a string or not. That time an Idea stuck in my mind and I think it would be a better approach because I used only one loop to find out the pattern in string. Here is Pseudocode MY-PAT-ALGO(T[n],P[m...
$A, B$ – enumerable sets, is $A \times B$ enumerable? I have some thoughts, that maybe it can be done using something like the proof of countability of $\mathbb{N} \times \mathbb{N}$, but I don't know how to prove this more proper.
The problem I'm trying to tackle is to show that for a Kolmogorov-random number of length $n$, the amount of $1$'s in its binary representation is greater than $n/4$. My only idea so far, is to use a Turing machine that takes indices of $1$'s as an argument and produces a binary sequence accordingly. Then, for instance...
I am trying to find out how many times the "statement" is executed by finding its formula based on these loops: int s = 0; for(int k = n; k > 0; k /= 2) { for(int l = k; l < n; l++) { s++; // statement } } I have been stuck with this problem for a while since I couldn't really get the correct formula wheneve...
I've been reading some papers on reinforcement learning. $$\Delta w=\frac{\partial ln\ p_w}{\partial w}r$$ I often see expressions, similar to the above one, where the weights (denoted by $w$) are updated following the partial derivative of the policy function (denoted by $p_w$) with respect to its weights. But why do...
I am learning Lambda Calculus from the book by Hindley and Seldin . They start the formal postulation of lambda calculus as follow : (a) all variables and atomic constants are λ-terms (called atoms); (b) if M and N are any λ-terms, then (MN) is a λ-term (called an application); (c) if M is any λ-term and x is any va...
Suppose there is a tutorial session at a university. We have a set of $k$ questions $Q = \{ q_1 \ldots q_k \}$ and a set of $n$ students $S = \{ s_1 \ldots s_n \}$. Each student has a doubt in a certain subset of questions, i.e. for each student $s_j$, let $Q_j \subseteq Q$ be the set of questions that a student has a ...
Assuming $L$ is defined as follows: $$ L = \{ 0^n1^{n^2} | n \ge 0 \} $$ I'm trying to either prove/disprove whether $L$ is CFL or not. My intuition tells me its not CFL since I cannot express the power $n^2$ by itself using CFL, but I'm having trouble proving so using the pumping lemma. Also, I failed to create any s...
In Philip Wadler's presentation, "Category Theory for the Working Hacker", something confused me. At about 30:52, he says: We need this additional construct which is called distributivity. Here it is, right? It just says "given a choice of an A or a C and a choice of a B or a C, we can get a choice of an A or a B and ...
Hello everyone this is my first question ever and I apologize if I ask in the wrong manner causing this post to be either closed or deleted. I'm learning Reductions and my professor has asked us to write a paper on reductions (3SAT) When doing the Reduction from the Clique Problem to 3SAT, I understand that we make cla...
I can't find a counterexample to $$f(n) = o(g(n)) \text{ implies } 2^{f(n)} = o(2^{g(n)})\,,$$ but I do not know a formal way of proving it. Can anyone lead me in the right direction? I asked this exact question yesterday in Stack Overflow by accident (meant to post here) but no one could come up with a valid way of a...
Consider the following problem statement: Given an initial number, you and your friend take turns to subtract a perfect square from it. The first one to get to zero wins. For example: Initial State: 37 Player1 subtracts 16. State: 21 Player2 subtracts 8. State: 13 Player1 subtracts 4. State: 9 Player2 subtracts 9. ...
is the Big-O for this O(1) or some asymptotic like 1/n? Saying that because if it defaults, the time limits at about 1000000 ns, but if it returns while in the loop, it is about a fraction of that. The time seems to increase very slightly as the inputs increase. public static int[] call(int b, int c) { int[] f = ne...
Construct a push-down automata to recognize the language $ A = \{u\#v \in \{0,1,\#\}^{*} | u = v^{\complement} \} $. Here, $v^{\complement}$ is the bit-complement of v. I don't see how to perform this with a LIFO stack. I would like some hints (not a solution) if possible. Thanks,
Construct a minimized Deterministic Finite Automaton that recognizes strings of 1's and 0's that are multiples of 3. This was one of the questions asked in my cycle test. What would be a correct interpretation to this question? Strings having a number of 0's and 1's that are multiple of 3, e.g.000111, 011010 Strings o...
Take a node-weighted, undirected graph $G$, and a node $r$ in $G$. Is there an efficient algorithm to find a tree in $G$ rooted at $r$ which has total weight at least $w$ and contains a minimal number of nodes?
Given a residue code representing a number N with the tuple (N, R(N))where R(N) equals N mod A. What is the error detection distance of a certain check base A? In other words, how many bits can be flipped but still detect an error? Edit: I would think the minimum distance is 2 for any base. Consider a base A > 2. If...
Many algorithms in computational geometry assume to have as input a complex data structure to represent a geometric object. The most common I know is the Doubly connected edge list, but there're also the halfdge data structure, winged edge etc... I was wondering if such data structure is also used to represent simple o...
There is a ring A and ring B made of Xs and Os. My aim is to convert A to B by using only the minimum number of # operations. When I do # on an element i of the ring, element i-1, i and i+1 will be toggled. (toggled => X->O and O->X).
I have read multiple times [Theorem 5.15, 1][End of page 2, 2] that local search heuristics for $\textsf{Weighted Max-Cut}$ with $\textsf{Flip}$ neighbourhood takes an exponential time in some cases. In particular, the problem is as follows. Given a partition $(V1,V2)$, its neighbours are partitions which can be obtain...
Ranked alphabet is very often used in Ranked Trees definition, like here for instance. In that example for given set $\Sigma=\{a,b,c\}$ ranks assigned by arity function $ar : \Sigma\rightarrow\mathcal{N}$ as: $ar(a)=2, ar(b)=2, ar(c)=1$. And Ranked Tree over $\Sigma$ is defined as: $T_{\Sigma_r}$, the set of ranked tre...
I'm creating a tic tac toe game, there will be two players: X and O. X will be a human, and O is an AI which will always choose the best move to play. My board is an 11x11 board and the winning condition is 5 in a row. How do I know if a board is at end state (where one player has won)? For the 3x3 board, you can do...
Alright, I am not entirely sure if this is the right place to ask this, but here goes: I have a map of coordinates of robots and obstacles. The first robot is awake from the start of the problem and it can wake up other robots on the map by walking next to them. Once a robot is woken up by another, it can also traverse...
Given a set of random variables $X = \{x_1, x_2, \dots, x_n\}$. If the conditional entropy for all $Y \subset X - \{X_i\}$ where $|Y| \leq 5$. How to approximate conditional entropy when $|Y| = 10$ based on the given knowledge? Is it possible to approximate better than $H(X_i | X - \{X_i\})$ ?