instruction
stringlengths
35
11.4k
Lets say I have two type expressions: Maybe a (X) and Maybe Integer (Y), where Maybe is a type constructor, Integer is a Type and a is a type variable. What language should I use to describe the relationship between these expressions, and type expressions in general? I've been using the language of sets: X describes a...
We are solving a system of equations $f(x)=0$, including non-linear equations and piecewise linear equations. The space is subdivided to polyhedral pieces (cells), in every of them the equations from the second group are simply linear and there is $C^0$-continuous connection of the equations between the cells. From the...
My motivations for asking this question are philosophical in nature. I'm by no means a computer scientist though, and I feel as though this question should be answered by someone who is since it's one thing to read about a subject second hand and another to understand it first hand. I'm an A-level student of philosophy...
In learning about proof theory, I am interested to know how to go about "proving properties of a program". I don't exactly see yet what needs to be proven, nor how to prove it, which leads to this brief discussion followed by some questions. In some languages (such as TLA+), the program is the specification (I think). ...
Consider a DB with a large set of numbers, like hashcash tokens, where new numbers are constantly added(spent). Only numbers that has not been already added can be accepted. Is there a functional way to do this by some sequential operation on the numbers, so that only a single number X is needed to verify that a new n...
I'm currently studying some of the history of computation / computability, in the early days known as recursion theory. I see Goedel's definition of recursive functions seems significant in his paper, and Church uses his own definition of recursive functions (in particular, primitive recursive functions). Wikipedia tal...
An four-bit carry-look-ahead adder for computing the sum of 2 numbers , where A and B are integers represented in 2's complement form. If the decimal value of A is 3, the decimal value of B that leads to the longest value for the sum to stabilize is __________________ I know adder is used for adding two numbers and car...
I'm assisting with the design of an algorithm over the next week to fit the following use case: A person walking in a store has a tablet and approaches possible customers to notify them of a competition. When a customer enters their details, upon completion of the form - a request is sent to the server, and the custome...
Kindly suggest what would be the loop invariant in the following algorithm ( I need it for the purpose of proving the partial correctness of the algorithm). MinDistance(A[0...n-1]) dmin <- ∞ for i = 0 to n-1 do for j= 0 to n-1 do if i ≠ j and |A[i] - A[j]| < dmin dmin <-|A[i] - A[j]| return dmin another...
first post on this amazing community, always been a lurker, so I'm sry if my formatting sucks. I'm having a really hard time trying to solve this problem: Given m graphs each composed of the same n vertexes, find all the pairs of equal graphs(not isomorphic). OBLIGATION: it is possible to elaborate an algorith that do...
In Union-Find with link-by-rank but no path compression find a sequence of operations Make-Set, Find, Union of length $m$, containing $n$ Make-Set operations, and with time complexity in $\Omega(m\log n)$. My idea was to spawn $n$ nodes with $n$ Make-Set operations and then create a "tree" with $\log n$ height out of t...
The condition of the problem and the statement of the problem: Alice pays Bob for the fact that he, at the request of users, gives out files of interest to users. For example, the user is interested in the file #hash1. The user learns from Alice that this file is stored by Bob. The user connects to Bob and asks to star...
The question is in title. Let me repeat: What are the number of states in NFA and DFA accepting strings from length 0 to n with alphabet $\Sigma = {0,1}$ I feel both NFA and DFA will take following form: and thus both have $n+1$ states. Am I correct with this? Or the DFA needs to take following form? I feel its not...
Well, this sounds somewhat basic definitions, but I feel they needs to be clearly defined. In book by Hopcroft et. al., there is an excerpt: ...a dead state, that is, a nonaccepting state that goes to itself on every possible input symbol... In book by Peter Linz, there is an excerpt: ...the automaton finds itself i...
I can access some information about the files ("created" or "last edited") on my PC. But where are those information actually stored? Are they stored by the operation system? Could be possible as if I transfer a file with FTP to an other PC, it has new timestamps for those information. Or are they stored in the beginni...
I'm having a tough time convincing myself right when coming up for some solutions to medium/hard leetcode.com problems. Take the following question for example. Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output any poss...
I'm studying about time complexity of Kruskal's algorithm. But there are two opinions to express time complexity as $O(|E|\lg|E|), O(|E|\lg|V|)$. I know $O(|E|\lg|E|)$ is occurred from sorting by non-decreasing order of vertices. But I don't understand of $O(|E|\lg|V|)$. This answer explains by $|E|\le|V|^2$, however f...
I have an online homework assignment that is asking me for the tag and index in a direct-mapped cache, for a series of memory addresses. The cache is specified to have 16 one word blocks. One of the first memory addresses given is 134. My attempt goes as follows: 134 = 10000110 16 = 2^4 so, I get that: index = 1000011...
Let's say that there is a tower of blocks labelled from top to bottom $1$ to $n$. Somebody comes along and removes a block and reinserts it somewhere in the tower (making space as needed). As they move these blocks one at a time, they write down in order which index they moved a block to (index starting at 1). For exam...
Certain idealizations of a Turing machine yield an increase in computational power, such as an inductive Turing machine, which can (trivially) solve the halting problem if it has an infinite amount of time to run. A related variation is the "type-2 Turing machine" defined by Weihrauch, which (if I understand correctly)...
We know about calculability of a function or computability. We looks for the ability to solve a specific problem / compute a function with calculus method. But if we define a calculus method, is there a way to find generals limits of the method ? Can we say that if the method can give same results as logical connec...
I'm just getting started with STLC (Simply Typed Lambda Calculus) and I'm trying to understand an evaluation rule I've been given in some lecture notes by my professor. What it says is the following: (λx. x(λx. x)) (u r) evaluates to (u r) (λx. x) I don't really get this at all. Can someone point out which step I'm mi...
I'm referring to the decision version of both $TSP$ and $HamCycle$. The first is, given a graph $G=(V,E)$, a weight function $w:E\rightarrow \mathbb R^+$ and an integer $k$, is there a simple cycle with weight $\leq k$ which passes, once, through every vertex? (The weight of the cycle is the sum of the weights of the ...
I am reverse-engineering a file format that contains in some places in the binary file what should be a representation of integer numbers. However, I cannot make sense of the relation between the bytes values and the numbers. The sample data I have is the following. Only two bytes seem to be relevant. I have also inclu...
I need a data structure to store priority $p$ for each key $k$ (unique). It must also support the following operations in $O(\log n)$ time: $\text{Insert}(k,p)$ Inserts a key $k$ with priority $p$ into the structure. If there already is an element with key $k$, it changes its priority instead. $\text{Delete}(k)$ Delete...
In the CLRS, time complexity of Prim's algorithm is $O(|V|lg|V|+|E|lg|V|)=O(|E|lg|V|)$. But, for my understanding, Prim's algorithm iterates $|E|$ times for DECREASE-KEY operation which takes $O(lg|V|)$ times and it leads to $O(|E|lg|V|)$. So, it iterates $|V|$ times then, I think $O(|E||V|lg|V|)$ is right because whol...
So theres the classic problem of finding the median in an AVL BST in O(log(n))* However given two AVLs, each having N different values (all values in both trees combined would be 2N different values) how would one find the median** in O(log(n))? edit: Nodes can have the size of the subtree in each node like in * I've ...
For traditional algorithms compressed data may vary, while decompression algorithm is always the same. Are there any approaches, when (de)compression algorithm is also changing to provide best compression level? One can think about splitting data as small chunks and for each small chunk iterate all possible (de)compres...
I read the term "non-deterministic algorithm" in many places but I don't see how an algorithm can be truly non-deterministic. Typically, there is some source of randomness in these algorithms. If the output of the randomness source is considered an input, the algorithm reduces to a deterministic algorithm. So the only ...
I am trying to find shortest path between 2 nodes in a graph similar to below: Each edge has a weight assigned to it. Also, the graph is directional with each edge directing from left to right. I am trying to find shortest path from Start to Stop, subject to a constraint (based on already visited nodes). If a node I1...
I'm interested in the following problem : Input : an integer $n$, and $k$ increasing functions $f_i:\mathbb{N}\rightarrow\mathbb{R}$, such that $f_i(0)=0$ for all $1\le i \le k$ Output : $k$ integers $n_1,\dots,n_k$, such that $n_1+\dots+n_k=n$, with $0\le n_i\le n$ Goal : Maximize $\sum_{i}f_i(n_i)$ My question is : I...
I have such a task at university: we have $n$ tasks, the $i$-th of them can be done between moment $b(i)$ and $e(i)$. If we decide to perform a task in moment $x$, we finish performing it in moment $x+1$. We can perform at most 1 task at a time and we cannot interrupt performing it. Create an algorithm to check if it i...
I generate crc 16 bits with hex Workshop. Polynomial :1234(hex) Initial Value :5678 (hex) . making it on 010 (ascii) and get 3744. I looking for this algorithm , I prefer it on c#. but I not find it. Can you please help me? thank you a lot!
While trying to implement LPA* (mostly based on its description in the same authors’ paper on its derivative D*Lite), I noticed it mentions predecessors and successors of a vertex without giving a full explanation. I understand that $Pred(u)$ is the set of all vertices from which an edge leads towards $u$, and $Succ(u)...
In his "Notes on Structured Programming" essay, E. W. Dijkstra gives an example of a program that computes the first 1000 primes (Section 9. "A First Example of Step-Wise Program Composition"). The idea is to iterate all the numbers from 1 to 1000 in increasing order, to test each one and if found to be prime save it i...
I'm reading through a short paper about hitting the memory wall and I'm struggling to understand how exactly said wall will be hit. The equation for average access time is fairly simple Tavg = p x Tc + (1-p) x Tm. (Tc = time for cache, Tm = time for DRAM mem, P = probability of cache hit) What I don't understand is how...
Let $S$ is a triangulated surface, representing a graph of a function z(x,y) in 3D space. According to https://en.m.wikipedia.org/wiki/Piecewise_linear_function every continuous piecewise linear function can be represented in min-max form $$f(\vec x)=\min_{\Sigma\in\Pi} \max_{(\vec a,b)\in\Sigma} \vec a \vec x+b$$ If a...
after shutting down the computer do the ram loses what it remember ? if yes is there some technics that are used to get what is stocked into the ram after shutting down the computer ?
If $X \sim \mathcal{O}(\log n)$, then $e^{-X} \sim \mathcal{O} (?)$ Is this a valid question to ask?
I saw this post, and it explains about why kosaraju's algorithm includes transpose graph $G^T$. But, I totally didn't understand why cannot use increasing order of original graph. Kosaraju's algorithm uses decreasing order of transpose graph. Is there an any counter example about this? I'm really confusing.
I had a question regarding removing lambda-productions from context-free grammars. I understand that the basic theorem or process for removing lambda-productions is to find nullable productions and replace them with the version of the same production when we use lambda. However, I had a question regarding special cases...
Consider a weighted undirected acyclic graph consists of m source (root) vertices and n target vertices. The m-spanning tree problem of the graph is defined as that: (1) each of the m spanning trees starts at one different root vertex and connects a subset of the n target vertices; (2) one root vertex might not connec...
Serializability is the strongest consistency level with regard to the execution of two concurrent transactions T1 and T2. That is, if T1 and T2 independently change the application between consistent states, and a concurrent execution of T1 and T2 is equivalent to a serial execution of T1 and T2, then that concurrent e...
Are there any known bounds on the impact of changing (for example) one bit in a string on the resulting string's Kolmogorov Complexity? In mathematical terms, does the equation $|K(x) - K(x')|$ (with $K(x)$ as the Kolmogorov Complexity of $x$ and $x'$ as the string resulting from changing an arbitrary bit of $x$) have ...
Wikipedia says that: If a mesh covers more pixels in screen space than it has vertices, interpolating colour values from samples of expensive lighting calculations at vertices is less processor intensive than performing the lighting calculation for each pixel as in Phong shading. Why does it matter that there are mor...
Assume we have a big 2d array. All its elements are either zeros or natural numbers. A local minimum is an element that is less than all its 8 neighbors. Is there an effective algorithm to find all local minima in the array?
I have a table consisting of some headers $P, Q, R, S$ (shown in blue in Table 1). According to the headers, the column $T$ is populated using some predefined logic. Now, any of the headers $P,Q,R,S$ may be wildcarded to match all values. The aim to to compress the table using wildcards so that column $T$ is not affect...
Read this many years ago and can't remember who it was about. Nor can I remember the exact quote. The story goes: Famous computer scientist/professor is teaching a class. Student is having some problem w/ a machine and wants to reboot it, hoping to fix the issue. Professor chides him, saying something to the effect of...
Let's say we have the following rule for that particular Nim game: You have multiple heaps, and you have to remove 1,2 or 3 sticks (not more) from a SINGLE choosen heap. The player who pick up the last stick LOSES. (misere game). Is there an algorithm which solves this variant of Nim game ? Thanks in advance!
I need to find all possible paths in a directed graph, that may have loops. The graph has a defined start and one or multiple defined endings. Basically im trying to find all possible scenarios in a Use Case Description. Since loops may occur, the user may define how many times a loop/alternative flow may be repeated. ...
I'm working on a problem that combines Steiner Trees and Shortest Path trees. We have a (sparse, connected) graph $G=(V,E)$ with non-negative edge weights and edge lengths, a set of terminals $T \subset V$ and a root node $s \in T$. The goal is to connect all terminals to the root node while minimizing the total edge w...
I'm curious if there is any body of research that could be considered as the logical successor to Marvin Minsky's "society of mind" idea? It seems as if the notion of agents plays a crucial role in his thinking. I'd be interested in reading more about recent efforts in this direction.
I have a problem in a book I am trying to accomplish. I understand the overall type of the expression is boolean and how it derives. (y * x) will be rule 4 (counting from top right). (y * x) + x when evaluated will be rule 3 and the overall expression when evaluated will be rule 5. What I want to figure out is what i...
Can we achieve consensus (paxos, zab, etc.) without using a turing machine? What's the least powerful machine we can use to achieve consensus?
Suppose we have $x$ apples and $y$ boxes. Each box can fit at most 3 apples, and we say that a box is half full iff the box contains $\leq$ 1 apple. If each apple has a (non-empty) list of boxes that it can be placed in, what is a polynomial time algorithm that places apples in boxes such that the number of half full c...
I remember somewhere seeing the following. If $x$ and $y$ are integer variables then we cannot multiply them easily unless we know a bound $B$ on them. Suppose I have an array $\overline x=[x_1\dots x_n]\in\{0,1\}^n$ and $0\leq y\leq B_y$ holds and entries of $x$ and variable $y$ are integers then is it possible to mu...
I asked this on StackOverflow, but, alas, no answers. I'd like to use CRC or similar codes to check whether certain very large objects are likely to be identical. The trouble is, small parts of these objects are sometimes modified, and it would be very inefficient to re-compute CRC code from the entire object. Think of...
I know that there are $2^{32}$ different combinations of IPv4 addresses possible , if expressed in binary. In decimal notation, they range from $0.0.0.0$ to $255.255.255.255$. So are there $256^{4}$ possibilities if expressed in decimal? And $16^{4}$ in hexadecimal? Thank you.
I am intrigued by Triple Graph Grammars (TGG) as a potential for formal mathematical proof. Triple Graph Grammars (TGGs) are a technique for defining the correspondence between two different types of models in a declarative way. In some systems, proofs are simply trees of rules being applied to transform one syn...
I have a priority queue (using a max heap) that preserves insertion order for duplicate priorities, such that equal priorities fall back to FIFO behaviour. I'm doing this by creating a node with the value, the priority, and an 'insertion stamp' that is basically an incrementing number on the structure. I'd like to remo...
If I have two arrays containing max and min points which make up an envelope. It's quick to test if any point in a given data array goes outside of that envelope using: for (int i = 0; i < envMax.size(); i++) { if ((data[i] < envMin[i]) || (data[i] > envMax[i])) { return false; ...
Let $L = \left\{ \langle \alpha, x\rangle \mathrel{}\middle|\mathrel{} \textrm{x is the only string accepted by}\mathrel{}M_\alpha \right\}$ and $HALT = \left\{ \langle \alpha, x\rangle \mathrel{}\middle|\mathrel{} M_\alpha \mathrel{} \textrm{halts on input x} \right\}$ How can I prove that $L$ is undeciable by reduc...
I am looking for a name for the property $\mathbf{?_2}$ (and for that, it is sufficient to find a name for the property $\mathbf{?_1}$ since "Uniform" could then be added in front of it). Confluence : If $t_1\leftarrow^* t \rightarrow ^* t_2$, then one of the following is true: There is $t'$ such that $t_1\rightarrow...
Given a CFG in Chomsky normal form, is there an algorithm that solves the emptiness problem in linear runtime? I thought about using depth search here, but I think it's a little bit above linear runtime.
I am unsure where to start with this. From what I understand so far, 'VAR(x)' corresponds to Rule 2, ':= VAR(x) ' refers to Rule 5 and '+ NUM (1) refers to link 3. a := (b+c)*(-e); becomes t1 = b + c t2 = – e a = t1 * t2 I understand the translation above, What I am not that clear about are the recursive rules. How ...
Suppose we have a small computer network, there are 30 random people who have provided their computers to perform any computational tasks on them. Let's call these 30 computers nodes. We can access any of these 30 nodes arbitrarily, but by the condition of the problem, we do not know whether the node is honest. That is...
In my understanding, a lambda expression is a normal form (NF) when it has no redexes. For instance, $\lambda x.x$ is a NF, but $(\lambda x.x)y$ is not. A lambda expression is a weak head normal form (WHNF) if the root expression is not a redex. For instance, $\lambda x.(\lambda y.y)x$ is a WHNF, but not a NF as it red...
Let $(P)$ an Integer Linear Program, where we aim to find $x\in \{0,1\}^n$ maximizing a linear function $f:\mathbb{R}^n\rightarrow\mathbb{R}$ under some linear constraints $Ax\le b$ Let $(P^*)$ be its relaxation, which means that the constraint $x\in \{0,1\}^n$ is replaced by $x\in [0,1]^n$. Then, suppose that we know ...
I'm trying to build a graph with $n$ vertices and $k \cdot n $ edges, I need to make sure that this graph is $2k$ connected, meaning that it cannot be disconnected by removing at most $2k-1$ vertices. I'm looking for an algorithm that given n,k outputs such a graph.
I've been thinking about this question ever since I learnt about the $O(n\log(n))$ sorting algorithms such as MergeSort, QuickSort (average case is pretty much worse case with a good choice of a pivot) and HeapSort. I've been thinking how can we possibly achieve a greater class of efficiency in worst case? Can we do so...
I understand you can use process wide mutexes, but does this still apply if you have an additional virtualized operating system provisioned? For example, take two OSes: O1 and O2 where O2 is a virtualized OS provisioned on O1. Now take some code C that uses a process-wide mutex. Run C on O1 and O2. Assuming they have a...
I have written the following recursive structure for finding length of longest increasing subsequence. int lis(int arr[],int n,int k,int prev) //k=0 (pointing to start) { //prev=0 (value of prev element included in subsequence) if(k==n) return 0; int res; if(arr[k]>=pr...
I was wondering if you could help me to understand the difference between analogue and digital data. I looked it up online but couldn't find a proper answer. If for any reason this is the wrong site for my question please guide me to the correct site, Thank you.
I've recently started to deal with complexity theory and I'm trying to wrap my head around all the definitions and why they make sense. One thing I don't quite understand is the importance/necessity of co-NP as its own set/class of problems. Couldn't for example TAUT be classified as a NP-complete problem just like SA...
A non-recursive linear Suffix Array construction algorithm is presented in this thesis: Linear-time Suffix Sorting. The author claims that, overall, the algorithm runs at $O(n)$. While it is well explained, there are only hints that this is case. The implementation of the algorithm is in this GitHub repository written ...
Given a permutation $P$ of an unknown array $U$ of length $N$ and a function $f(Q)$ that calculates the minumum number of swaps between consecutive elements of array $Q$ to reach $U$, what is the minimum number of invocations of $f$ to discover $U$, worst case? An upper bound of $N$ invocations is at hand: Calculate ...
Given a language $L$ over $\Sigma=\{a,b\}$ let us define $L'=\{uv : u \in L \; \land v \in L^R \; \land |u|=|v|\}$ Prove: if $L$ is regular, then $L'$ is a context free language. I know how to solve it by building a push down automaton and proving it acceps $L'$, but I'm trying to solve it by using closure properties...
Let G be a graph with $n$ vertices such that $n\geq2$. Prove that, if $\mathrm{deg}(v)\geq \frac{n-2}{3}$ for every vertex $v$ in G, then G contains at most two connected components.
Description: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. The order of elements can be changed. It doesn't matter what you leave be...
Suppose we have a maximally triangulated graph $G$, where $V$, $E$ and $F$ is respectively the number of vertices, edges and faces. The following graph should be a maximally triangulated graph. Apparently, the equation $3F = 2E$ holds for $G$. Why (intuitively) is this the case?
What is the difference between multi-agent systems (MAS) and distributed systems, in the context of control with agents?
Let's look at example AF(φ1 -> AG(φ2)). Does it mean that: In all paths it eventually happens that if φ1 was satisfied, φ2 is satisfied all along the path (so it basically means φ2 is satisfied in all states in all paths) or In all paths it eventually happens that if φ1 was satisfied, φ2 is satisfied starting when t...
I'm trying to come up with a context-free grammar for the following language: $$L = \{a^mb^nc^{m+n}\mid 0 \le n \le m\}$$ My thinking is that i can rewrite this to $$L = \{a^mb^nc^nc^m\mid 0 \le n \le m\}$$ and then create the grammar $$ \begin{align*} S &\rightarrow aSc \mid B\\ B &\rightarrow bBc \mid \epsilon \end{a...
I'm implementing some estimation metrics that take samples of optimisation functions and estimate their properties. One of the metrics requires the data to be sorted; however, since the metric is only an estimation, I was wondering if I could get a comparatively accurate result if the data wasn't sorted precisely, but ...
I understand z-buffering as being "object-first" in contrast to "pixel-first" since the for loop starts with checking each triangle in the scene rather than each pixel. However, is this the same as rasterization, or is rasterization just a general technique that encompasses z-buffering?
After constructing the recursion tree i concluded a cost of $n^2\cdot log_2(n)-i\cdot n^2$ per level. So my total cost is: $$\sum_{i=0}^{log_2(n)}n^2\cdot log_2(n)-i\cdot n^2$$ $$=(log_2(n)+1)\cdot n^2\cdot log_2(n)-\sum_{i=0}^{log_2(n)}i\cdot n^2$$ $$=n^2\cdot log_2^2(n)+n^2\cdot log_2(n)-\sum_{i=0}^{log_2(n)}i\cdot n...
I have two processors, and I want to schedule as many jobs as I can. I have their starting time and finishing time, and each job has to be unique to a processor (no overlap). I looked around and found one processor, or n processors - but none for two. I thought it'd be popular but I can't find if anyone's done this bef...
A paper uses Haskell type classes to represent ontological categories. A type class hierarchy is used to represent "concept hierarchies" where "functions are the units of inheritance". Here is a diagram of the Haskell type classes based on the paper: With respect to the code below the following claim is made: The Has...
How would I solve the following problem? You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is represented as a matrix of 0s and 1s, where 0s are passable space and 1s are impassable walls. The door out of the prison is at the top left (0, 0) and...
As in, with the two final sublists which are sorted arrays, let's say just for this example (yes it is no longer fully MergeSort but I am interested in the time complexity only), that we finish with a constant time operation involving the two sublists. MergeSort in worst case is $O(n\log(n))$, and not having the final ...
I have a small context-free grammar, which I would like to use to turn input strings into parse trees. I need to get all possibilities in case of ambiguity (so shift-reduce is out), and there's quite a lot of left-recursion (so recursive descent is out). With these constraints in mind, I've implemented Earley's algorit...
This is the form of the problem where you start at a city, visit every other city, and return to the start city. Since you "return" to every city in the completed cycle, it seems intuitive that the cycle would be the same regardless of the starting city.
Assume you have m stacks each some elements within it. If you are allowed to do k pops , the objective is to maximize the sum(sum increases by the value of the popped element). What is the best algorithm which would be able to solve this problem. Can the complexity be improved if the details of the elements in each sta...
There's a board with given dimensions (NxM) and it has few queens places on some of the cells. We need to find in how many ways each cell is under attack by the queens on the board. e.g., ....Q .Q..Q ..... ..... Each empty cell is denoted by '.' and each cell having a queen placed is represented as 'Q'. For this confi...
so i have a good understanding about languages that belong to NP, P and NP complete, and how Polynomial reduction works between languages that belong to those areas. but i just can't figure out a conclusion about mapping reduction between languages in those areas. for example if i have 2 languages - A and B, that both...
Say I have a function like this: function colorize(integer) { var hex = '#' if (integer > 1) hex += 'ff' else hex += '00' if (integer < 100) hex += 'aa' else hex += 'bb' if (integer > 10) hex += '11' else hex += '22' return hex } It returns CSS hex colors, not named colors or rgb(...) values or anyth...
I understand the need for a universe hierarchy, and that each new level brings additionnal proof-theoretic strength. In the HoTT book there are examples of proofs that need to use the next level in the Universe hierarchy. Do we have examples of inhabited types A:U(n), where the construction of the inhabitants/proof a:A...
Regular expression: (0 + 01)(ε + 1)1(ε + 0 + 1)* I dont know if my answer to this is entirely right but please enlighten me if i'm way out of line. \begin{array}{c|ccc} \ &0&1&\\\hline q0&\{q0\}&\{q1\}&\\\ q1&\{q1\}&\{q1\}&\ \end{array}
Given $A, B$ languages over $\Sigma,$ Prove/Disprove: If $A _{\leq M} B$ and $B _{\leq M} A$ then $A=B$. I would like to disprove this claim, with the languages $H_{TM}$ and $H_\epsilon = \{\langle M \rangle\ |\ M \ halts\ on\ empty\ tape\}$ I can prove $H_{TM} {_{\leq M}} H_\epsilon$ by taking $\langle M,w \rangl...
I have the following byte: 0x0A and I need to test if a quadword contains it or no using standard bitwise operarion (or, nor, xor). For instance: 0x1689FFBB768922AC ---> false 0x106489320A792399 ---> true Unfortunately I cannot use intel SSE2 extension because this will make the code heavily depndent on the platform. C...