instruction
stringlengths
35
29.1k
In social network (an unweighted indirect network), is there some measure of importance of a person A on another person B, denote as I(A,B), so that (approximately): The smaller the shortest distance between A, B in the the network, the higher the I(A,B) (closeness) If A_1 is 1 of the 100 friends of B_1, A_2 is 1 of ...
What is the maximal difference between heights of leaves in an AVL tree? I am interested only in the asymptotic difference. I am not sure about my answer - I think that it is $O(\log n)$, given the fact that at every level we may have difference equal one. Am I right?
I'm currently reading introduction to algorithms and came by Johnson’s algorithm that depends on making sure that all paths are positive. the algo depends on finding a new weight function (w') that is positive for all edges and keeps the correctness of the shortest paths relations. It does so by calculating h(s), h(d) ...
I am reading this classic paper by Klein, Plotkin and Rao titled Excluded Minors, Network Decomposition and Multicommodity Flow. In section 3, Theorem 3.1, they define $\hat \ell(vw) = \lceil \ell(vw)/C\rceil$, where $C$ is the sum of capacities of edges, and $\ell: E \to \mathbb R^+$ is a length function. $dist_\ell(s...
I have an undirected simple graph and an integer x. My goal is to remove x edges from the graph so the largest connected component of the graph after the removal will be minimal. I tried to think how to solve this problem, and i thought maybe using Girvan-Newman algorithm for removing edges with highest Betweenness. Wo...
This is a homework question. Suppose the only accept state is the start state. My rationale for this is that L* is just the concatenations of L, so if all strings in L are accepted, then all strings in L* will be accepted as well. One problem I see with this is that a machine can only accept one language, so it might b...
To be specific, I am using the online website of Strait Times News. It limits users to 30 articles to read per month. I just do not understand how do they know you are accessing? We use different IP each time we go online, don't we? Is there anyway to hack this?
I have been taking a language theory class, and we learned about Brzozowski derivatives recently. At class it occurred to me that they could be used to implement a simple regular expression matcher. If you take the derivative of a regular expression with respect to a given string and the resulting expression matches th...
There is a graph with N vertices numbered from 1 to N. Edge between a and b exists if and only if a|b or b|a. If a|b then the weight of the edge is b/a. If b|a then the weight of the edge is a/b. Given two vertices u and v, I want to find the length of the shortest path between them. I think that the shortest path shou...
I was taught that if you can create a DFA to accept a language, then the grammar that is generating the language is regular. AND A DFA is a finite automata that accepts a language and also rejects the strings that aren't a part of the language. It says if we replace $x$ with $c$ where $c \in \{0,1\}^+$, then $L$ is reg...
In computational theory for deterministic finite automata, there is a 5-tuple representation containing $Q$, $\Sigma$, $\Delta$, $Q_0$ and $F$. I am wondering how one understands thinking about the number of states to construct such a DFA. Example: $$\{w \in\{0,1\}^*\mid w\text{ contains at least two $0$s but does not ...
I am programming CPU cache simulator and I am supposed to implement removing of entries. I will not use LRU but just random. I am not really clear, when should I call the removing function? When cache (2 or 4 caches) are full and CPU wants to write into cache where all (data and tag) of specific indexes are same? Are t...
I am learning the basics of the language C, and so far we have covered up to loops. This question is related to my assignment. The problem is I do not understand what the question is asking. I know the error in the code, but I don't understand what this question is asking me to do? What is an instance? Am I supposed to...
I have a set of nodes where each node $n_i$ is associated with a cartesian coordinate $\vec r_i$ and a radius $\sigma_i$. I want to generate a graph data structure where nodes $n_i$ and $n_j$ are connected by an undirected edge if $|r_{ij}| < \sigma_i + \sigma_j$. This is not my field and I am interested in efficient a...
I have to prove the following problem is in NP (and define verifier as well as the certificate/witness): The input is a set of $n$ boxes with weights $w_{1},\ldots,w_{n}$ and two numbers $s$ and $t$ (all natural numbers). Can the boxes be loaded onto $s$ trucks if each truck can only carry a total weight of $t$? Appa...
I have some arbitrary pairwise similarity metric for some objects, and I am considering trying to find the best way to position the objects onto a line segment such that the pairwise euclidean distances between points on the segment are best representative of the pairwise similarities between the objects. The applicati...
Given a set of $N$ jobs and two machines A and B, each machine can process only one job at a time. Each job, if processed, must be processed by machine A before processed by machine B. The processing time of job $i$ at machine A and B is $t_{i}^{A}$ and $t_{i}^{B}$ respectively. The deadline and the profit of job $i$ a...
Let $\Sigma = \{ \sigma_1 , ..., \sigma_t \}$ and let $S$ be a string from $\Sigma^*$. Denote: $n=|S|$, that is $S$ has $n$ letters. I'd like to find the shortest prefix $T$ of $S$ such that $S$ is a prefix of $T^n$ ($T^n= T \cdot .... \cdot T$, $n$ times). I tried to build the suffix tree for $S$, and then checking ea...
if I have an unsorted array with the length of $10^6$, which is filled with absolutely different float numbers, which sorting algorithm would be the best to use and why? And which one would be the worst? InsertionSort, QuickSort, MergeSort, HeapSort, BucketSort? And would it be a difference if the float values would be...
It is well-known that there is an asymptotic lower bound of $nlogn$ for comparison sorting. However, I am wondering what is the fastest known algorithm for comparison sorting, in terms of the multiplicative constant?
i came across a question with no proper explnation. IF A is reduced to B and B belongs to NPC then we cant say anything about A since it can be as harder a NPH and as easier as P. i know why it is as harder as NHP but i am not able to figure out about P class. according to me if A > B(A polynomial time reducible to B) ...
We can form DFA accepting binary numbers divisible by $n$. For example DFA accepting binary numbers divisible by 2 can be formed as follows: Similarly DFA accepting binary numbers divisible by 3 can be formed as follows: We can follow a well defined procedure to form these types of DFAs. However can there be any wel...
I have a problem I'm trying to answer for my homework. The question is: Let $p$ be a prime number and let $GF(p)$ denote the finite field of size $p$. Suppose that A has input $x∈GF(p)$ encoded with $⌈log2p⌉$ bits and B has input $y∈GF(p)$ encoded with $⌈log2p⌉$ bits. Let $f:GF(p)×GF(p)→\{0,1\}$ be the function defined...
Assume $X$ and $N$ are two sets of vectors (observations) from a normal distribution, where $X$ represents clean data and $N$ represents noise; and $A$ a projection matrix of a filter. The scenario is that our clean data was corrupted by a multiplicative noise via matrix $A$ and an additive noise of $N$: $$Y=A X + N.$...
I'm trying to solve a practice problem in Elements of Programming Interviews (19.4) and I am a bit confused. The question is to determine if an undirected connected graph is minimally connected. The authors define minimally connected as "it is connected and there is no edge that can be removed while still leaving th...
Let's say that you have an infinite grid of cells. A program is run per cell, where you have read access to some finite number of cells (for the previous state in time), but you only have write access to the specific cell you being run on (for the next state in time). The program reads cell data about the LAST state of...
I'm having some trouble with the following language: $L_1 = \{0^i1^j2^k3^m | i,j,k\ge 0,m = i+j+k\}$ with alphabet $A=\{0,1,2,3\}$ I'd like to find a deterministic pushdown automata to recognise it according to the empty stack criterion. I built the deterministic pushdown automata according to the final states criteri...
I read an interesting comment in a paper recently about how weirdly useful maths turns out to be. It mentions how polynomial time doesn't have to mean efficient in reality (e.g., $O(n^{999999999999999999999})$ is polynomial time, but not efficient). Yet, isn't it the case that all algorithms in polynomial time also hap...
How do I check wether a string is generated by given regular grammar? I know you can check for it in O(N), what is the algorithm called?
I am trying to learn NFA to DFA. This is the original image To begin the process of converting to DFA, I started off with the start state and noticed that if the input is a 1, this means it goes to qb, which would be represented as {qa qb}. I also think it would loop onto itself because if you have a 0 and are in that...
I am having trouble finding out what a primitive subset of the lambda calculus would look like. I reference primitive recursion as shown here: "https://en.wikipedia.org/wiki/Primitive_recursive_function". These are the three base axioms: Constant function: The 0-ary constant function 0 is primitive recursive. Successo...
Without using pumping lemma for deterministic context-free languages I need to prove that the language $\{u\colon |u| \text{ is odd and $b$ is in the middle}\}$ is not deterministic. Someone suggested me that I could try to deduce that if it were deterministic then the language $\{a^nb^nc^n\colon n\ge0\}$ would be cont...
I'm investigating different solutions for solving what looks like a decision making problem. Although the domain I'm working on is different, for the problem at hand, it's quite easy explaining with an example of online shopping cart. Suppose you have a shopping cart like you have in every online retailer but this one ...
After asking this question I was thinking about some variants of subset sum problem (SSP). The usual subset problem is the following. Instance: Given a set of $n$ integers and an integer $\sigma$. Question: Is there a non-empty subset that sums to $\sigma$? The three variants of subset sum that I thought about are (I...
Speaking of context-free (and maybe regular? or just any?) languages, what do you call a function defined as follows: Let $\Sigma$ be the alphabet of $L$, $\forall \sigma \in \Sigma: f(\sigma) = L'$, where $L'$ is some language. I also met this definition: $f:\Sigma \to 2^{\Delta^*}$. The reason I'm asking this is beca...
Let $G=(V,E)$ be a DAG. For each $v\in V$ you have a color $c(v): V \rightarrow \left\{c_1 \ldots c_k \right\}$ where $k$ is a fixed number, and a weight $p(v)$. For every $v \in V$ you have to find its descendant that has the same color and the lowest weight. The problem requires an algorithm that runs in linear time....
I understand how the layer works to an extent, but cannot seem to figure out if the data link handles big frames more efficiently due to error detection or small frames better. I am assuming from my understanding that the data link works better with small frames as it can save time by not having to keep retransmitting ...
I have this java function: public int foo(ArrayList l, int n) { if(n <= 1) return l.get(0); if(l.get(0) < l.get(1)) l.remove(1); else l.remove(0); foo(l, n-1); } So I figure to show that the algorithm is correct I would use an induction proof. However what I am not so sure about is how to go abou...
I am trying to find any datastructure/algorithm suitable to index & retrieve domain names & its associated documents. The records that need indexing will typically be like: www.facebook.com, 123 stackoverflow.com, 1231 www.facebook.com, 124 stackoverflow.com, 3456 cdn.facebook.com, 4566 google.com, 903002 google.co.nz,...
I'm trying to show the set of all recursively enumerable sets is closed under concatenation. I'm trying to use the definition of recursively enumerable sets to construct the argument. I believe that I must consider the Cartesian product $S_1\times S_2$ of two recursively enumerable sets $S_1$ and $S_2$. Then I constru...
I'm looking for an online algorithm that takes a stream of elements and preserves the elements that are on the Pareto frontier (e.g. all non-dominated elements). For instance. Given the following inputs, the retained Pareto frontier set would evolved as follows: (3,7) insert element b/c it's the first element pareto...
A program can have finite output, yet still not halt. Example: 1: output "Yolo" 2: output "" 3: go to step 2 This only ever outputs "Yolo", despite never halting. Is there some way, with a halting oracle, to determine whether a program will have infinite output or not? Bonus: If not, what would be the Turing Degree of...
I am aware that there is a considerable amount of interest in computational mechanics for simulation of cloth, hair and other elastica, particularly for animation films. The methods developed by groups in computational mechanics (that I am aware of) are typically far from real time. My question is if there are any dep...
In NLP, rule-based/linguistic approaches are usually said to provide relatively high precision but low recall compared to for example machine learning approaches. I think this is often true for almost any classification task in NLP. However, I couldn't find a paper which specifically examines this phenomena. Can someon...
I'm currently reading about algorithms and big O notation. I have come across som examples which for instance says the following: n is O(n^2) 3n^2 + 7n is O(2n^2 + n) 5n^7 is O(2^n) 3^n is not O(n^4) (1/n)^2 is not O((1/n)^3) n^2 is not Ω(n^3) Can somebody explain to me what is meant with these sentences? I know wha...
I have been trying to solve the following recurrence: $$T(n)=T(n-1)*T(n-2)$$ The initial conditions are $n \ge 2$ and $T(0) = 2$ and $T(1) = 4$. I started by taking the $\log_{2}$ of both sides to get $$\log(T(n)) = \log(T(n-1)) + \log(T(n-2))$$ which looks an awful lot like a Fibonacci recurrence. So if I set $S(k)...
I have been researching on finding optimal solutions to generating University Time Table using Genetic Algorithm. I am searching for a Academic Paper, that properly defines the University Time Table design problem and proves it is NPC.
I am trying to implement k-shortest paths algorithm in NS-3 for IPv4GlobalRoutingProtocol. I am concerned about how to avoid looping of packets. My implementation calculates k-shortest paths from every node to every other node in the network and accordingly I store the possible nexthops (to which the packet may be forw...
Let $c\in \mathbb{N}$. Denote: $L _c= \{ \langle M \rangle \mid \exists _{U \subseteq \Sigma ^* }$ s.t. $|U| $ is infinite and for each $w\in U $ the TM $M$ accepts $w$ within no more than $c$ steps $\} $. I would like to prove that for any given $c$ the language $L_c \notin R $. I would like to find a language $L \no...
A semaphore is a variable that, apart from initialization is accessed through only two standard atomic operations wait(s) and signal(s). wait(S){ while S <= 0 ; //no-op s--; } signal(S){ s++; } The function $wait()$ is an atomic operation which means that either it is executed in its entirety or it is...
Question: Given $n$ points in metric space, find a pair of points with the largest distance between them. If we restrict ourselves to $d$-dimensional Euclidean space then, a naive algorithm of finding distances between all pairs of points in a space of dimension $d$ and selecting the maximum requires $O(dn^2)$ time. ...
I've been unable to find what class of languages is recognized by PEGs. The original paper [1] only conjectures that there are some Context-Free Grammars that are unrecognizable by PEGs. It also demonstrates how to construct a Top-Down Parsing Language grammar from PEG, but I've been unable to find what language is rec...
Diameter of the tree is defined as a long path or route, between any two nodes in a tree. The path may or may not goes through the ROOT. Print the Longest leaf to leaf path in a binary tree and its length I worth an algorithm that calculates the diameter in Swift: func diameter() -> Int { return diameterHelper(root).D...
I am trying to solve the following equation using master's theorem. $T(n) = 3^n T(\frac{n} 3) + O(1)$ Extracting the b and $f(n)$ values makes sense they are $b=3$ and $f(n)=1$. I am not sure what my $a$ value is I don't think its just 3.
I have the following problem, and I try to prove that it is semi-decidable, but I have a hard time arguing about it. I know that if a problem $\mathcal{P}$ is semi-decidable, then we can build a program $\Pi$, such that $\Pi$ takes as input instance $I$ of $\mathcal{P}$, and if we have a positive instance, then $\Pi$ ...
A typical HDD would represent information as either 1 (e.g. spin up) or 0 (e.g. spin down). Let's assume you want to represent the information physically in a hex system with 16 states, and assume this is possible with using some physical form (maybe the same spin). What is the minimum physical size of a memory element...
Let $L_{NTF} = \{ \langle M \rangle \mid $ for every $x\in\Sigma^* $ the machine $M$ does not reach the $|x|+10$'th cell during its calculation on $x$. $ \}$. I would like to prove or disprove $L_{NTF} \in RE$. I know how to easily prove that $L_{NTF} \in Co$-$RE$, because it is enough to find one word $x$ such that $M...
I am reading a computer theory book and came across the following example converting a NFA to a DFA: My question is, would you not need an edge labeled $b$ going from the $x_4$ node on the right to the null collection state?
I am trying to find Big O of this formula: $T(n)=T(n-1)+2n$ by using iteration however I am stuck on a step. $T(n)=T(n-1)+2n$ I then plugged $T(n-1)$ into the equation so $T(n-1)=T(n-1-1)+2(n-1)$ which then I got $T(n)=T(n-2)+2(n-1)+2n$. $T(n-2)$ gives $T(n-3)+2(n-3)$ which plugging it back in gives $T(n)=T(n-3)+2(n-3)...
Considering the top answer to the question “If xor-ing a one way function with different input, is it still a one way function?”… The function is no longer one-way. we build a counter example in the following way. Assume $g$ is a one-way function that preserves size, and define $f$ on input $w=bx_1x_2$ in the followi...
I know that Insertion Sort is faster when size $N$ is a small number, hence by modifying Merge Sort to use Insertion Sort when size $N$ reaches $K$, can help improve the performance. How do I analyze this and prove that the running time of Merge Sort, $O(N \log N)$ is turned into $O(NK + N\log N(\frac{N}{K}))$? I wou...
In CPU scheduling HRRN(Highest Response Ratio Next) algorithm chooses the next process to be scheduled using the formula (W+S)/S where W-> waiting time & S->Service Time. Can someone share their intuition behind this formula? How does this calculate Highest Response Ratio?
I am trying to write a program to recognize if a given lambda calculus expression is primitive recursive. I believe that a general algorithm to do this does not exist, but I am interested in the most general algorithm. This is a subset of the primitive recursive functions in the LC. Primitive recursion is built up fro...
I was reading Application of DFS from here where I came to a statement which I cannot really understand. Would anybody mind explaining this to me. For an unweighted graph, DFS traversal of the graph produces the minimum spanning tree and all pair shortest path tree. My doubt: Is there anything "Minimum spanning tree...
Given an N sized array A of unsorted integers and an integer K, derive a square matrix M of order N where $ M_{ij} = A_i * A_j $, and return the number of sub matrices of M where the sum of all of its elements is K. Example: $A = \begin{Bmatrix}1&-1\end{Bmatrix}$ $K = 0$ Thus: $M = \begin{Bmatrix}1 & -1\\-1 & 1\\\end{B...
I am looking for a formula for determining the expected number of independent sets of size $k$ (for arbitrary $k$) in a random graph $G(n,p)$. Here $n$ is the number of vertices and each edge is included with independent probability $p$. I would like to be able to calculate this for arbitrary $p$ if possible. I have co...
A process running on CTSS (Compatible Time Sharing System) needs 30 quanta to complete. How many times must it be swapped in, including the very first time (before it has run at all)? • Answer : The first time it gets 1 quantum. On succeeding runs it gets 2, 4, 8, and 15, so it must be swapped in 5 times. why does it g...
Let $P$ be a problem that you need to study its difficulty, i.e., NP-hard, Polynomial-time solvable, etc. My question is: If I reduce a known polynomial time problem (say, maximum matching in bipartite graph) to $P$, why I can say that $P$ is an easy problem? My guess is: No, we cannot say that. Why? Because f...
Let $A$ be an arbitrary set in PH. Suppose PH$^A$ collapses. I am now asked to show that PH itself must collapse. I have remarked that, since $A$ is in PH, $A$ must in particular be in one of the $\Sigma_i$'s, say $A\in\Sigma_n$ for $n\in\Bbb N$. Also, PH$^A$ collapses, so PH$^A = (\Sigma_m)^A$ for some $m\in\Bbb N$. B...
Is is more accurate to say that in complexity theory: $$\text{exponentiation} \leq_p \text{multiplication}$$ or $$\text{multiplication} \leq_p \text{exponentiation}$$ I understand that if we know how to do multiplication, then we can run multiplication in a loop in polynomial time to get the answer to the exponentiatio...
Let: f be a decidable decision problem. g be an undecidable decision problem. I refered to those rules: If $f$ reduces to $g$ and $g$ is decidable $\implies$ $f$ will be decidable. If $f$ reduces to $g$ and $f$ is not decidable $\implies$ $g$ will be not decidable. Questions: 1) It may be possible to reduce $f$ to...
I'm struggling to find how to calculate the channel capacity from a binary symmetric channel, given alpha(mean error) = 0.25 p(x1) = 0.25, p(x2) = 0.75 r = 1.25MBits/sec I found this in the course: C = r . { 1 - omega(alpha) } So I'd have C = 1.25Mbits/sec * { 1 - omega(0.25) } However, I'm stuck on how to calc...
The minimum zap problem below is Exercise 11 in Jeff Erickson's lecture on "Greedy Algorithm". The minimum zap problem can be stated more formally as follows. Given a set $C$ of $n$ circles in the plane, each specified by its radius and the $(x, y)$ coordinates of its center, compute the minimum number of rays from th...
I know the procedure to apply the Ackermann's reduction to a formula that doesn't involve uninterpreted predicates. But, how do we treat the uninterpreted boolean predicates? Nearly all the examples I have seen, usually just assume there are no uninterpreted predicates, and give examples of simpler reductions, but if w...
I am trying to understand the definition / meaning of reduction. Is it correct to say that the statement "Problem $A$ reduces to Problem $B$ in $x$-time" is the same as writing $A \leq_{x} B$? For example $\text{SAT} \leq_{polynomial} \text{3-SAT}$. If we are reducing problem $A$ to $B$ in $x$-time, does it mean that ...
Assume you have a binary tree of additions, where each two nodes are added together until the root is the sum of all the nodes. For example: 3 2 1 3 \ / \ / 5 4 \ / 9 To minimize the depth of this tree is easy: I can just run DSW on it for instance. The reason I can do this is...
I have written a recurrence relation to describe a recursive algorithm finding the maximum element in an array. The algorthim has an overlap, meaning both of the subarrays that are recurred on contain the middle element of the array. $T(n) = 2T((n+1)/2) + c$ However, I want to simplify this recurrence relation more. Si...
I came across someone else's old post here Designing a DFA that accepts strings such that nth character from last satisfies condition And decided to try it. Apparently it was a homework problem but it was from 2013 so I assume it is okay to discuss it openly by now. The problem is: Design a DFA that accepts strings h...
I got this question: Let $A \oplus B = (A\cap \bar{B})\cup(\bar{A}\cap B)$. Proof that $NP = coNP$ if and only if $A,B\in NP$ and $A \oplus B\in NP$. But I don't know how to proof the direction that if $A,B\in NP$ and $A \oplus B\in NP$ then $NP = coNP$. I have tried to build the non-deterministic machines for $\bar{...
Does the conviction "L-uniform NC1 != NP is incredibly hard to prove!" express the core of "P != NP is incredibly hard to prove!" in a similar spirit as the conviction "The polynomial hierarchy doesn't collapse!" expresses the core of "P is not equal to NP!" ? Let me try to elaborate: The P vs NP problem implicitly inv...
Problem: There are two types of balls, big (B) and small (S), which need to packed into boxes. One box can contain either: nothing, or 1 S, or 1 B, or 2 S, or 2 B, or 1 B and 2 S We are given the weight (float not integer) of each ball (in array $w$). There are some constraints on the weights of the boxes and balls: ...
I have a video that record the drawing sequence with a pencil by a painter. I want to reconstruction the sequence from the video. And I have google some keywords like "drawing sequence reconstruction", "sketch reconstruction", and have searched like "moving object detection" but cannot found what I want to find. I wan...
I'm struggling to understand the purpose of universal and existential quantification of types. I'm playing around with writing a toy language based on the calculus of constructions. I've been reading about Morte and Henk to help me get a better understanding. I don't understand why the CoC has both lambda and forall ab...
When I was working with finite automata, I figured out that we can put together two FA two build a new one that is the intersection between the two. This is possible because regular languages are closed under intersection. Now, I am having many difficulties in drawing PDAs especially the ones that are apparently the in...
Let us say that I have a problem $P(n)$ that I need to solve (where $n$ is the size of the input of problem $P$). I used a polynomial-time reduction from a known NP-hard problem $Q(m)$ (where $m$ is the size of the input of problem $Q$) to $P(n)$ and showed that $P(n)$ is NP-hard. The time complexity of the reduction i...
Is there a reduction from ATM to ATM-complement? (ATM denotes the language $\{\langle M,w \rangle \mid \text{TM $M$ accepts $w$}\}$) I have been thinking about it too much and couldn't find the answer. I know that reduction from ATM-complement to ATM is not possible becouse if it was, ATM would not be in RE. But how ca...
I wish to find the CFG for a language on two symbols (say a and b) whose words begin and terminate with the same symbol, and have equal quantities of a's and b's. What is the thought process I should use for finding such a grammar? What is the most natural or simplest grammar for this language? I hope you'll explain...
I have this question: $L = \{\langle M \rangle | M$ is TM that accepts every palindrome over its alphabet $\}$ Proof that $L$ is not Turing-recognizable by showing reduction from other non Turing-recognizable language. What I have tried to do is to show reduction from $A_{TM}$ (Accept problem) to $\bar L$, and I di...
I have been studying deductive verification of software lately, with weakest precondition, strongest postcondition, annotation calculus, and etc. I came across the following rules for the while sentence: But, my problem is when should I use which rule? I mean the second and third one that includes $t$, which is the va...
I'm trying to understand how oblivious RAM works, specifically path oblivious RAM. While I understand how this technique offers protection when reading data - multiple randomly distributed reads obfuscate the access pattern of the data actually requested - I can't tell how that helps protect against an attacker who is ...
I stumbled across this question and answer (source): Question: Suppose someone presents you with a solution to a max-flow problem on some network. Give a linear time algorithm to determine whether the solution does indeed give a maximum flow. Answer: First, verify that the solution is a valid flow by comparing the f...
I'm comparing several methods for building inverted indexes (n-grams, hash boundaries, etc.). Given a set of queries, these indexes perform differently. On one hand, I get performances metrics (efficiency) such as the time needed to execute the query. On the other hand, I get metrics such as precision and recall (eff...
I have to find an example of a model where the LTL-formula $F G p \wedge F q$ is valid and the CTL-formula $EF AG p \wedge AF q$ is not valid. I found this example, but I'm not completely sure whether it's correct:
I have a problem with following task: $4COL \in PTIME \Rightarrow 3COL \in PTIME$. Is there any elementary proof to do it?
The density of a Subset Sum instance $S = \{ s_1, \dots, s_n \}$ of size $n$ is defined as $\qquad\displaystyle d(S) = \frac{|S|}{\log_2(\max_{s \in S} |s|)}$. Why is the hardness of Subset-Sum dependent on its density?
Here is an example of table with 32 bit addresses and their respective indexes and tags. The cache has a total of 8 blocks and 2-word blocks. So since we have 2 word blocks, that means that the offset is 1 and we use the least most significant bit as the offset. So in the first row, it not only brings 3 but it also br...
I'm trying to make sense of regular languages, operations on them, and Kleene operations. Let's say I define a language with the alphabet {x, y}. Let's further say that I place the restriction that there can be no string in the language that contains the substring 'xx'. Thus, my language could be expressed as L = {y, ...
There is are two esoteric languages with minimally functionally complete operators, iota and jot, that are closely related to SK combinators. I'm attempting to understand the relationship between these languages and propositional calculus. We know $K := P → (Q → P)$ and $S := (P → (Q → R)) → ((P → Q) → (P → R))$ My que...
I am reading one of Guido van Rossum's essays on optimization in Python. We are interested in converting a Python list of integers to their character equivalents. Here's the straightforward algorithm. def f3(list): string = "" for character in map(chr, list): string = string + character return str...
What is the maximal number $c$ of single rotations after deleting a node from an AVL tree? We treat double rotations as two single ones. I know that it is $O(\log n)$ but I'm trying to find a more precise number – it is in $[\log n, 2\log n]$ of course. Nevertheless, I am dying to see the exact value of $c$.