instruction
stringlengths
35
29.1k
Let's say Ω(g(n)) be a set representing the lower bound and O(g(n)) be another set representing the upper bound for some function f(n). Can I say that θ(g(n)) is the intersection of these two sets? The only reasoning I could give for it is that: Ω(g(n)) is set of all the functions whose running time is at least cg(n) ...
I thought the order of precedence of operators and quantifiers was arbitrary, but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀). This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on th...
Suppose we are given a red-black tree with $n$ vertices with distinct keys and we want to store, as addition information in each vertex $v$, the biggest key out of the keys that are smaller than $v$ (or nothing if it doesn't exist). Can we insert a new element in this tree in $O(\log n)$ time? I think that we can. My i...
I have to manage shifts of a variable number of people inside several rooms for a week. Every shift must be at least 1h long and the number of hours per person for the week should be nearly the same for everyone. Every person could ask for specific shifts and this could be accepted if a suitable solution can be found. ...
I got a task to create two functions one finds max $X$ and the other $Y$ in a polygon in $O(\log n)$. The polygon is represented by an array of its vertices where each vertex is represented by its coordinates $(X,Y)$. We also know that the first vertex in the array has the smallest $X$ coordinate and after that, all th...
Heap supports insert operation in $O(\log n)$ time. And while heap supports remove min/max in $O(\log n)$ time, to remove any element (non min/max) heap takes $O(n)$ time. However, red-black tree supports insert/remove both in $O(\log n)$ time. We can just remove the first/last element in a red-black tree to remove min...
I am trying to have my Minimax AI chess players play against each other. I was a bit confused about an implementation detail. Let's call black my first minimax AI chess player that plays first. white is the other minimax AI that goes second. My question s about the turn. Should black maximize and white minimize OR shou...
I've a typical parent ID based file system in database and files are physically stored on disks. What I want is to store files in blocks (4096K) of fixed size. Chunking can be used I found, but how does a fixed size block storage file system may look like at high level in database? Suppose I also want to update the sp...
I am writing a computer vision related program and stuck on a problem. I have a system of quadratic equations where M is a constant 3x3 matrix, is the 3x3 identity matrix, and we are solving for the 3x3 matrix R. The first set of equations contains 6 independent equations which leaves us with 3 degrees of freedom of...
I have this question I found regarding n-gram modelling in the textbook Speech and Language Processing: Suppose we didn't use the end symbol </s>. Train an unsmoothed bigram grammar on the following corpus without using the end-symbol </s>. <s> a b <s> b b <s> b a <s> a a Demonstrate that your bigram model does not ...
Recap of the terms from the dictionary: semantics: the study of meaning in a language (words, phrases, etc) and of language constructs in programming languages (basically any syntactically valid part of a program that generates an instruction or a sequence of instructions that perform a specific task when executed by ...
I'm struggling with an interesting problem from a chapter about Dynamic Programming in Skienas' famous "The Algorithm Design Manual". It's listed on the following web-page under number 8-22: http://www.algorist.com/algowiki/index.php/Divide-TADM2E#8-22 The problem asks you to write a polynomial-time algorithm using DP...
I came across a more general form of this question. Can we find the value of variables in polynomial time ? Let $m = n^{2}$, there are $m$ variables ($x,y,z\ldots$) in the equation and these $m$ values can only take positive integer values ranging from 1 to $n$. We have equation generator, $$a\cdot f(x)+b\cdot f(y)+c...
I'm currently looking for an algorithm to find often repeating substrings in one or multiple strings. However, my search until now was not really successful. I try to illustrate the problem on the following example strings: S1: ABCCCDxxxxxxABCCCDxxxxABCCCD S2: xxxxxABCCCDxxxxABCCCDxxxxxxx ... S10: xxABCCCDxxxxxxxxABCCC...
I need to generate random strings given a grammar in Greibach Normal Form. The naive approach would be to generate a random integer n and perform n traversals of production rules, as every traversal adds exactly one symbol to the string. The problem with this approach is that the choice of productions to expand cannot...
I understand that the modern day digital computer works on the binary number system. I can also get, that the binary representation can be converted to rational numbers. But I want to know how does the present day computational model interpret real numbers. For eg: On a daily basis we can see that a computer can plo...
When I apply pumping lemma on this language: ${L=\{010^n:n\ge0\}}$ over the alphabet ${\Sigma =\{0,1\}}$ I get that it is non-regular despite the fact that it is regular. let ${n=4}$, then $w=010000$ $w=xyz$ , $ { \mid xy\mid \leq n} $ and $ {\mid y\mid \geq 1}$ $x=0$ , $y=10$ , $z=000$ let $i =2$ $xy^2z = 01010000...
Does the Kleene star distribute over each element? Is this true: $(0+1)^* = (0^* + 1^*)$?
Here is an example taken from CLRS. q)Consider an ordinary binary min-heap data structure with n elements supporting the instructions INSERT and EXTRACT-MIN in O(lg n) worst-case time. Give a potential function Φ such that the amortized cost of INSERT is O(lg n) and the amortized cost of EXTRACT-MIN is O(1), and show ...
lets say a data structure has operations called insert and delete both of which take O(log(n)) worst case. Suppose the amortized cost of insert is O(log(n)) and the amortized cost of delete is O(1). Now if a sequence that has n delete operations performed on this data structure that has n elements currently, then wha...
Problem: Given a set of $N$ non-overlapping convex polygons $\{S_i | 1\leq i\leq N\}$ defined by their vertex coordinates $(x,y)$ and a convex polygon $P$, also defined by its vertex coordinates, find all polygons $S_i$ that overlap with $P$. Assume an algorithm to test whether a pair of polygons overlap already exis...
According to this answer, the Bellman-Ford algorithm doesn't work when an undirected graph contains negative weight edges since any edge with negative weight forms a negative cycle, and the distances to all vertices in a negative cycle, as well as the distances to the vertices reachable from this cycle, are not define...
I understand that $\phi$ is a null symbol. why concatenation of any language L with $\phi$ is $\phi$ rather than L ?
Given m,n dimensions of a 2D matrix; (i,j) initial co-ordinates; (x,y) final co-ordinates. What is the probability of being at (x,y) after at most k steps if we start from (i,j) initially? We can travel to 4 neighbors. that is ( i , j+1 ), ( i , j-1 ), ( i-1, j ), ( i+1 , j ) if they are inside the matrix. If there are...
I understand the idea behind making a MA protocol perfectly complete. In a MA protocol, Merlin sends a proof $\pi$ which Arthur checks with his machine $V$ by plugging in some random bits $r$ such that whenever $x \in L$, $\Pr[V(x,\pi,r)\text{ accepts}]$ is exponentially high and is exponentially low otherwise. Like in...
In basic type inference for -calculus with parametric polymorphism à la Hindley–Milner, when can we say that we cannot give a type to a lambda constructor? For example $$(λx.λy.y(x\ y))(λz.z)$$
I have been following the "High Performance Computer Architecture" course from Georgia Tech (also on YouTube), and unless I've missed something, I cannot see where the following has been explained: If I have a multilevel cache, L1/L2/L3/Ln: 1) what decides what level of this hierarchy a block fetched from memory initia...
I am trying to find a proper term for the A*-like best-first pathfinding strategy where the node to expand next is the one with the least estimated distance from the goal, regardless of its distance from the source. In best-first search algorithms, the node to expand next is the most promising one according to some eva...
Set of strings over $\{0,1\}$ having at least two occurrence of the substring 00. $\{a^n b^m : n ≥ 4, m ≥ 3\}$. Set of strings over the alphabet $\{a,b,c\}$ containing at least one $a$ and one $b$.
We know that the longest common substring of two strings can be found in $\mathcal O(N^2)$ time complexity. Can a solution be found in only linear time?
Does reducing SAT in polynomial time to a P problem would mean that P = NP?
Why would it be suitable to design an instruction set with 2-bits allocated for the register number and 10-bits allocated for the memory address? Would introducing a cache change this? (If possible I'd like to know why or where to find an explanation on this.) If it helps an example would look like this 0001 xxyy yyyy...
I know the answer which is: \begin{align} S &\rightarrow aS \mid T\\ T &\rightarrow aTbT\ \mid \varepsilon \end{align} Now, $bbaaa$ is in the language. But the given CFG cannot generate it. Is it a possible misunderstanding on my end about the prefix's? Can you explain? And if the CFG given is wrong, what is the correc...
Here is the definition of $\Omega$: $f(n) = Ω(g(n))$ iff there exist positive constants $c$ and $n_0$ such that $f(n) \ge cg(n)$ for all $n\ge n_0$. Here is one theorem: If $f(n) = a_m n^m + \cdots + a_1 n + a_0$ and $a_m > 0$, then $f(n) = \Omega(n^m)$. I want to prove this, without using limits. Despite many hour...
Say I have designed a makeshift PRNG for my personal amusement, now I would like to see how good it is. How do I benchmark its "randomness"? Ideally, I want to know a statistics test, such that if I pass it (or get a high score) I can write up a paper to announce a new state-of-the-art PRNG to the world. Yeah I know th...
Is there a way to solve TSP in polynomial time if there are only two kinds of weights, 0 and 1?
I am interested in creating an ontology which will model arguments (among other things). For example, a triple in the ontology might be Vaccination -> can lead to -> Autism (not that I necessarily believe this, just a good example of an argument). I would like to attach sources to any disputed statement. So ideally, th...
We are given an array of integers and a number K. We need to pack these integers into bins. The condition is that we have to use exactly K number of bins and each bin should have equal capacity. We need to find the size of bin such that wastage of unused bin is minimized. Is this problem polynomial time solvable?
We are given an array and a number K. Partition array into K subsets such that let MaxSum be the maximum sum of among subsets. We have to minimize summation =$$\sum_{i=1}^{k}MaxSum-sum(i) $$ Is this problem polynimial time solvable?
It seems to me, at the moment, that I don't understand where the line is drawn between "computability" and being incomputable. The main question is, is it the ability to be "solved" only by trying out every possible combination? I know there are probably "even worse" things where it is not even possible to define "ever...
Let M be a Turing-machine with tape alphabet = {0, 1} that does not move beyond the first 64 cells of its tape. Is the problem "Does M accept any word?" decidable? I would say it does not accept any word because we can have words longer than 64 characters. I would say it does because if it accepts any word, we ...
Is there a known lower bound to the online Range Minimum Query (RMQ) problem with value modifications (given the array we perform online RMQ on, support dynamically modifying the values of a given element in the array)? The Wikipedia page on range minimum queries cites the $O(n)$ preprocessing, $O(1)$ query-time algor...
I hope this question makes sense, but I was wondering if there are other models of computation similar to lambda calculus that you can use to build up axiomatic mathematical and logical fundamentals like numbers, operators, arithmetic functions and such?
Given this naive recursive function: def largest_tower(heights_and_widths, prev_height=1000, prev_width=1000): if not heights_and_widths: return 0 results = {0} for i in range(len(heights_and_widths)): current_height, current_width = heights_and_widths[i] if current_height < prev_...
Hi all i have algorithmic problem and i struggle with finding optimal solution. I have tree which i want to traverse. Nodes of the tree consist of value and a rank of node (value as well as rank can be random number). What i want to do is traverse tree and for each node i want to sum values from all descendant nodes e...
I've read over the proof for Robbin's Theorem, but I am not seeing why DFS will always give you a correct orientation of directed edges to solve the problem.
how would I prove $ 8^n = Θ(4^n)$ is either true or false. I so far have attempted to prove big O but cant find the value of C1
Say I need to simulate the following discrete distribution: $$ P(X = k) = \begin{cases} \frac{1}{2^N}, & \text{if $k = 1$} \\ 1 - \frac{1}{2^N}, & \text{if $k = 0$} \end{cases} $$ The most obvious way is to draw $N$ random bits and check if all of them equals to $0$ (or $1$). However, information theory says $$ \begi...
First Slide: Find Max(A) // INPUT: A[1..n] - an array of integers // OUTPUT: an element m of A such that m >= A[j], for all 1 <= j <= A.length max = A[j==1] for j = 2 to A.length if max < A[j] max = A[j] return max Second Slide: Proof By Contradiction Proof: Suppose the algorithm is incorrect. Then for some input A, ...
I don't understand what this regular language is asking for? Find a grammar for L(G) = {w || w | is odd,∑ = (0, 1) }. What does the " || " mean I know a single " | " means or.
I'm reading Michael I. Jordan's book on probabilistic graphical models, and I don't understand the elimination algorithm presented in chapter 3. To narrow the question down, consider page 6. In equation (3.10), we see that $$m_5(x_2,x_3) = \sum_{x_5}p(x_5|x_3)p(\bar{x}_6|x_2,x_5)$$ where the $x_i$ are random variables...
In the course notes for Stanford MS&E-319: https://web.stanford.edu/class/msande319/lec1.pdf Lemma 5 is given as: The approximation factor of the modified greedy [scheduling] algorithm is 4/3. And gives the example: Note that 4/3 is essentially tight. Consider an instance with $m$ machines, $n = 2m+ 1$ jobs, $2m$ j...
Is there an implementation of the Fast Subset Convolution from this paper available somewhere? Fast Subset Convolution is used for many dynamic programming FPT algorithms on tree decompositions to achieve better runtimes.
Exactly 1 in 3 SAT (X3SAT) is a variation of the Boolean Satisfiability problem. Given a set of clauses, where each clause has three literals, is there an assignment such that in each clause exactly one literal is true? X3SAT is NP-hard even if we assume all literals are positive (monotone) and no two clauses have mor...
As far as I understand a stationary source is a regular source but it's not necessarily true the other way around. And a stationary source is a source for which its distribution is unaffected by a "time shift" ? Can someone clarify the definition and difference of the two?
In the course notes for Stanford MS&E-319: https://web.stanford.edu/class/msande319/lec1.pdf Lemma 5 is given as: The approximation factor of the modified greedy [scheduling] algorithm is 4/3. And gives the example: Note that 4/3 is essentially tight. Consider an instance with m machines, n=2m+1 jobs, 2m jobs of length...
I need to come up with a data structure that supports the following interface: new(time_stamp x, value v): insert a new data v for time stamp x update(time_stamp x, value v): update the data for time stamp x to v delete(time_stamp x): delete the data for time stamp x query(time_stamp x): returns sum of all data wh...
The language of all bitstrings with more 1s than 0s, i.e., $ A = \{x: 2\Sigma_{i}^{|x|} x_{i} > |x|\}$ is regular. I know I should apply Pumping Lemma and the proof as well, what I cannot understand is' the meaning of question itself. To be more precise, my question is' how the formal and informal sections of the quest...
Suppose we have a circular radar that scans for ships in an area enclosed by $x^2+y^2 \leq z^2$ (a circle). We wish to design a hash function $h$ such that, we can order the $n$ ships from closest to furtest away from the origin. We want to have an expected time complexity of this ordering algorithm to be done in $\th...
This question is based on the slides from this pdf: Slide 54, they define the Subset Sum Problem. Slide 65, they define the Partition problem. Slide 74, they talk about the Job Scheduling problem. My question is, is it possible to cut the middle man of the partition problem and reduce Subset Sum to Job Scheduling dir...
In the answer to "what is the Hessian" at this site: https://stackoverflow.com/questions/23297090/how-calculating-hessian-works-for-neural-network-learning the person answering the question concludes by saying "Fun fact, adding the momentum term to your gradient based optimization is (under sufficient conditions) appro...
I've implemented kth smallest number using buckets representing the current nibble value of each element in the array where current is a value starting possibly at 64 (for 64 bits integers at most) and decrements each iteration by 4 (nibble size). I was wondering what is the time complexity (worst) of this implementati...
Suppose you want to go from vertex $s$ to vertex $t$ in an unweighted graph $(V, E)$, but you would like to stop by vextex $u$ if it is possible to do so without increasing the length of your path by more than a factor $\alpha$. Find an efficient algorithm that would determine an optimal $s-t$ path given your preferen...
I'm assigned to build a kPDA with 2 stacks that handles {w#w, where w is a string of (0,1)*}. I understand the # delineates the two strings, but I'm unsure of the logic when popping off stacks with epsilon. I asked my professor, verbally, if this works and he told me no, but I can't think of any other way. EDIT: Here...
So i'm relatively new to computer science and have been learning set theory and am stumped on a question in it. The question specifies that we're only looking at subsets of universe U = {0,...,n-1}. For a set S ⊆ U, the characteristic vector denoted by Xs is an n-bit string where j is 1 if and only if j ∈ S. Example,...
I came across a piece of literature in which I saw the intersection symbol (∩) being used on two non-set elements in the definition of an equivalence relation; I have posted it below for reference. The elements in question are meant to represent different files on a computer. What could that intersection symbol mean in...
Quoting from Tannenbaum_Operating_Systems_Design : On top of the operating system is the rest of the system software. Here we find the command interpreter (shell), window systems, compilers, editors, and similar application-independent programs. It is important to realize that these programs are definitely not p...
i am wondering if the following inequality is correct: if a code allows repairing of no more than k errors (inclusive, included) and m is the number of information bits and r the check bits, then $$∑^k_{i=1}\binom{m+r}{i}+1≤2^r$$ holds true? please if you can explain so i can understand how you choose answer you give. ...
I am trying to understand bounded waiting and i have a question. The definition is as follows: Bounded waiting - There exists a bound, or limit, on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that requ...
In the proof that $A_{\text{TM}}$ undecidable we use the following machine: $D =$ On input $\langle M, w \rangle$: Simulate $M$ on input $w$. If $M$ ever enters its accept state, accept. If $M$ ever enters its reject state, reject. But what will happen if change this so that the input is $\langle w \rangle^R$, that...
Today I was learning to convert post-fix expressions to in-fix expressions and vice versa. What I want to know is whether a post-fix expression can have more than one infix representations. For example, if I consider the following in-fix expression: A+B-D/X I get these post-fix expressions: ABDX/-+ and AB+DX/- I did...
How Decision procedure and Decidable problem are different from each other? Both are having solutions in yes and no form. Is any else solution for both?
What is the technical term that describes the use of the same programming language in every tier in the architecture of a system? For example, having JavaScript in model, view and controller. edit #1: MVC was mentioned just to give an example. I read the concept in a book once when I was at the university but can't rem...
So I've seen this claim being made on different questions: Do self-loops in DFA cause infinite languages? I'd like to find formal proof for this. I think I should also note that an "accepting path containing a cycle" is probably defined as a path in a graph so that the states in the DFA are nodes in the graph and the...
This is in regards to a specific TM: $UNIQUE: \{$ TM | TM loops on at least an input, and TM also halts on at least one input $\}$ This is a play on the Halting Problem, where it basically combines $HP$ as well as $\overline{HP}$ into one. We know that $HP$ is NP-Hard, we also know that $\overline{HP}$ is NP-Hard, but ...
I am trying to construct a Turing machine which will double every 'b' in all inputted strings over{c,b}. How can I double 'b' in inputted string? because I cannot replace b with bb because one cell of tape can contain only one character.
I have a context-free grammar defined by the production S: S → aSbS ∣ bSaS ∣ ε I need to prove that the CFG "G" can be defined as a language L(G) where L(G) = {w ∈ {a, b}∗ ∶ na(w) = nb(w)}. Where na(w) = number of a's in w, and nb(w) is the number of b's in w How can I go about proving something like this? Is there...
It seems to me that we can use lookup tables for multiplication of two integers of size $\log(n)/2$, and that the number of entries for each table of these numbers should be $O(n)$. Now, multiplying two $n$-bit naturals together can be assisted by using an FFT of size $O(n / \log(n))$. It seems to me that we can then ...
Let $L_{\pi}$ be the language consisting of prefixes of the decimal expansion of $\pi$: $$L_\pi = \{3, 31, 314, 3141, 31415, 314159, \ldots\}.$$ Prove that Lπ is not DFA-recognizable. You may use the fact that $\pi$ cannot be written as a repeating decimal, that is, there are no sequences of digits $d_1, d_2, \ldots,d_...
Message buffer[N] Int in=0, out=0 send(message msg) while in-out==N do nothing buffer[in modulo N]=msg in=in+1 return message recieve() while in == out do nothing msg = buffer[out modulo N] out=out+1 return msg This is a code for a producer consumer problem. The producer produces a me...
Recently I had a question on one of my assignments asking to prove or disprove the following: Let $L$ be a language. If $L^*$ is context-free then $L$ is context-free. Now obviously this is false since we can take some non-context free language $L_1$ and the alphabet $\Sigma$, then make $(L_1 \cup \Sigma)^* = \Sigma^*...
What is the right way to describe the properties for a method resolution order that naturally lead you to the C3 linearization algorithm? I'm trying to nail down desiderata for an MRO that are conceptually prior to the C3 algorithm itself. I recently read a blog post on C3 resolution order and its use in Python here. T...
I am not sure how to go about this exactly. My attempt is find the pick an arbitrary node and run DFS, ordering each node by order of discovery. After this, You can orient each of edges so it pointing from lower order to higher order. Now I know this will create a path from one node to another, but doesn't guarantee a ...
Basically I'm wondering if the concatenation of two equal length string is context free. I've seen multiple proofs of this online using PDAs but we aren't covering them in my automata course and my professor says they aren't needed for the proof. Any help would be greatly appreciated! This is the full question: For an...
For example: s = <s1 s2 s3> is my problem, I make greedy choice s2 and solve s1 and s3 in a greedy way. In CLRS, it was mentioned regarding "designing greedy algorithms" Cast the optimization problem as one in which we make a choice and are left with one subproblem to solve So why is it that we are left with only o...
In the space of all K-sat formulas, True and False should have an equal set size. For every un-Satisfiable formula (F), there will an F' (or F-prime) which will be Satisfiable by definition. I cannot get my head around this. Edit: Let me put it this way: I have constructed a circuit based on a Boolean formula, it is n...
There is one example in Kolmogorov complexity books and related articles: Consider we have a monkey at a typewriter and a monkey at a computer keyboard. If the monkey types at random on a typewriter, the probability that it types out all the works of Shakespeare (assuming that the text is 1 million bits long) is about ...
I have a slightly different formulation of the stable marriage problem. Basically, I can match one man to one woman, but the preference list is incomplete, which means that a man has expressed interest only in a subset of women and vice versa. I don't think the original Gale Shapley algorithm would work for this, if so...
I am trying to train an autoencoding neural network (autoencoder) to reconstruct seismograms. Previous studies employing this technique (e.g. Valentine & Trampert, 2012) used an L2 (mean squared error) loss function to assess the network's performance, but I'm wondering if there are better loss functions out there for ...
I have algorithm that finds if there are two elements in sorted array that have sum zero. 1.ZeroSumPair(A[1..n]) // A[1..n] <-- sorted 2. l <- 1, r <- n 3. while(l < r) 4. while(l < r or A[l] + A[r] > 0) 5. r-- 6. if(A[l] + A[r] = 0) 7. return true 8. l++ 9. return fa...
Imagine I have a weighted complete directed graph $G$ with $d$ vertices(so $d(d-1)$ edges) and I want to do the following: Set $D$ to be a DAG with the same set of vertices but without any edges sort the edge weights $c_{ji}$ of the original graph by size From the biggest to the lowest edge weight: Add an edge $(j,i)$...
The problem is a bit like bin-packing, so I'll describe it with similar naming: You have $N$ bins, with the same size, $V$, where $V$ is a positive integer This problem has items, and also "pieces" of items: each item is considered a piece, and each piece must always have a "valid size": size must be a positive intege...
Let $$E_{TM} = \left \{ \langle M\rangle \mid L(M) = \emptyset \right\}$$ Prove that there are two languages $L_1, L_2$ such that $L_1, L_2 $ are infinite. $L_1 \cup L_2 = E_{TM}$ $L_1 \cap L_2 = \emptyset$ $L_1$ is decidable, $L_2$ is not recognizable. I'm finding it really hard to find two languages that satisfy...
Im learning about time complexity analysis, and cant seem to figure out why do we consider a hypothetical machine that takes 1 unit of time for arithemitic and logical instructions and 1 unit of time to for assignment and return statements. Q) why does it have to be 1 unit of time? Q) Also is it upto to the analyzer to...
I was reading What Every Computer Scientist Should Know About Floating-Point Arithmetic, which is extremely interesting. But I have some troubles understanding the proof of Theorem 9 (page 33). First a pretty trivial question. When the formula $(15)$ say: $$y - \bar{y} \lt (\beta - 1)(\beta^{-p} + \dots + \beta^{-p-k})...
Suppose we have a function $f$, $$ C = f(A,B), $$ where $A$, $B$ and $C$ are random variables. I notice that when the random variables are binary ($\{0, 1\}$) and $f$ is the XOR operation, we have the following identity: $$ H(C|A) = H(B), $$ where $H(B)$ is the entropy of $B$ and $H(C|A)$ is the conditional entropy of ...
How can I solve the following recurrence without using the master theorem? $T(n)= 4T(n/2)-1$ for $n>4$ and $T(n)=5$ for $n\le 4$, $n$ is a power of $2$.
In "The Art of Computer Programming" by Donald Knuth, the proof of lemma R starts with the assumption that $\lambda = p^e$ which means: $$\left({a^{p^e}-1\over a-1}\right)\equiv 0\pmod{p^e}$$ The above condition leads to: $$a\equiv1\pmod{p^e}\quad(1)$$ Knuth also considers the case when $p=2$ and $a\equiv3\;(\operator...
Suppose I want to do arithmetic without any loss of precision. Floats and doubles are inappropriate. I want to use dynamic memory allocations to store any real number obtained after a finite amount of finite operations (addition, subtraction, multiplication, division), starting from natural numbers without ever losing ...
I need to prove or disprove the following statement: "Let $G$ be a directed acyclic graph, and $v_1v_2...v_k$ a topological sort of $G$. Then $v_kv_{k-1}...v_1$ is a valid topological sort of the transposed graph $G^T$." (The algorithm used is the one presented in CLRS 22.4) I think the statement is correct. My logic i...