instruction
stringlengths
35
29.1k
Is there a good algorithm to find connected components in undirected graphs with at the lowest possible costs given as the total weight of the edges being checked?
I'm not sure which StackExchange community is the correct place to ask this so I'm trying this one. I want to write a code that generates random brick wall type textures. Similarly to what, for example, this commercial software does: http://www.vizpark.com/shop/walls-and-tiles/ . So far I've thought at least three type...
Most of the operations in computers are using floating-point arithmetic, and why a Floating Point Unit alone is not sufficient? Can we do away with ALU? Is FP operations are resource-intensive alone be the reason for this, over the advantages provided by FP operations?
I believe that Ln(n) is <= 2^(sqrt(2*lg(n))), so I am trying to prove it I know that you can show Big O by showing Little O, so I am trying to take the limit as n approaches infinity of Ln(n)/2^(sqrt(2*lg(n))) However I am finding it hard to prove this using the limit definition I would appreciate any help to see how t...
Options given were: (a) 2 (b) 3 (c) 4 (d) 5 This question was a part of my assignment. I think the answer is 2 internal states - one start state and the other end state/acceptance state, but I am not sure whether it is correct or not. Please correct me if I am wrong. Thanks.
I am trying to learn haskell and could not configure it out, why following code snippet can not get compiled: *Uncurry> applyTwice f x = f f x <interactive>:14:20: error: • Occurs check: cannot construct the infinite type: t ~ t -> t2 -> t1 • In the first argument of ‘f’, namely ‘f’ In the expres...
I am trying to implement the wikipedia example of the Gauss-Newton algorithm. Although it does work as intended, when changing the starting values, it takes significantly more iterations to converge and does not always land on the same values. I am trying to understand how the example computes the initial starting valu...
I am trying to figure out how to solve the following problem: I have 2 sets of objects, set A and set B. I have a metric that calculates how closely a given object from set A corresponds to an object from set B. I'd like to maximize the overall correspondence of the entire set. What I tried first was a sort of greedy a...
Here is the game's setup: You're given a formula for a binary expression using and or not as the connectives. The connectives are combining many variables for which two players will assign truth values to them in the order specified beforehand. For Example: formula: ((x and y) or ((y and z) or (not y and not z)))...
Chromatic number denoted by $\chi(G)$ of graph $G$ is the minimum number of colours required to properly colour the given graph. For ODD Cycle chromatic number is 3 and it does not contain triangle as a subgraph. I thought about complete , star, wheel graphs etc, but they don't satisfy the conditions. I am looking fo...
Maybe these are silly question. I know almost nothing about computer science, so please let me know in the comment section if I should edit anything or delete it. Let's say I have a function that randomly selects 8 choices of 0 or 1. Would it be written as one byte together? For example, if all choices came out as 1, ...
In IDE's we can drag a small continuous collection of pixels in a particular configuration to a place on the screen .This collection of pixels are called as controls . Corresponding to every control, there are various kinds of event handlers,like for a button , some subroutines for events like "double click" , "single ...
I have 4 questions regarding relation between starvation and bounded waiting. 1.Does starvation-freedom imply deadlock-freedom? My Answer: From here, definition of starvation free is Freedom from Starvation -:Every thread that attempts to acquire the lock eventually succeeds Freedom from Deadlock -:for some thread ...
There is group of nodes. There are three type of nodes: leader node . follower node - connected to one or more leader directly or indirectly. vagrant node - no connected to any leader directly or indirectly. We can dynamically connect any node to any other node . link(node1, node2) unlink(node1, node2) After random lin...
I'm currently reading the book "P, NP, and NP-Completeness" by Oded Goldreich. I'm currently reading a chapter that's concerned with the "search version" of the P-vs-NP-problem, that is if finding solutions is harder than checking the validity of solutions. First, the book defines "polynomially bounded relations" as re...
Given an interval tree $T$ and an interval $I$, I need to find an algorithm that returns all intervals in $T$ that contain $I$. The asymptotic running time should be $O(\min(n,(k + 1) \log n))$ where $k$ is the number of intervals returned. The only solution I can think of is bruteforcing in $O(n)$ time, but that's cle...
I'm trying to construct a context free grammar for the language $\{a^ib^j:2i\neq3j+1\}$. I found that when $j$ is even, there are no problems. When $j$ is odd, there are some constraints on $i$. Now these are some examples of words that may NOT be parsed by the CFG: aab aaaaabbb (5 a's and 3 b's) aaaaaaaabbbbb (8 a's ...
I've just started learning binary so mind me if I'm bad at this. I think that the binary for 1 ought to be just "1" but, when I key it in to an app I downloaded, the answer has extra 0s and 11s in it. Why?
I'm trying to read Knuth's Notes on Open Addressing, and I don't quite follow the proof of Lemma 2. The set-up We're thinking about hashing $k - 1$ keys into a size $N$ array, with collision resolution via linear probing. In particular, we're considering sequences of hash values $a_1, ..., a_{k-1}$ ($1 \leq a_i \leq N...
Can you show me how to simulate Turing Machine with writing only on non-input fields on read-only Turing machine ? I tried to do it be using internal states, but it provides me to infinitely many states, what is not allowed. Any ideas ? Edit I consider standard Turing machines - one leftly-infinite tape. read-only Tu...
I have a binary tree with $n$ nodes. The tree is not necessarily balanced. For each node of the tree, I count down the total number of the nodes for its left sub-tree as $n_L$ and then I count down the total number of the nodes for its right sub-tree as $n_R$. Then I calculate $\min(n_L,n_R)$ and then assign the minim...
My application problem can be modeled as maximum k-parity k-set packing problem, which is NP-hard. I know that maximum matching is polynomial time, hence I want to reduce k-parity k-set packing into bipartite maximum matching. I am wondering if there is any relation between their size. Maximum k-parity k-set packing pr...
I've came across this expression regarding function composition in some notes by people from computer science, and I don't know what the notation "$::$" means. \begin{equation} g \circ f : A \rightarrow C :: a \mapsto g(f(a)) \end{equation} I get what this expression is trying to tell me, but I am pretty disturbed by t...
Wikipedia states A constraint satisfaction problem may be relationally consistent, have no empty domain or unsatisfiable constraint, and yet be unsatisfiable. There are however some cases in which this is not possible. The first case is that of strongly relational m-consistent problem when the domains contain at...
I just finished reading Walter Isaacson's Innovators and on page 350 there is a quote from Steve Wozniak recalling things he learned from the March 1975 Homebrew Computer Club meeting: A person at the meeting passed around the specification sheet for the new Intel microprocessor. "That night, I checked out the micropr...
I have an algorithm that goes something like this $$\begin{align} &\mathbf{ALGORITHM}\operatorname{BruteForceMedian}(A[0..n-1])\\ &\mbox{// Returns the median value in a given array $A$ of $n$ numbers. This is}\\ &\mbox{// the $k$th element, where $k=|n/2|$, if the array was sorted.}\\ &k\leftarrow|n/2|\\ &\mathbf{fo...
I try to express the following statements in first order logic: X is a subset of Y. A set can be uniquely characterised by its elements. The power set p(X) contains all subsets of X. A set X is the union of all its subsets containing just one element. Thus far I managed: $\forall x \in X \Rightarrow x \in Y$ $X=Y \...
For a system with two levels of cache, define: $T_{c_1}$ is the first-level cache access time $T_{c_2}$ is the second-level cache access time $T_m$ is the memory access time $H_1$ is the first-level cache hit ratio $H_2$ is the combined first/second level cache hit ratio Provide an equation for the average access t...
So I'm assuming everyone's familiar with the definition of Big-O: \begin{align} ∃c \in \mathbb{R^+}, \exists n_0 \in \mathbb{R^+}, \forall n \in N, n \geq n_0 ⇒ g(n) ≤ cf(n) \end{align} Here is a variation of this: $\text(Little-O)$: \begin{align} \text{Let $f, g : \mathbb{N} → \mathbb{R^{≥0}}$. We say that $g$ is...
I have a special kind of decision graph, where Multiple decisions must be made in combination, to accomplish the path. Not sure if Multiobjective or Combinational is the right term here, let me know if there is a better one. Picture better then words: We have: Joining Nodes (e.g. "Start") which joins decisions or cos...
I have an array of $n$ items which is partially sorted like below: $$A[i]\le{A[i+k]}$$ where: $$i=1,2,...,n-k$$ For sorting the array completely, I wonder what the runtime big O is. I feel only an array of size $k$ needs to be sorted. Because if the sub-array $A[1\le{i}\le{k}]$ is sorted, then all the subsequent sub-...
I am not sure that my question is clear from the first sight. But I will try to explain what I mean. For now, I am learning balancing the trees on the example of AVL trees. We know that to balance tree wnen new node is added, we turn the tree either to left or right, e.g if new node in left child's left subtree (left-l...
I know pumping lemma and also know how to prove if languages are not regular or are regular using proof by contradiction methodology. But I am stuck on this one.Especially, I don't know exact string it produces. $$ H = \{www \mid w ∊ (0,1)^* \} $$ How do I prove this is not regular language? Thanks!
Assume that $L$ is decidable. Is the following language decidable? $$ L' = \{w | \text{ there is } u \in L \text{ such that u and w are equal to at most two positions.}\}$$ For example, let $u=abcd$. The following words are equal to $u$ at most two positions: $\{aba, agg, ab, zzz, dsa, ...\}$, but not $\{ abc, zbcd \}$...
I am new to computer science, so excuse me if the question is inappropriate or sounds absurd to you. In the textbook, it says that a typical laptop can execute 1 billion instructions per second. Therefore, I thought that if I wrote a never-ending piece of algorithm, it would generate tons lines in the program counsel a...
I'm struggling to understand the absorption law proof and I hope maybe you could help me out. The absorption law states that: $X + XY = X$ Which is equivalent to $(X \cdot 1) + (XY) = X$ No problem yet, it's this next step that stumps me. How can I apply the distributive law when there are two "brackets"? How can I man...
I'm attempting to prove a problem is NPc, but I'm not sure which one would be optimal to use, The problem is: There are $n$ boars to be caged, and $m$ cages which each cage being able to hold $k$ boars. Any boar can be put in in any cage, but certain pairs of boars can't be put together in the same cage. I'm thinking ...
I am practicing questions in which I need to determine the big oh time complexity for a given piece of code. I have attempted the first 3 questions. Could anyone please confirm if the answers are correct? Also, I am not sure how to calculat the big oh time complexity of the code in the 4th question. Could someone plea...
I found this question from CSLR that I'm trying to figure out before my final. You are given a weighted, connected, undirected graph G = (V, E) and one of its minimum spanning trees T ⊆ E. Now consider the following two scenarios where we modify the graph and want to get an updated MST efficiently. (a) A new edg...
Taken from CLRS third edition, a procedure is given for Build-Max-Heap function a = build_MaxHeap(a) for i = floor(length(a)/2): -1 : 1 // i = n downto 1 a = max_heapify(a,i); end My question is why use floor(length(a)/2)? How is it different than using length(a)? Is this the same thing? function a = build...
From Tardos and Kleinberg's Algorithm Design, the definition for "worse valid partner" is basically — $m$ is $w$'s worse valid partner if $m$ is a valid partner of $w$, and no man whom $w$ ranks lower than $m$ is a valid partner of hers. (page 11 in case anyone has the pdf/book) Is this a typo? Shouldn't it be "no man...
I am working with an iterative application in a distributed setup. The application has n processes (P1, P2,...Pn) and m iterations. Each process may or may not perform any computation in a given iteration. Initially, each process (and its associated data) is assigned to a separate Virtual Machines (i.e. the first itera...
It is known that $\mathrm{SPACE}(o(\log \log n)) = \mathrm{SPACE}(O(1))$ (see e.g. these lecture notes by Christian Scheideler). One inclusion is trivial, so I'm trying to show that $\mathrm{SPACE}(o(\log \log n)) \subseteq \mathrm{SPACE}(O(1))$ as follows. Let $L$ be a language and $A$ is a Turing machine with alphabe...
"It is a well known result that every PDA with acceptance condition of an empty stack and reachability of a final state can be transformed to an equivalent PDA with acceptance condition requiring only reachability of a final state. Transform PDA ____ to an equivalent PDA with acceptance requiring only reachability of a...
I have a little doubt with respect to the two-opt improvement heuristic for TSP. I understand how it works, from the Wikipedia article on 2-opt and "Heuristics for the Traveling Salesman Problem". However, from my understanding and subsequent experiments, it appears this heuristic does not give any guarantee to at leas...
Im trying to find a regular expression to generate the language that has words with length at most 5, over $\Sigma =\{0,1\}$ How can i represent the at most ? I know i can do it if ill just write all the $2^5$ possibilties with 'or' between them. But it seem to me not the right way. Is it even possible to represent the...
The problem is NP-complete (proven) for all input data (without exception). We assume that P != NP. Is it possible that there is an (infinitely large) subset of the problem, for which this subset is in P? Theoretical question.
Lets say I have a set of destinations and another corresponding set of origins. I need to link each destination with one origin.A set of vehicles start from each origin towards their respective destination.The speed of every vehicle is provided. In the network no two vehicles moving in opposite directions are allowed t...
When modeling a scenario with Petri nets how should I determine the places, transitions and tokens? Example: There are two exam assistants in an exam hall observing the exam. They stand in front of the exam hall. When a student has a question one of the assistants goes to him and answers his question while the other s...
I have a question regarding buchi automatons. The automata for the LTL formula, G(Xa->b) is as the attached picture. Why dosen't a have to be true in order to make the automaton correct? My suggestion Best regards
I want a shift operator for an architecture that implements boxing. Basically, the high-level constructs represent integers as 31 bits followed by 1 bit set to one as a tag (so to represent binary int i I use instead 2i+1). Let's denote the box representation as $[[\cdot]]$, then I was able to make the following deduct...
Could anybody help me design a PDA for the language $\{ 0^n 1^m | n ≠ m \}$? Here is what I currently have:
According to the Wikipedia page on the Stable Marriage Problem, the problem is presented in a way in which the number of men and women are both the same. Given n men and n women, where each person has ranked all members of the opposite sex in order of preference, marry the men and women together such that there are n...
Is it possible to transform RSA to SAT during polynomial time? (Polynomial number of variables and clauses of logical formula and polynomial time of creating logical formula). The size of the task is obviously the number of bits $n$.
Why is average case analysis considered more difficult than both best and worst case analysis? Specifically, how do you approach and complete best and worst case analysis as opposed to average case? Thanks!
Assume a function $T(n)$: $$T(n)=\log{\log^{*}{n}}$$ Let's define: $$\log^{*}{n}=\min\{i\ge{0}:\log^{(i)}{n}\le1\}$$ and: $$\log^{(i)}{n}=\log{(\log^{(i-1)}{n})}$$ Is the following $f(n)$ function an upper bound or a lower bound of $T(n)$? $$f(n)=\log^{*}{\log{n}}$$ To see if $f(n)$ could possibly be an upper bound, I...
I've been trying to create my own random number library(in java). I've searched for randomization and Blum Blum Shub algorithm looks good. It needs a start value, it is not actually random. So i get unix timestamp mod(10) for first value. Now i can generate random numbers. My question is; how can i modify my structure ...
I have encountered a problem in class, tried solving it and faced a problem, I will include my ideas, and the problems i faced. Assume F is a PRF, 1.denote $P_k(x) = F_k(x) ⊕ F_k(1^n)$ for any $n ∈ N, k ∈ \{0,1\}^n$ and $x ∈ \{0,1\}^n$. Is P necessarily a pseudorandom function? 2.denote $P_k(x) = F_k(x) ⊕ 1^n$ for any...
Do there exist a set of inductive rules and a fixed point of these rules but is neither the least nor the greatest fixed points?
A set of n points and m line segments is given. We are given two disks of radius r. We need to place the disks in such a manner so that maximum number of points are covered. A disk covers a point only if its center and the point can be directly connected, i.e, the line joining the center of the disk and a point should ...
My problem looks like a secret sharing problem. That’s to say: We have N people. Each of those owns a word to share to other people. The aim is that all people know all the words of other participants. People can only discuss in houses. There are H houses. Each of those may only accept a limit of L members. In a house,...
Does a PDA only move states when both the input symbol matches and the symbol on the top of the stack matches? In other words, is it possible to have two different transitions that both take the same input character but pop different stack symbols? For example if we have a state Q0 with the two following transitions: a...
How exactly do you track the exact amount of iterations? I know its probably basic but can't figure out how so was hoping someone could explain to a complete beginner how you arrive at an answer. def f(n): i = 4 while i < n: print(i) i = i + 1 ( The answer should be max(n−4,0) )
Let a directed graph $G = (V, E)$ be given, plus a constraint map $c: E \rightarrow V$ and a set $T \subseteq V$ of initial token locations. A valid move consists of sliding a token from $v$ to $w$ if: $v \in T$ — to slide a token, it must be there. $w \not \in T$ — to move a token somewhere, the new place must be em...
I have a project where I should write the following algorithm : Let an integer function $f\colon\{1,2,3,\ldots,n\} \to \mathbb{Z}$ be monotone and suppose that $f(1) > 0$ and $f(n) < 0$. We would like to find the smallest integer $i$ with $f(i) < 0$. Design an algorithm for this purpose that run in time $O(\log n)4. ...
How exaclty do you determine this specific codes runtime is theta(n^2)??I can see theres two while loops which go from i and j to n but would like a more precise way of determing this? If someone could explain is simple terms as I am very new to this I would appreciate it. def f(n): i = 0 while i < n: j = 0 ...
When I read introductory textbooks I get contradictory answers. In some cases efficiency and complexity are treated the same and the big-O notation is used to indicate that (for example) for an O(n) algorithm the time to execute is linearly proportional to the input dataset size. From other sources I have read that eff...
Prove that PTIME has no complete problems with respect to linear-time reductions. I know that PTIME means all these problems that we can solve them in polynomial time. I suppose that I should use here time hierarchy theorem - I know it. However, I have no idea how to solve it. I am beginner at this subject so I as...
I am looking for a sorting algorithm to help me in my work. My objective is the following: after receiving an input of this kind: 5 4 1 2 2 3 3 4 4 5 The first line tells me how many ids I have, and the second number tells me how many connections. The following lines tell me the connections, and tell me that the first...
Since I don't have CS background I will most probably ask this question the wrong way. I need to choose a node from a tree, where I include all beneath this node leafs in a validation. I have a data set from a big web directory that categorized websites. I already wrangled the data around so the root of every category ...
Imagine a Fibonacci heap with 1 tree: a root node, 4 child nodes (to that root node), with 2 of them being leaves and the other 2 having 1 child each (7 nodes total). Is this a legal Fibonacci heap? In other words, does there exist a series of actions that lead to this sort of heap structure. My intuition tells me no...
What algorithms/heuristics exist for efficiently determining the relative order between two elements in a partially ordered set? In my case, the PO-set is stored as a directed acyclic graph where an edge is an happened before relation and I am streaming live data into this PO-set. Nodes usually have less than 5 backwa...
For the problem described in Ex. 15.9 about breaking a string a) Prove optimal substructure b) Write the recursive definition for defining the least cost solution c) Write the algorithm (either the memo-ized version or bottom-up version) If you could help me get started on any of the above three questions (or all thre...
Bin packing: Given a set of $k$ items where item $j$ has size $s_j$ and a set of bins of capacity $C$ each. Use the minimum number of bins to pack all items while respecting the capacity of the used bins. If I select one bin arbitrarily and put in it the maximum possible number of items and repeat this until no item is...
In un-directed graph it is easy to find cut vertex and bridge but in directed graph removing cut vertex/bridge must increase number of strongly connected componenets.
We know that if a $\#P$-complete problem has a deterministic reduction to $FNP$ version of an $NP$-complete problem then polynomial hierarchy collapsed to first level. Is there a consequence if we had a randomized reduction? By a randomized reduction here I mean a reduction that works for permanent of $\frac1{n^c}$ for...
Treewidth : 1) By chordal graphs : size of the largest clique $(\omega (G))$ - 1 in a chordal completion of the graph $G$. 2) By tree decomposition : A tree decomposition of $G = (V , E)$ consists of a tree $T$ (on a different node set from $G$), and a subset $V_t ⊆ V$ associated with each node $t$ of $T$. (We will c...
I have read TONS of articles about context free grammars and Pushdown Automata but I think there are things that I dont seem to understand. I am not studying computer science but I am really interested in many of the topics and I hope you can help me realign my knowledge about the CFG and PDA. So my question is: could ...
I am stuck on a problem in which I have to print sum of 2Pi mod 1000000007 for all i where Pi is sum of numbers in ith subset of a set X. Length of set can be upto 100000. Value of element in the range [0,1012]. Here's the link of the Problem. Problem Statement I could not find any approach other than Brute-Force whic...
I want to write an algorithm that takes an $n \times n$ grid and a number $L$, generate a random walk of length $L$ on the grid that doesn't visit the same cell twice. One simple solution would be keep randomly choosing a neighbour of the last cell to add to the path. I found that for small density (i.e. $L < 0.625n^2$...
I cannot solve this exercise: "If a processor has a cache hit rate of 99.5% and a cache miss penalty of 160 core processor cycles, what will the average CPI be for 1,000 instructions?" how can i do this?
I have $x$ uniform machines that are identical, except that each runs at a different speed; machine $j$ runs at speed $s_j$. I have $n$ identical jobs. Each machine can handle one job at a time. The time to complete a job on machine $j$ will be $1/s_j$ seconds. I want to prove that the optimal schedule that minimize...
The original question was "Do all non-regular languages have an uncountable number of strings?". How can someone prove that..? I am squeezing my head but I can't figure it out. And the other side of the coin: is a language always regular, if it has a countably infinite number of strings? A bit more generally: is rep...
How to show that PSPACE and PTIME are closed under Kleene star ? I can only show that NP is closed, but it is easy because we can use non-determinism to guess partition of word. In these two cases I don't have idea how to attack it.
I am new in the ML. I know that overfitting is memorizing the data while training. Like in Neural Network, if we make lots of layers and lots of hidden nodes, we can memorize all the data, but it can be bad because train data would not cover the whole space. Like this, is there any way to overfit in SVM and Logistic Re...
I want to know how the first programs to be able to execute more than one programs within a common time span were like . I went through the history of the topic and it seemed like Strachey was the first one to work on multi-programming . Hence , i thought of reading his paper "Time sharing in large and fast computers" ...
In the context of computability and turing machines Let $L_1$ be an undecidable language and $L_2 = \{n \in \mathbb{N} | \exists x \in L_1 |x| \geq n\}$ How can I prove if $L_2$ is decidable or not? I guess $L_2$ is not decidable in general and it depends on $L_1$ but still nothing proved. \
In my opinion it is uncountable since we can think every natural number as a member of one alphabet like $\quad0\in\sum_0 ,1\in \sum_1, ... \quad$ And there are also other symbols than natural numbers in alphabets. So there is no possible 1:1 and onto mapping from set of all alphabets to natural numbers. Thus they cann...
I'm trying to to create an algorithm (working in polynomial time) to solve the following problem: What maximum number of knights that any two of them don't attack each other can be placed on a 3✕n chessboard with holes (knight can't be placed on a hole). Width of the chessboard (n) and positions of holes are given. Bes...
We have defined two complexity classes which have a close relation with the notion of infinity. The first one is: We say that a language $L$ belongs to $UP_{\infty}$ if there exist an infinite sequence of languages $L_{1}, L_{2}, L_{3} \ldots$ where for each $i \in \mathbb{N}$ every language $L_{i}$ is in $UP$, has an ...
In Introduction to Formal Languages by György E. Révész a polynomial time algorithm that can convert a left linear grammar to a right linear one is presented. Trying to understand when it is useful I read that left linear grammars are generally harder to parse than right linear grammars. Is this statement true? I'm a...
I'm trying to use the concept of DFS traversal to go through a cycle, and attempt to get a balance of 0 in the end. Each student either owes or is owed some money, so I'm trying to go through all of said students and make sure each one can pay the other. The input for your algorithm consists of two lists $owing$ and ...
I am implementing the dynamic programming algorithm for computing tree alignment distance as described in "Alignment of trees — an alternative to tree edit". But I got stuck in lemma 3 on page 141 (page 5 of pdf). The notations are given at the beginning of section 2. The last case in lemma 3 says However, there is no...
I've been straggling a little proving the argument "a hamiltonian directed acyclic graph has a single topological sort". This is pretty much the idea of what I've come along: lets prove by contradiction. so lets assume a hamiltonian DAG has at least 2 topological sorts. If there're few topological sorts - it means one...
Recall the fold function for lists: $fold(f,z,[x,xs]) = fold(f,f(z,x),xs)$ $fold(f,z,[]) = z$ I want to formally proof that if $f$ is associative, commutative and idempotent (meaning $f(x,y) = f(x,f(x,y))$ and we have to lists $l_1$ and $l_2$ such that their contents are equal then $fold(f,z,l_1) = fold(f,z,l_2)$. Wha...
I am building a parser generator, not for any project in particular, just for fun to improve my understanding of parsing, grammars, languages, etc. I am at the point where I have lexer generation down pat. That is, I have defined a way to specify token definitions from regexes and split an input string into tokens base...
Given a large collection $\mathcal{X} = \{X_1, X_2, \dots, X_n\}$, where each $X_i$ is a set of integers, what's a fast algorithm to identify all pairs $(i,j)$ with $i \ne j$ such that $X_i \subseteq X_j$? The best I can think of is the following (rather naive) algorithm: Sort each set $X_i$. Sort $\mathcal{X}$ by car...
Let's say I have three functions and each gives true/false answers. The first one gives 2 booleans, the second 6 and third 4. Are they written like this: 01 110010 1000? Do they get spaces between the functions? If so, do the spaces count as data? What I wanna know is, if you send an encryption key using RSA, how does ...
Now, I have the following conjecture. $\text{MOD}_{2017}(x_1, \ldots, x_k)$ is computable by a bounded depth polynomial size circuit in the basis $\{\neg, \text{MAJ}\}$. However, I am at a loss at how to realize/see this. Could anybody help me out?
Consider a self-stabilized distributed system based on shared memory and the processor $p_{i}$ be connected to the processor $p_{j}$. Suppose we are going to solve a problem like finding a maximal independent set or minimal dominating set and we need to break symmetry. For breaking symmetry, we use id of processors. My...