instruction
stringlengths
35
29.1k
I'm trying to make a regular grammar for this language: Where the alphabet is $ \Sigma $ = $\{a,b,c\}$ It seemed like it would go well with a right-linear grammar. This may be disastrously wrong, but here's how I started: $S \to aA$ $A \to aA | cB $ $B \to bC | C $ $C \to cD |$ $\lambda$ $D \to cC$ EDIT: Corrected fo...
I know that Stable set cannot be approximated to constant factor. I saw a simple proof using OR product sometime back. I am unable to recall it. If anyone here knows what I am talking about could help fill my memory, that will be helpful. Is there a graph product $\cdot$ such that $\alpha(G\cdot G)=\alpha(G)^2$ for all...
I'm trying to figure out how to build a regular expression for a language that doesn't contain strings that contain $101$ or $001$. The alphabet is defined as $\{0, 1\}$. I'm stuck on trying to figure out the DFA. Any help would be appreciated.
I am trying to find the answer to the following question for the Floyd-Warshall algorithm. Suppose Floyd-Warshall algorithm is run on a directed graph G in which every edge's length is either -1, 0, or 1. Suppose that G is strongly connected, with at least one u-v path for every pair u,v of vertices, and that G may hav...
So I'm studying for my data structures midterm and my professor gave out a sample midterm with the answers, but I'm having a hard time understanding one of the questions. Here's a screen cap: The answer is n^2(n+1)/2. I would appreciate a very simple walk through and/or a pointer to some good material.
So I'm studying for a midterm and my professor put out a sample exam with the answers, and I'm stuck on one of the questions. The answer is Big-O(n^2 log n) Could someone show me the steps necessary to go from regular time complexity to asymptotic time complexity?
Can a problem be both NP-Hard and CoNP? Can a problem be both NP and CoNP-Hard?
I made a right-linear grammar from a regular expression: The alphabet is: $Σ = \{a, b, c\} $ Regular expression: $r = cc^{*}(ba)^{*}bb$ My solution, it seems a little too short like I'm leaving something out. Maybe someone can see where I went wrong on the right-linearity: $ S \to cA $ $ A \to b a A | B | cA $ $ B \to ...
I used this generalized transition graph with 3 states and got an equivalent generalized transition graph with 2 states: GTG: Equivalent with 2 states: I'm not sure about the regular expressions linking the nodes $q0$ and $q2$, if someone can clarify where I may have gone wrong here.
Let $f(x)=a_0+a_1x+a_2x^2+\dots+a_nx^n$, where $a_i\ge0$ and $a_i$ is integer. Given $f(1)=p$ and $f(f(1))=q$, we have to find $a_0$, $a_1$, $a_2$, $a_3$, $\dots$, $a_n$, where such $f(x)$ exists. Or we have to confirm if such $f(x)$ exists or if the polynomial is ambiguous e.g. for $p=1$ and $q=2$, no such $f(x)$ exis...
There is a long-standing and seemingly ever-growing trend to reduce various (even undecidable) problems to SAT to get practically useful solvers, like for instance [1]. I'm looking for some kind of survey or list of papers/projects that fall into this category. [1] Chad E. Brown: Satallax: An Automatic Higher-Order Pro...
There are $n$ elements in a hash table of size $m \geq 2n$ which uses open addressing to avoid collisions. The hash function was chosen randomly among a set of uniform functions. A set $H$ of hash-functions $h:U\to\{0,\dots,m-1\}$ is called uniform, if for every tuple of different keys $x,y \in U$ the number of hash-f...
Would it be possible to apply $(\lambda x.\lambda y. x)$ to the argument $y$? It seems to me that this must not be possible as it would give a different answer if applied to a constant, call it $\alpha$ and $y$. Namely: $(\lambda x.\lambda y. x) \alpha = \alpha$ but $(\lambda x.\lambda y. x)y = \lambda y.y$ I am afrai...
I'm taking the MIT Open Courseware for Introduction to Algorithms and I'm having trouble understanding the first homework problem/solution. We are supposed to compare the asymptotic complexity (big-O) for different functions: $f_1(n) = n^{0.999999}\log(n)$ $f_2(n) = 10000000n$ $f_2(n)$ is obviously O(n), but the big-O ...
I recently did work in the area of machine learning for one of my jobs and was able to build a classifier which evaluated to an F score of 85%. I also have access to correctly and incorrectly classified instances. My boss would like to make sure my classifier is good and and test it for statistical significance. I'm no...
I am trying to work out the recurrence relation for Ternary Search. This is what I came up with: C(n) = C(n/3) + 2 However, I talked to my professor and he said it's not correct. He says that we need to take all of their cases into account. This part confuses me a little bit, can you please clear it for me? Thank you....
I have this equivalence relation problem: Let $R$ and $S$ be two equivalence relations on the same set $A$. Define a new relation $U$ such that $U(x,y) \leftrightarrow [R(x,y) \text{ or } S(x,y)]$. Is $U$ necessarily an equivalence relation? I said that is was an equivalence relation because $U$ is only true if $R$ o...
I'm trying to flesh out a proposed application model where all peers in a distributed network discover each other in the least possible propagation time. But I'm reached the limit of my knowledge of network theory and my naive search keywords return too many disparate PDF white-papers to narrow down. So my question is...
Does $P=NP \implies NL=P=NP$? The converse $NL=NP \implies NL=P=NP$ is clear. Assuming $NP=PH=PSPACE$ is not true, if $P=NP$ is there anything else that can be used to show $NL=P=NP$? Do the $P=NP$ barriers apply to $NL=P$ question or $NL=NP$ question?
I am trying to analyse the runtime of this algorithm: for(i=1; i < n; i++){ for(j=1; j <= i; j++){ statement1; } } Expanding the above loop into. First : for(j=1; j <= 1; j++){ statement1; //complexity O(1) } Second: for(j=1; j <=2 ; j++){ statement1; //complexity O(2...
In this table B is foreign key referring to the primary key A with on delete cascade option.What will be the result after deleting (4,3) and how A:1 4 2 9 3 5 B:3 3 4 2 9 4
I have N by N symmetrical matrix with each side having the same items. A B C D A 0 B 4 0 C 8 3 0 D 3 1 8 0 In reality this would be much larger (100 x 100) I am trying to find a subset of a fixed size in this matrix with the highest score. For example the selection ABC would...
Do Natural Proofs, Relativization and Algebrization also affect separation of other complexity classes like $L\neq NL\neq NP\neq coNP \neq PH\neq PSPACE$ etc?
Reading an article on integer factorization I implemented the following - rather inefficient - factorization method: Every odd composite can be factored as a difference of squares: $$ ab = \left[\tfrac{1}{2}(a+b)\right]^2 - \left[\tfrac{1}{2}(a-b)\right]^2$$ We can look at values of $f(x) = x^2 - n$ until w...
When we talk about DFA, we say that each new character from the input requires one memory access. What does that mean? This is what I think about this. Please tell me is this right? For example, I have a transition table stored for a certain regular expression in memory (RAM). Now, for each input character the CPU wi...
Here is my approach First I compute the longest non decreasing sub-sequence in $N \log N$ time. Algorithm to do this (that only uses arrays and binary search) can be found here: http://en.wikipedia.org/wiki/Longest_increasing_subsequence#Efficient_algorithms Let's suppose the longest subsequence has $L$ elements. Then...
I am having challenges (in two phases) with creating a CFG. Derive the CFG for the following language Show parse trees for the strings cacab and aacabbb obtained from the grammar designed above. I am getting a bit mixed up by the exercise especially because my CFG appears not to produce a parse tree. Here is the lan...
I am working on a diagram editor. Diagrams display 2D shapes (nodes) connected with connectors (edges). I'd like to add an operation that, given a selection of nodes, "disentangles" them: it repositions them to minimize the number of crossing edges, if possible (and it's OK if the edges will have to be drawn with bend ...
Is it possible to use Dependent Types in the existing Typed Racket implementation? (ie do they exist in it?) Is it reasonably possible to implement a Dependent Types System using Typed Racket?
I am reading a paper on Semi Supervised Learning and I am confused about a term. The paper talks about graphs that are invariant to permutations of the vertices. Can somebody explain or perhaps give an example? Is it same a regular graphs?
I have been reading about the Strassen Algorithm for matrix multiplication. As mentioned in Introduction to Algorithms by Cormen , the algorithm is not intuitive. However I am curious to know if there exists any rigorous mathematical proof of the algorithm and what actually went into the design of the algorithm. I trie...
I know that an ε-NFA (NFA with epsilon transitions) is not an NFA or a DFA and an NFA is not a DFA. HOWEVER, say you have a complete DFA. Isn't that theoretically an NFA and an ε-NFA? Just because it doesn't have ε transitions, does it mean it is not ε-NFA? If a question asks you to turn a DFA into an ε-NFA, can't you ...
We have two sets of vectors of positive numbers, $X$ and $Y$ where for $x\in X$ we write $x=(x_1,x_2,\ldots,x_k)$ and similarly for $y\in Y$ we write $y=(y_1,y_2,\ldots,y_k$). We are given two vectors $l=(l_1,l_2,\ldots,l_k)$, and $u=(u_1,u_2,\ldots,u_k)$ such that $l_i\le u_i$ for all $i$. We want to find all pairs $(...
Here is a simple transition system of beverage vending machine: The exemplary execution fragments can look like this: Now, imagine we have multi-process TS where processes are identical and communicate over channels. I don't understand the semantics of how to present an execution fragment that runs across multiple p...
Is it possible to count in Automata theory? I am begginer in Automata theory and I am trying to do some examples. Currently I am working on a program that will recognise equal numbers of 0 and 1, but they are orderd in such manner that they are together, example: $$ 000111\rightarrow true \quad 0001111\rightarrow fals...
Given a sequence $(a)$ of lenght $n$, such $a_1 = a_n = 1$ and $a_i \in \left \{ -1, 1 \right\}$. We want to find a subsequence $(b) \subset (a)$ which statisfies the following conditions: The length of $(b)$, (let's call it $k$) is the largest possible $b_k = b_1 = 1$ Each prefix sum $b_1$, $b_1+b_2$, $b_1+b_2 +...
I'm working on a proof that deals with a modified PDA, which is identitical to a PDA, but with transitions: \begin{equation*} a,b \to c \end{equation*} where $a$ is a context free grammar, instead of just a symbol. The modified PDA then reads a prefix $w'$ of $w$, the suffix of the input stream, where $w' \in L(a)$. I'...
A deterministic computation can only be run backward in time, if all transitions are one-to-one. This restriction is absent for non-deterministic computations. Hence it seems to me that non-deterministic computations be can run both forward and backward in time. But because the output becomes the input for the reversed...
I'm having a lot of trouble constructing a PDA for the language: \begin{equation*} \{a^m b^n : m < 2n < 3m \} \end{equation*} I know if I push a symbol for each $a$ I see, then pop 2 symbols for each $b$ I see, then I should run out to satisfy the $m < 2n$ part of the inequality. But I really don't understand how to in...
What is the time complexity of the recurrence relation T(xn) + T((1 − x)n) + cn
I can't seem to find this stated explicitly anywhere, which makes me wonder if I have it all wrong. So first, let's say we view problems in NP as degenerate problems in FNP, where the codomain of the binary relation is the set {true, false}. Second, FSAT is known to be FNP-complete, meaning that everything in FNP can b...
I been looking at this site and it says that people found solutions for TSP tours that are just 0.031% higher than the optimal tour is. Without finding the optimal tour how does they know what length it is supposed to be?
Those terminologies confuse me. As I understand SAT solver: decide the satisfiability of propositional logic (using DPLL or Local Search). Decision procedure is a procedure to decide the satisfiability of a certain decidable first-order theory. SMT solver is a SAT solver + decision procedure. Theorem prover indicates...
It is known that HORN-3SAT is complete for $P$ under Logspace many-one reductions ($<_L^m$). This implies that $\bar{A} <_L^m A$ for any $P$-complete problem $A$, where $\bar{A}$ means the complement of $A$. This immediately follows from that fact that $P$ is closed under complement and the $P$-hardness of $A$. My qu...
After skimming Multiplication by a Constant is Sublinear (PDF), (slides (PDF), slides with notes (PDF)) I was wondering if this could be extended to division by a constant in sublinear time? Additionally, what about division with a constant numerator, ie. "division of a constant"?
I am reading "Neural Networks and Learning Machines" and in Chapter 11 the book covers Boltzman machines and it is stated "the network [Boltzmann machine] can perform pattern completion", but does not show how this would be done in practice, or how a Boltzmann machine could be used at all. As I am more the "hands-on" p...
I'm just wondering what the correct notation is when referring to an average case complexity of an algorithm that was calculated by doing empirical analysis. For example, I have tested my algorithm and fitted the results to the curve $f(n)=2.65\times 10^{-15}\cdot(2.17^{n})$ and in my report right now I'm saying someth...
Assume two languages $L_1$ and $L_2$, both of which are non-context-free. Let $L = L_1 \cap L_2$. Could $L$ be context-free?
I was reading a proof that said that if $A \le_{m} \bar{A}$, then it can be inferred that $\bar{A} \le_{m} A$ as well. Is this a logical conclusion, and if so, why? I didn't think this followed with languages A and B, but if B is A's complement, can one make such a statement?
Give a context free grammar for the following language over $\Sigma = \{0,1\}$: $ L = L_1^* $ where $ L_1 = \{0^n1^n : n \geq 0\}$. Not really sure where to start with this one. Any help is appreciated
This almost makes sense to me, but I feel like I'm missing something. I know that for a decidable language, there must exist some total computable function $f$ that can take in any $x \in \sum^{*}$ and tell us whether or not $x$ is accepted (while my textbook is unclear, I would infer from this that decidable languages...
I am trying to find an efficient solution to my problem. Let's assume that I have positive weighted graph G containing 100 nodes(each node is numbered) and it is an acyclic graph. So there cannot be any edge like 2,2 or 2,1. I have got a list of nodes let's say 10 from graph G. Let's say each of these nodes are also in...
Suppose I am given a number $n$ (less than $10^8$) and $m$ (less than $10^7$) and $p$ (less than $10^4$), I have to write a program to find number of numbers that divide $n^m$ exactly $p$ times. Mathematically, I have to find number of distinct $x$ such that $$ n^m \equiv 0 \mod x^p \qquad\text{and}\qquad n^m \ne 0 \mo...
Wikipedia: The structured program theorem [...] states that [...] any algorithm can be expressed using only three control structures. They are Executing one subprogram, and then another subprogram (sequence) Executing one of two subprograms according to the value of a boolean expression (selection) Executing a subpro...
Have the bioinformatic methods like sequence analysis, genome annotation, comparative genomics (and many others), been applied to solve problems outside the field of bioinformatics?
I'm reading this article about game semantics and I'm a bit puzzled with the definition given for $\Upsilon$ in section $3.3$. There are some points that are either unintelligible or that don't make sense at all. The definition provided is based on the concept of schedule: A schedule $e:\{1, \ldots, n\} \rightarrow {0...
I have some difficulty trying to tell which equation to use when I'm given an explanation on how an algorithm operates. Especially divide and conquer. Normally I see these kind of equations: C(n) = aC(n/a) + b where a and b are constants Other times I don't see the a in front of C(n/a) as an answer. That really confus...
I have written an A* algorithm to find the shortest path through a directed cyclic graph. I am trying to modify it to find the longest path through the same graph. My attempt was to write it so that all I change is [1] the weights per edge (making them negative instead of positive) and [2] the heuristic function. I se...
I am writing somthing about Ppumping Lemma. I know that the language $L = \{ a^nb^n| n ≥ 0 \}$ is context-free. But I don't understand how this language satisfies the conditions of pumping lemma (for context-free languages) ? if we pick the string $s = a^pb^p, |s| > p , |vxy| < p \land |vy| > 0$. it seems it will be ou...
I'm trying to solve the following problem related to distribution- I have a list L of items (I1, I2,....In) sorted in order of importance, I1 being the most important. Each item has multiple tags assigned to it and the combination of these tags can be different on each item, so I1 may have tags T1 and T2, I2 can have t...
Suppose I have $n$ independent observations $x_1,\dots,x_n$ from some unknown distribution over a known alphabet $\Sigma$, and I want to estimate the entropy of the distribution. I can count the frequency $f_s$ of each symbol $s \in \Sigma$ among the observations; how should I use them to estimate the Shannon entropy ...
I'm learning about Support Vector Machines(SVM). I understood that their objective is to maximize the margin between the decision line and the closest point to it. For simplicity, let's assume we have a linear SVM and linearly separable data X. We would like to find the maximum distance D and vector W, such that $\dfra...
This is a question from the exam of our "Automata and Formal Languages" course. There is a question where asked to prove or disprove that any "relative complement" operation between two context sensitive languages will also produce a context sensitive language. From the context sensitive closure properties Wikipedia, ...
3-PARTITION is strongly NP-complete, i.e. it remains NP-complete even if the input is given in unary. I'm searching two or three examples of (possibly well-known) non-numeric problems that have been proved to be NP-complete using a reduction from 3-PARTITION (and the reduction obviously relies on the strongly np-comple...
Since buying computation power is much affordable than in the past, are the knowledge of algorithms and being efficient getting less important? It's clear that you would want to avoid an infinite loop, so, not everything goes. But if you have better hardware, could you have somehow worse software?
It seems to me that taken over the entire graph, the norm of the error vector must be monotonically decreasing, otherwise we couldn't guarantee that PageRank would ever converge. However, is the same true on a per-vertex basis? I.e., from iteration t to iteration t+1, is the squared error of a vertex guaranteed to alwa...
My aim is to prove a VC-dimension $d$ for different problems. All the problems I have do not have a target function (or concept) explicitly stated. This unlike most of the examples I came through. For example in the interval problem, the target function $h^*$ is: if point $x\in [a,b]$ then $x=+$ and $-$ otherwise. I do...
For my homework assignment, I have to come up with a non-cfl that is pumpable. I came up with the following: $$ C = \{a^n b^n c^n d^m \mid n \ge 1 \text{ and } m \ge 1 \} $$ I'm not sure whether this works. For the pumping lemma, let $p$ being the pumping length. If I generate a string with $p$ $a$'s, $b$'s, and $c$'s...
From Tanebaum's Structed Computer Organization. Exercise 4 of Appendix B The following binary floating-point number consist of a sign bit, an excess $64$, radix $2$ exponent, and a $16$-bit fraction. Normalize $0$ $1000000$ $0001010100000001$ ($\star$). As far as I've studied, the number ($\star$) is already normal...
Is it possible to design a compiler that can safely compile and run untrusted code? As a practical example, I want to know how the online compilers are designed/programmed?(Like the one on codepad.org) Are they similar to our traditional day-to-day compiler. How they are hosted on servers?
I'm currently studying Decision Trees and the definition of a decision tree in our course is somewhat obscure for me. Nowhere in other online definitions of decision trees do I find something about relevant subtrees and relevant leafs... The course is based on the book Machine Learning from Tom Mitchell, so I'll have a...
I often see people assert that reference counting techniques such as shared_ptr in C++ provide prompt collection (e.g. here and here) but I am not sure what exactly is meant by this. Some people tell me that they mean "collects at the earliest possible point" but I think that is not true of scope-based reference counti...
I really need help with this task here. Im stuck at it and I really would appreciate your help Here is the task: Give a recursive function $r$ on $A$ that reverses a string. For instance, $r(logikk) = kkigol$ and $r(moro) = orom$. (given that $A$ the amount of letters in the Norwegian alphabet which has 29 letters.). ...
This is a question concerning Kripke automaton. My answers seem a little short and I was wondering if I was missing something? Transition table of a Kripke automaton: A -> red light is on B and D -> blue light is on C -> both light are on 1) Is the test 001blue satisfied by any state? Attempt: No 2) Is the test 001r...
Given a tree $T$ with $n$ vertices, we want to find the number of triplets of vertices $(a,b,c)$ such $d(a,b) = d(b,c) = d(c,a)$ where $d$ is the distance function (length of the shortest path between two nodes). It's pretty easy to do it in $O(n^3)$ time. Is it possible to do it faster? I think that on-line algorithm ...
In class, it was alluded to that a language: \begin{equation*} \{s_0 w s_1 : s_0s_1\in L_1, w\in L_2 \} \end{equation*} would be context free, if $L_1$ and $L_2$ are context free. Intuitively, that doesn't make sense to me. I tried doing my own research and attempted a proof using the pumping lemma, but didn't get anyw...
Drawing from Are algorithms (and efficiency in general) getting less important?, I get that algorithms are more important than ever, but I need to know anything about them other than their complexities? I would expect to use algorithms out of a library of some sort that has been written by people that are much much mor...
I was asked to "Compute the average runtime for a binary search, ordered array, and the key is in the array." I'm not quite sure how to approach this problem. Isn't the runtime of binary search O(log n)? And the average would be something like n + n/2 + n/4... etc? I'm then asked to "Implement a program performing an e...
Is it possible, given a declarative description of an architecture's register layout and instruction semantics and machine code encodings, to autogenerate a compiler back-end? If so, has anyone ever done this?
I have done an assignment question which asks me to find the average case of pentary search. The one I came up with is: C(n) = C(n/5) + 14/5 However, I got it wrong and the professor didn't really explain why. Can you help me? Thanks! Edit: Pentary search is dividing the array into 5 parts and look for a specific key....
When using A* (or any other best path finding algorithm), we say that the heuristic used should be admissible, that is, it should never overestimate the actual solution path's length (or moves). How does an admissible heuristic ensure an optimal solution? I am preferably looking for an intuitive explanation. If you wa...
In real word problems, the influence of multiple not perfectly known factors results in using heuristics instead of mathemacial solutions that calculates a perfect value from only precisly defined input data. Consequently, any method that does not supply the mathematical maximum or minimum is not an optimisation but an...
We define a regular tree language as in the book TATA: It is the set of trees accepted by a non-deterministic finite tree automaton (Chapter 1) or, equivalently, the set of trees generated by a regular tree grammar (Chapter 2). Both formalisms hold close resemblances to the well-known string analogues. Is there a regu...
I am preparing for my exam in Formal languages and Automata theory and I'm looking at some old exam questions right now. I need help with the following question: For each of the following languages answer whether it is regular, context-free but not regular, or not context-free. A brief, informal explanation is suffic...
I'm familiar with a dozen of programming languages which have exceptions in some way, yet I came to witness two "pathological" tendencies. There doesn't seem to be a common pattern or hierarchy of exceptions. Every language basically rolls its own version, and if the exceptions make it into the standard, then the kind...
How can I prove, or where can I find proof that for every regular language there is unambigous grammar?
I was given the following homework question: Implement an extendable table using arrays that can increase in size as elements are added. Perform an experimental analysis of each of the running times for performing a sequence of n add methods, assuming the array size is increased from N to the following possible ...
So, as is known, ILP's 0-1 decision problem is NP-complete. Showing it's in NP is easy, and the original reduction was from SAT; since then, many other NP-Complete problems have been shown to have ILP formulations (which function as reductions from those problems to ILP), because ILP is very usefully general. Reduction...
I am pursuing a BS in Computer Science, but I am at an early point of it, and I am pretty sure I will be happy with my choice given that it seems like an academically and career flexible education to pursue. Having said that, there seems to be a variety of definitions about what Computer Science really is in respects t...
Everybody says that Valuation is a truth value assignment to all variables in the formula. How do you call the valuation when some (neither single yet nor all) variables are assigned a value? Truth value implies that variables are binary. How do you call the multivalued case? I know that Haskel uses the term "partial...
At the time of writing, Wikipedia describes determinism as: "a deterministic algorithm is an algorithm which, given a particular input, will always produce the same output, with the underlying machine always passing through the same sequence of states" That aligns with my interpretation of determinism as a natural scie...
I'm referring to regular expressions as language: \begin{equation*} \Sigma = \{ ``a", ``b", ``(", ``)", ``*", ... \} \end{equation*} and \begin{equation*} L = \Sigma^* \text{, which form a legal regular expression} \end{equation*} I am not referring to their computational power. I did some research, but wasn't able t...
I've been struggling with this problem for days now, making no progress: There are N points on an XY plane. In one turn, you can select a set of collinear points on the plane and remove them. Your goal is to remove all the points in the least number of turns. Given the coordinates of the points, calculate two things: ...
I'm not very comfortable with pumping lemma for context-free grammar. I understand the sufficient conditions that must hold but proving it gets me everytime. For example, I need to prove whether $L = \{0^{n^3} \mid n\in\mathbb{N}\}$ is context-free or not. Based on my intuition, it won't be. There is no pattern of $0...
$$ L = \{a^ib^jc^k \mid i,j,k > 0 \text{ and } i+k>j\} $$ I say it's not regular. Proof by pumping lemma: Find a string $xy^iz$ that is not in $L$ (respecting the constraints). Let $w=x^py^pz^p$. Let $i=2$. $x^p(y^py^p)z^p$ is not in $L$. Thus $L$ is not regular. Is this proof correct?
The Whirlpool hash function generates a 128-digit hexadecimal number. Could that number ever be 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 or FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...
A family $H$ of hash functions $h: U \rightarrow \{0,\ldots,M-1\}$ is universal if $$\forall x,y \in U, x \neq y \Rightarrow \Pr_{h \in H}[h(x) = h(y)] \leq \frac{1}{M}$$ You can find more about universal hashing this wikipedia article. The concept of universal hashing is now a standard part of undergraduate data stru...
I'm confused about a solution I saw about the following language not being regular:\begin{equation*} L=\{0^n ~1 ~2^n : n >0\} \end{equation*} The example solution said that $L$ was "the same as":\begin{equation*} L'=\{0^n1^n : n > 0 \} \end{equation*} so it wasn't regular. I understand why $L'$ isn't regular, but I ...
In my Computer Systems (first year) module as part of my EE degree I'm studying virtual machines, memory management, hardware abstraction etc. I have come across the information that the OS creates and uses a few virtual machines to provide hardware and I/O abstraction. I assume that there are multiple VMs doing differ...
There are $n$ pairs of socks, all different. They all went out of the dryer, so there are now $2n$ socks scattered around. Given two socks, the only operation I can do is to decide whether they are identical (- belong to the same pair) or different (- belong to different pairs). What is the best way to sort the socks i...