instruction
stringlengths
35
29.1k
Steps to build Huffman Tree Input is array of unique characters along with their frequency of occurrences and output is Huffman Tree. Create a leaf node for each unique character and build a min heap of all leaf nodes (Min Heap is used as a priority queue. The value of frequency field is used to compare two nodes in m...
I am working on a property of a given set of natural numbers and it seems difficult to compute. There is a function 'fun' which takes two inputs, one is the cardinal value and another is the set. If the set is empty then fun should return 0 because fun depends on the product of the set and fun on all subsets of the com...
I would like to find an immutable/persistent data structure that allows efficient updating for 2d (or higher) lattices/arrays/matrices, and reasonable performance when appending in any direction. Updates would be typically be localized to certain areas. I could probably make do with mapping a 1d vector onto 2 dimensio...
Let S be a string in the set (0,1) produced by taking the AND of the output of two maximal length linear feedback shift registers of large period (say 128 bits). It's easy to see from the truth table of the AND gate that you will end up with a string consisting of (approximately) 75% zeroes and 25% ones with the ones b...
I know that Physically based rendering means we try to simulate how light actually works in real world and global illumination is bouncing back of light when it strikes a surface. But what's actual difference between them and how are they related?
As a part of my Bachelor thesis in computer science I should review the proof of the Schützenberger Theorem (which was given by M.P. Schützenberger himself $^{[1]}$). My question arises on page 193 in line 11, namely in the equation: $$" \gamma ( f x ) M ( = mM = mM \cdot M)"$$ But I will break this down in my own word...
Let $W = \{a^n b^m \mid n\ge m+5,m\le 5\}$, where $\Sigma=\{a, b\}$. I have proved that this language is irregular through pumping Lemma. But through regular expression it is proving that the language is regular. Can anyone please tell me that what should I consider it as. And does that happens?
We know the bellman-ford algorithms check all edges in each step, and for each edge if, d(v)>d(u)+w(u,v) then d(v) being updated such that w(u,v) is the weight of edge (u, v) and d(u) is the length of best finding path for vertex u. if in one step we have no update for vertexes, the algorithms terminate. with supposi...
With SVM, adaboost or similar alogrithms, image training sets must be cropped with specific constraints (keep image cropping ratio the same, have object tightly cropped, same resolution) In general, does a training set for a neural network based classifier need to be generated under the same constraints? If not, which ...
Sorry if my question is banal. Consider an approximation scheme such as FPTAS that guarantees to find a soln>(1-eps)OPT for maximization. Now consider if OPT=exp(|input|) so It easily can be seen that soln is exp(|input|) So its run-time will be exponential too(just a print of result is exponential). So can we say the ...
A fellow student and I are writing a paper on functional programming for a programming languages course, part of which will be comparing and contrasting Lisp (Scheme), ML (SML), and Haskell. We'll be coding the same algorithm in each language and we're at a bit of a loss for exactly what to code. We would be grateful f...
I am working on an approximate matching problem, where I have a set of paths in an unknown graph (A) and a partial graph (B), where B is generated incrementally during the matching process (and can be potentially infinite). The problem is to match the maximum number of edges in the paths to the smallest graph B. The m...
Given a gate called Nand with the following truth table: A | B | A Nand B ------------------ 0 | 0 | 1 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0 We can define a circuit satisfiability problem where only Nand gates are allowed: $\mathrm{Nand\text{-}Sat}$: Input: A Boolean circuit $C$ with $m$ inputs $(P_{1},P_{2}...
I'm working on exercise 4.29 of Nielsen and Chuang: Find a circuit containing O(n^2) Toffoli, CNOT, and single qubit gates which implements a $C^n(X)$ gate (for n >3), using no work qubits. As part of solving this exercise, I'm trying to figure out if the task of making a NOT-controlled-by-N-bits is possible classica...
Is there a way to have a secure by design client-server communication in a sense that the server can check if the client is not a modified version? What I'd like to do is give the user access to both the client's and the server's source code, but keep him from communicating with a modified version. As a practical examp...
I'm seeing this pattern that the response time increases as throughput increases, and that the throughput has a peak after the response time starts rising. This seems counter-intuitive. It seems like as the response time starts to rise, the throughput should flatten out due to queuing or simply exhaustion of resources....
I am trying to understand the proof of the Karp-Lipton theorem as stated in the book "Computational Complexity: A modern approach" (2009). In particular, this book states the following: Karp-Lipton theorem If NP $\subseteq$ $P_{\backslash poly}$, then PH $= \Sigma^p_2$. Proof: By Theorem 5.4, to show PH $= \Sigma^p_2$...
TL;DR: How do I justify mathematically that vertices with the highest betweenness centrality do not necessarily have the smallest mean shortest path? I am currently studying the London Underground as a hobby. Recently, I have been calculating some graph metrics for different vertices (ie. Tube stations) in the London U...
From a blog post, about proving that NP total search problems cannot be NP-complete unless NP=co-NP. It's possible to write a convincing proof sketch as follows. Consider what would it would mean if an NP total search problem (like FACTORING) was NP-complete. There should then be a poly-time reduction from (say) SAT t...
In the paper "Computing Equilibria:A Computational Complexity Perspective" by Tim Roughgarden, they consider the problem: Problem 2.1 (Clique). Given a graph $G = (V, E)$ and an integer $k$: if there is a set $K ⊆ V$ with $|K| = k$ and with $(i, j) ∈ E$ for every distinct $i, j ∈ K$, then output such a set; otherwise...
I have this pseudocode function mysterious(N): count = 0 for i = 0 to N: if (i mod 3 == 0): count = count + i return count The problem ask for the expression that returns this function using N or in terms of N The best I have done is $\sum\limits_{i=0}^n i \bmod 3$ Is there any better w...
I was looking at Support Vector machines (SVM) kernels. Looking at Polynomial Kernel and Kernel Perceptron I was curious how they differ? Work Done Polynomial Kernel: $d_{k+1}(x)=d_{k}(\bar{x})+\rho k(\bar{x}_{k}, \bar{x})\; \mbox{if}\; \bar{x}_k\epsilon\,C_1$ $d_{k+1}(x)=d_{k}(\bar{x})-\rho k(\bar{x}_{k}, \bar{x})\; ...
You have two friends, call them A and B. They each are given two wine bottles: one bottle holds k_1 litres and the other k_2 litres. Both A and B can perform these operations: - completely fill a wine bottle with wine - completely empty a wine bottle - pour the wine of one bottle into the other bottle, making sure to ...
Construct an infinite sequence of regular languages $L_1, L_2 , \ldots$, over the same fixed finite alphabet, such that for every $i ≥ 1$, $L_i ⊇ L_{i+1}$ and $|L_i \setminus L_{i+1} | = ∞$.
Let suppose a simple (FIFO) queue, where elements enter at a side and exit at the other side. I know the classical use of queues in everyday life and computer networking. I would like to know more specific uses, for instance in distributed applications. Are there client-server applications where we need to investigate...
I have a directed acyclic graph with positive edge weights. It is constantly changing in that nodes are deleted and added. For each change, I need to find the $k$ shortest paths. My current approach is that I plan to run Eppstein's algorithm for each change, but I'd like to be able to reuse some of the calculations I'v...
Considering the case that we have a fixed set of training examples and a fixed ANN (i.e same number of input,output and intermediate layers). Is it possible that there exists more than one set of weights that all produce same desired results when applied to test examples. Basically can different weight matrix lead to s...
I am going to teach a course in set theory for software engineering students. I am going to talk in this course about: ordinal numbers, partial orders, well ordering, generic filters and maybe some cardinal invariants (such as $\mathfrak b$, $\mathfrak d$). I might also give a gentel introduction to forcing theory. I ...
I'm developing a simple AI to play a boardgame which consists of N x N squares, each with a predefined value. 44 33 75 12 99 23 53 89 14 01 32 98 34 98 67 45 02 38 89 87 54 21 34 87 65 84 99 72 95 17 Each player can either (a) instant claim an unclaimed cell anywhere on the board, or (b) rush an unclaimed cell from a ...
I seem to recall from an undergraduate class that for a Turing Machine with a finite tape there will always exist a corresponding Finite State Automata, but I've been unable to find this confirmed anywhere on the internet. Is this actually the case or am I misremembering?
This question is all about terminology (names). When you consider "list", this term is well defined in CS -- despite the fact programming languages use and misuse this term (for example C# List is not a list). I am looking for term in Computer Science domain that C++ defines as pointer to a function, C# as delegate, Sw...
An interview question I was asked. I was first asked how to traverse a graph and next I was asked how to search one. Got the first one but not the second. What is the modern standard way to search a graph (assume undirected) given no other context? I've a notion that it might have something to do with Dijkstra's algo...
I have an undirected graph represented by a list of nodes and a list of edges. What I need to produce from this is a list of nodes and edges representing a new graph containing only the nodes which have degree of at least 4. I think I've developed an algorithm. It uses an object called Node, which can store an integer ...
I'm interested in 3SAT and querying an oracle. Suppose we had an oracle that can decide, on an input boolean formula $\phi$, whether there exists any assignment to the variables that makes the formula true. Note: this does not say what the assignment to the variables is, just that there exists one. My main question is:...
I would like to create an algorithm which takes in an integer n and returns an array whose entries give all n-tuples of nonnegative integers each of which is at most n, so like A[n][0] = [0,0,0,...,0], A[n][1] = [1,0,0,...,0], ..., A[n][n^(n+1)]=[n,n,n,...,n], that kind of thing. If n is small, I can manually cr...
Exercise 4.29 from Quantum Computation and Quantum Information by Nielsen and Chuang has me stumped. Find a circuit containing $O(n^2)$ Toffoli, CNOT and single qubit gates which implements a $C^n(X)$ gate (for $n > 3$), using no work qubits. I've figured out that this can't be done classically. I've figured out how ...
Polygon Cover: Input: A set of points $P$, a set of polygons $S$ in a 2D plane, and a positive integer $k \in \mathbb{N}$. Output: True if and only if there exists a subset in $S$ of at most $k$ (not necessarily convex) polygons such that every point in $P$ lie inside some polygon in the subset. I am trying to give a ...
The Robbins/Monro Algorithm is a type of stochastic optimization algorithm of the following form: (as mentioned in wikipedia) $$x_{n+1} - x_n = a_n(\alpha - N(x_n))$$ where $M(x) = \alpha$ is a nondecreasing function whose root is at $x=\theta$, $N$ is a random variable where $E(N) = M(x)$. (E is the expectation). Furt...
I'm a little stuck trying to figure out how to decrypt some messages and could use some hints as to what I may be doing wrong. I was given a series of integer values that make up my cipher text. Here are just a few of them: 6584 15650 16198 11003 I was given the following public key b = 3001 n = 18209 So to encrypt a m...
PSPACE-complete$_{FP}$ problems are the PSPACE problems such that every other PSPACE problem can be transformed to it with a polynomial time reduction, i.e. the reduction is an algorithm $\in$ FP. This class is known as PSPACE-complete. Similarly, we can define : PSPACE-complete$_{FPSPACE}$ problems, the PSPACE proble...
I would like to create a deterministic finite state automaton (DFA) M=(Q, Σ, δ, q0, F) that is accepting the language generated by the following regular grammar (RG) G=(N, Σ, P, S). In short I want to convert RG to DFA. G = ({S,A,B},{a,b},P,S) P = { S -> aA | bB, A -> aS | a, B -> bS | b } I have found these rules th...
I got stuck with this problem since the whole day. When we are finding the longest path in a graph we first do topological sorting and then check the path of adjacent vertices and keep upgrading selecting the maximum of the edge weight or the alternate path from the other vertex. So, we are able to solve this problem ...
I have a number of questions about Paxos which I can't answer in full confidence from reading the paper (Paxos Made Simple). My questions are loosely based around the following quote: In Paxos, a value is chosen when a single proposal with that value has been accepted by a majority of the acceptors. However, we can al...
I notice occasionally in blogs or articles comparing different languages, algorithms, etc. that the author will divulge info about the processor used in the testing. Is this meaningful? Shouldn't the relative performance differences be hardware-agnostic? That is, if Language A executes in twice the time as Language B,...
I am learning about Greedy Algorithms and we did an example on Huffman codes. To prove the correctness of our algorithm, we had to have the greedy choice property and the optimal substructure property. Here is what my professor said about the optimal substructure property: Let C be an alphabet and x and y characters wi...
Given a Tree (without a root) function w : v -> N and a number C - How can we count the number of verticies with distance between them equal to C. I was thinking about some smart vertice numbering so we could use dynamic programing to do it but after some thinking it is no good. I would be really thankful for any tips....
Given a set $P$ of $k$ points in a plane. The Distance Variant problem: partition set $P$ into two subsets $P_{1}, P_{2}$ so you can maximize, $d(P_{1}, P_{2})$ = min $p \in P_{1}$ min $ q \in P_{2}$ $d(p,q)$, where $d(p,q)$ is the Euclidean distance between $p$ and $q$. So basically, $d(P_{1}, P_{2})$ is the smallest...
Some particularly degenerate CFGs can produce a single string in infinitely many ways: for a dumb example, $S \to SS \mid \epsilon$ can produce the empty string as $S \to \epsilon$ or $S \to SS \to S \to \epsilon$, etc. I'm writing a general CFG parser which can produce all the different parses for a given string, but ...
I'm designing software that produces images such as the following: Regions of interest are circumscribed by red pixels. I am interested in extracting the fully-enclosed pixel regions. Ultimately, I would like to calculate the approximate center, width, and height of the regions. Ideally, I would even like to eliminate...
An index set is a set of all indices of some family of computably enumerable sets. It is known that the empty set is an index set and that $K = \{e \mid e \in W_e\}$ is not an index set. The following was an exam question I didn't manage to answer: Which of the following sets are index sets? 1) $\emptyset $ 2) $K= ...
What is complexity theoretic implication of following possibilities - $NP=coNP=BPP=RP$ or $coNP\neq NP=BPP=RP$ (consensus is these seem impossible)?
I moved my question from Theoretical Computer Science to this site - proposed by one of the users there - and I'm hoping don't be off-topic again. At my university, I had chosen to write a term paper about Inventory Routing Problem (IRP). To get comfortable with this topic (I'm a software engineer), I started with some...
The definition of fingerprinting algorithms in Wikipedia describe a property called compounding as you can see here as: Some fingerprinting algorithms allow the fingerprint of a composite file to be computed from the fingerprints of its constituent parts. I suspect compounding is not a commonly used term for describi...
I have the following problem: Let's say I'm in a city with some friend we have a bunch of tasks to do. All persons start on a different position, for example (0/0), (10/5), (-20/0), ... , and every person can move x coordinates per second. Every task has: A coordinate where it can be completed (for example (40/50)) A ...
I am currently in a class that deals with DFA's and their minimization. However I believe I have reached a DFA where the method of minimization we were taught doesn't work. I have the following DFA (in JFLAP) Using the method given in class I do the following see if their are any non dissimilar states and if so collap...
Syntax and semantics section of this paper on probabilistic programming mentions that the return expression of the program is a function f satisfying $ f : \sum \rightarrow \mathbb{R}^{\inf}_{\geqslant0}$ where $\sum$ is the set of states. I do no not see the need of $\geqslant0$. Why can't the return values be negati...
I came across the term "minimum height of a Binary Search Tree" (in Java) in class, but I don't fully understand. Could someone please elaborate on: (a) What it is ? (b) How to determine/find it ?
My problem is very similar to the one posted here. Instead of finding one set covering the maximum of subsets, I need to find the minimal number of sets to cover all subsets. I have $U = \{1, 2, ..., 1000\}$ and $S \subseteq \{A \subset U |\space|A| \leq 15\} $. I know that $|S| < 1000$. I need to find a minimal number...
Written in English, does "the set S contains only members of set T" imply that S does contain some member of set T? How would this relationship be written formally?
Why were primes which are $1$ modulo $4$ considered to be weak for use in RSA cryptography (http://en.wikipedia.org/wiki/Blum_integer)? Was there a time it was considered there could be an efficient algorithm if these primes be utilized (if so, then what exact reasons were these)?
What is the difference between: normalizing the row of an adjacency matrix and taking the right eigenvector normalizing the row of an adjacency matrix and taking the left eigenvector normalizing the columns of an adjacency matrix and taking the right eigenvector normalizing the columns of an adjacency matrix and takin...
I'm going through Dr Joost-Pieter Katoen's slides and stumbled upon this: For some reason I can't quite make out how the transition system relates to the sequential circuit. If I had a question for instance that asked me to convert the circuit into a TS, what steps should I take to approach it (using this one as an ex...
I've been studying about CPU and I am trying to implement a small CPU, like MU0. Control unit gets instruction and generates and gives several control signals to other parts of CPU, such as ALU, PC, ACC, etc. And I know that these works in one clock cycle. But I have some quetions. Meaning of Signals (0 or 1) in Clock...
I am looking for an algorithms to maintain several statistics over a sliding window. The setup is as follows: There is a datastream consisting of (real value,timestamp) tuples. The values for the last x seconds are stored. In each iteration at least one new tuple arrives and between zero and more values are retired. No...
Since a partial function can be seen as a set of tuples, there is a trivial CPO defined by the subset relation on partial functions of the same (co-)domain. However, this is not really useful. What I'd need is a CPO over partial functions allowing for different outputs. I.e. two functions are ordered $f < g$ when, for ...
A popular mobile game, DiscoZoo, is about "rescuing" animals from a 5x5 grid of cells. Each animal represents a unique pattern (some have 3 cells, some have 4). The object is that, given this 5x5 grid, find all (or as many as possible) of the given animals within 10 turns, where the pattern of animals can be at any pla...
I've been trying to wrap my head around the following question for ages, its part of my revision for the upcoming end of year exam, however I fail to see how there is a link from the number to the letter, how will one cycle from 1 to a and iterate to get there? if that makes any sense! We were told that when estimating...
The problem is defined as: Given a set of $N$ points $(x_1, x_2, x_3, \ldots, x_n)$ and $L$ the fixed length of a segment. Find the number of maximum points which you can cover with a segment line of length $L$. Ranges $1 \leq N \leq 100 000$ $1 \leq L \leq 10^{10}$ $0 \leq x_i \leq 10^{10}$ I call sub-optimal ranges...
I was looking through these notes but I am not sure I can locate the answer to these questions of mine - it would be great if someone can just even point out what to look for! So any set of binary vectors can be seen as "code"? Let $M$ be a $d\times m$ matrix over $\mathbb{F}_2$ and let $X(M)$ be the graph on the bin...
This is from a textbook on operating systems. This is not homework, just part of the chapter on deadlocks. transaction(Account from, Account to, Number amount): mutex lock1 = getlock(from) mutex lock2 = getlock(to) acquire(lock1) acquire(lock2) withdraw(from, amount) deposit(to, amount)...
What is the complexity of the recurrence $T(n) = 3T(\frac n2) + O(n)$? So far I have: $ O(n) \le cn$ for some constant $c$ Hence: $$T(n) \le 3T(\frac{n}{2}) + cn$$ After a recursion: $$T(n) \le 3(3T(\frac{n}{4}) + \frac{cn}{2}) + cn$$ $$= 9T(\frac{n}{4}) + \frac{3cn}{2} + cn$$ After another recursion: $$T(n) \le 9(3T(...
I am looking for open problems in complexity theory that an undergrad might have any possibility of tackling.
Anyone has an idea how to solve this problem: Let G be an undirected, unit-weighted connected graph. Design a linear-time algorithm to obtain a 2-approximation of the diameter of G. I.e., the largest shortest-path distance between a pair of vertices of G. I thought about running BFS from an arbitrary node, in the worst...
I am studying Abelson and Sussman's Structure and Interpretation of Computer Programs, 2/e. I solved the exercise 1.7, which asks for a better stopping criteria for an iterative function to calculate the square root function, and then checked my solution against one that I found on this site: http://community.schemewik...
I am reading the paper Compiling with Continuations, Continued, and in section 2.4, Comparison with ANF, the author draws attention to the fact that ANF is not closed under beta reduction. The snippet of text in question follows: As Flanagan et al. (1993) suggest, the “back end of an A-normal form compiler can emplo...
I would like to know the complexity of multiplying a matrix of $n\times m$ size by a scalar $\alpha$? In fact, I have a directed graph $G=(V,E)$ represented by an incidence matrix $M$. I would like to calculate the transpose of this graph, i.e., inverse the directions of the edges. I think that if I multiply $M$ by $-1...
The Problem Convert 256 to its 2's complement representation. My Work    I know that 256's representation in unsigned binary is 100000000. What I know from working with two's complement model is that the most significant digit represents the sign of the number. So in this case, 100000000 cannot be 2's complement rep...
I'm having trouble with a problem from HackerRank, and I'm hoping someone here can enlighten me. The problem is stated like this: What is the minimum size of the largest clique in any graph with N nodes and M edges? The hints suggest using Turan's theorem, but it's not clear to me how to get from that to a solution. ...
Note: I have posted a hugely expanded version of this question on cstheory. Since a Sokoban instance with only $k$ boxes has at most $n^{O(k)}$ possible states, the problem lies in $\operatorname{NSPACE}$$[O(k \cdot \log (n))]$. Since the region X X X XX XX X X X XX X XXX has neither boxes nor storage loca...
A trivial algorithm to decompose a degree-d (n,n)-bipartite graph into d disjoint perfect matchings is this : direct all the edges from left to right and put capacity one on each of them - then add a super-source and a super sink with appropriately directed edges from them to each of the vertices on their side with ca...
The Problem: What value does the hexadecimal number x55544552 represent in data type IEEE floating point? My Work:     I first wrote out that hexadecimal number in binary and got 0101 0101 0101 0100 0100 0101 0101 0010    Now I have my three different sections, the sign, 0, the exponent 10101010 - 127, or 170 - 127...
Use the Pumping Lemma to show that $L$ is not regular: $$ L = \{{a^{n^3} | \ge 0}\}$$ I feel like I have a good intuition of what the Pumping Lemma states; strings that belong to a regular language have a part or parts that repeat over and over again. Example strings: $a^{0^3} = a^0 = $ "" ($\epsilon$) $a^{1^3} = a^...
In relation to the thread Proving that the conversion from CNF to DNF is NP-Hard (and a related Math thread): How about the other direction, from DNF to CNF? Is it easy or hard? On Page 2 of this paper, they seem to hint that both directions are equally hard when they say "We are interested in the maximal blow-up of s...
Suppose $A$ is a sorted array with $n$ elements. I want to know whether we can determine if there are majority elements in $A$ with time complexity $O(1)$. Recall that a majority element of $A$ is an element which appears over $n/2$ times in $A$. I can find a $O(\log(n))$ algorithm to solve this problem. But I'm not s...
give a context-free grammar describing the language L={w∈{a,b}∗∣w is of the form xby, where |x|>|y|}. I had one solution like this S -> AYCbY|AYbY|YCbY A->aB|bB B->aB|bB|_ C->aD|bD D->aD|bD|_ Y->aY|bY|_ but it was complaining that it accepts the language babbabaaaaa which is not belonging to the language. Anyone know...
I have labeled examples coming in on the fly, thus I need to create a classifier from sequential data instead of a static example set. Incoming data is fully labeled, there are no unlabeled examples. Each incoming example has a number of features. E.g. let X by an incoming example with 3 features X := (day = sunday, we...
I'm reading a proof on the time complexity of MergeSort which makes this statement without any justification. I've tried to show it myself but I'm not getting far; these are my steps so far. $\sum\limits_{i=0}^{\lg(n)-1} \theta(\frac{n}{2^i}) =\theta(n\sum\limits_{i=0}^{\lg(n)-1}\frac{1}{2^i})$ Now $\sum\limits_{i=0}^{...
I want to solve the following optimisation problem (an approximation or heuristic would be helpful as well). I have two sets of points in the plane: $P=\left\{ p_{1},p_{2},\dots,p_{N}\right\} $ and $Q=\left\{ q_{1},q_{2},\dots,q_{M}\right\} $. Each point has a value/weight, i.e there is a function $v:P\cup Q\rightarro...
I'm writing a data structure library, and I want to write an efficient algorithm for adding many elements to a finger tree (from an iterable sequence). I'm going to do this by constructing a finger tree from the sequence efficiently, as described below, and then concat it to the original finger tree. Concat is a very c...
In this problem. I have a set of "activities" which can happen. Each "activity" is associated with several values: Duration: The length of time the activity takes Earliest time to start: The earilest time at which the activity can begin Latest time to start: The latest time at which the activity can begin Weight/Value...
I'm interested in finding the LCA of two distinct Nodes in a (not necessarily binary) tree from the bottom up without using depth. How would I go about traversing the tree, starting from any 2 arbitrary nodes, each of which points to a previous node as shown without a depth variable?
i am currently working on a school project that takes in a simple linear equation and has to return the value of x, the code i have transforms x + 3 = 3x - 2 into a binary tree format like so: = / \ + - / \ / \ x 3 * 2 / \ 3 x now that i have the expression ...
I have a tentative understanding of modal logic. Can anyone explain modal logic as it is used in computer science?
I was looking at this question. So if I understand the above discussion right then it concludes that if say one had access to an oracle which can uniformly at random sample from a finite set then one can't using this uniformly at random sample a permutation of another finite set (chosen may be adversarially) and also...
I have benn wondering about the following possibility: if I have multiple hardware threads on the same core, and then someone decides to use shared register to allow fast synchronization among threads that run on the CPU, and implements test-and-set on the register instead of doing it in main memory. Will this work? an...
I've seen a few references [1], [2], [3] that say that for a Turing Machine with transition function defined by: $\delta: Q \times \Gamma \rightarrow Q \times \Gamma \times \{L, R\}$ the number of turing machines with $n$ states and $k$ tape symbols is $(2kn+1)^{kn}$. However, looking at the definition, shouldn't it be...
I understand that every self reducible language recursively queries its oracle with strings of length less than the input size. But how does that show that every such language can be solved in polynomial space?
I need to find out to what extent two shapes are similar. I mean I've got two vectors of points - and just that, no shadows, color or whatever - simplest case. Two triangles are the perfect example. Of course this has to work regardless of what the angle shift is and regardless of their scale (only aspect ratio matters...
In closure properties, I got confused between substitution and morphism. 1) According to Wikipedia, string substitution means to map letters in a set of alphabets to languages (possibly in a different alphabet), that is, $f(a) = L_a$. Does that means to replace a letter with a language? Or replace 1 letter from a set...
I am looking for the function $y=f(x)$ that would map the integer interval $[0,n)$ into itself $[0,n)$. The function must be bijective, so it is a permutation of n elements. It should "randomize" the input variable, ie. for every $x_1$ and $x_2$ that are close $|x_1 - x_2| < 100$ the outputs of the function should dif...