instruction
stringlengths
35
29.1k
I wish to discuss the element uniqueness problem. First let's define the problem: Definition from wikipedia: In computational complexity theory, the element distinctness problem or element uniqueness problem is the problem of determining whether all the elements of a list are distinct. i am aware that this questi...
So, I am revisiting complexity analysis. Here's the example: the instructor reduced an algorithm to: n*(1 + 1/2 + 1/3 + ... + 1/n), and I can't seem to grasp why the part in parentheses is log(n).
So I am trying to construct a timeline graph for threads interacting with synchronization functions e.g. pthread_mutex_lock. I have the following information: 1- thread ids 2- ids for the synchronization functions 3- Arrival times of the threads at the synchronization functions e.g. the time at which the thread encount...
I need an algorithm that will find four points. These four points form the vertices of a polygon Which four points make a polygon with the most area? Sample data: http://jmp.sh/v/8lAytDc00UrOa17Z6Oo6
Wikipedia claims that bin packing is strongly NP-complete. Unfortunately I haven't been able to find a proof. Does anyone know where to find it?
I'm trying to prove the following laws using structural induction on (finite) lists: take m (drop n xs) = drop n (take (m + n) xs) drop m (drop n xs) = drop (m + n) xs for all m, n and every finite list xs (code snippets are in Haskell). I'm not sure how to tackle it though, more specifically: afaik when using inducti...
am trying to figure out how to design a unary number Turing Machine. That after reading all the unary number in the tape it would give out a decimal value. how can i approach this problem?
It is said that in 2's complement 0 has only one value, while in 1's complement both +0 and -0 have separate values. What are they?
In the sources I consulted it states that in the Baum Welch algorithm the reestimate of the initial probability of state $i$ of the HMM is $\pi^*_i = \gamma_i(1)$. But $\gamma_i(t)$ is the probability of being in state ${\displaystyle i}$ at time ${\displaystyle t}$ given the observed sequence ${\displaystyle Y}$ and t...
Suppose a comparison between elements takes 1ms to execute. If an algorithm is O(logN), for example, deletion in an AVL Tree, and the AVL Tree contains 100 elements. Does that mean that the time to execute the algorithm would be log100 * 1ms? Do I need more information to calculate this or is this enough?
I am a layman in computer science. How do the command we input in a computer, which is a software component, changes into a hardware component. For example, if I want to play a song, I will just click the song and the audio starts to emit from the speakers. So how does in general these things happen?
Let $G$ be a undirected graph with $n$ vertices and no edges, and let $f(k)$ be the probability that if we add $k$ edges randomly to $G$ that $G$ will be connected. How would one determine $f(k)$ for a given $n\in\mathbb N$? Specifics: When we add an edge to the graph $G$, any edge that can exist would be equally likel...
I'm trying to simulate Shor's algorithm with a model using vectors for quantum registers and matrices for quantum gates, however I'm stuck at the modular exponentiation bit of Shor's algorithm, having no idea how to build the corresponding matrix (unlike Hadamard and QFT). How can I build said matrix?
I am reading the following paper: Big-Align: Fast Bipartite Graph Alignment. Danai Koutra, Hanghang Tong, David Lubensky. International Conference on Data Mining (ICDM 2013). I'd like to understand one of the paper's claims about the running time of their algorithm. Their algorithm uses matrix multiplication as foll...
I've got this DFA and I need to figure out and describe the language that it accepts. I figured that $M= \{\{1,2,3,4,5,6\}, \{a,b\},1, \{1,5\}, \delta\}$ Now I don't know how to move forward.
Problem 7.16 in The Nature of Computation reads as follows: [...] show that when defining primitive recursive functions, we really only need to think about functions of a single variable. In particular, show that a function $f(x)$ is primitive recursive if and only if it can be generated from $0$, $S$, $pair$, $left$,...
I am training a HMM with Baum Welch for part of speech tagging. I am training the model with 79 hidden variables (part of speech tags) and 80,000 observed variables (words). I am working with log probabilities. To give you an idea, I defined the necessary arithmetic operations like so: struct log_policy { template<...
A computer can be pretty much made using just nand gates and a clock. Suppose you randomly place down nand gates on a board and connect them randomly to other nand gates. How many gates does someone have to put before it can be expected that the "computer" is Turing Complete?
Im'm studying Instruction Set Architecture using the book "Logic and Computer Design Fundamentals". Studying types of architectures I came up with an example of memory-memory type which is: ADD T1, A, B ' M[T1] <-M[A] + M[B] ADD T2, C, D ' M[T2] <- M[C] + M[D] MUL X, T1, T2 ' M[X] <- M[T1] * M[T2] Then a...
For NP completeness proofs/reductions, I need to establish that the problem is a "search problem"... However, the definitions seem to be somewhat vague. If the definition of the search problem is: Search problem is a problem which has the following input/output form: Given instance I (graph G), we are asked to find ...
TL;DR: There're lecture notes about a very simple reduction from "maximum flow with edge demands problem to the maximum flow problem. But I can't get the new capacities at the picture: E.g., look at the diagonal: 15 - 0 = 14 (?). From my point of view there're a lot of off-by-one errors.
I am preparing for my master thesis in Quantum Image Processing (QImP), i choose to work with Novel Enhanced Quantum Representation of Digital Images (NEQR). To convert an image from Classical domain to Quantum domain we need to do a Quantum Image Preparation which in case of NEQR is consists of two steps as shown in...
I'm trying to solve this exercise: given $L=\left\{a^kb^k|k>0\right\}$ determine $L^2$ and $L^3$. So I'm able to solve this kind of exercise if k is given into a defined range but I'm really struggling to solve this exercise. Any help? Thanks.
Given a sequence of ݊different elements, there is an algorithm that finds the maximum element, and the 2nd largest element, using n +log_2(n) - 2 comparisons. Prove that any algorithm will have to perform at least n +log_2(n) - 2 comparisons in order to find both elements. What I've done: I tried to compare it to a t...
I'm trying to prove that the amortized time complexity of appending to a dynamic array that resizes in accordance with capacity = $N$ to $N+\lceil{\frac{N}{4}}\rceil$ is $O(1)$. I'm assuming that resizing an array from $x$ to $y$ "costs" $y-x$ primitive operations. Here is my reasoning so far. Assume that an array is ...
Show that, for sufficiently large $n$, there is a function $f\colon\{0,1\}^n \to \{0,1\} $ that cannot be computed by a Boolean circuit with fan-in $2$ with $\frac{2^n}{2n}$ gates. Please give me a hint.
I thought that, for every CFG, there is an equivalent grammar in CNF. I was told this is false. Can someone explain to me why this is false and possibly provide a counter example?
I am thinking of explaining the topic of Network flow to an audience of computer sciecne students, and I want to make it more enjoyable by giving some real life examples where a software Developer may find Network Flow useful. I want to refrain from using standard problems like Baseball problem, marriage problem, edge ...
I'm working on a problem similar to topological sorting, but with an additional constraint: I want to order the nodes by assigning a positive integer index to each, and, in additional to the relative constraints the graph defines, some nodes have a predefined index assigned. That is, the input is a set of nodes $V$, a ...
I'm currently trying to prove that following NFA $\mathcal{M}_0 = (Q, \Sigma, \delta_0,0,\{0\})$ (see picture below) has an exponentially larger DFA $\mathcal{M}$ accepting the same language. $\mathcal{M} = (2^Q,\Sigma,\delta,\{0\},F)$ is constructed using the subset/powerset algorithm and I'd like to show that $\math...
Given a digraph with a source $s$ and target $t$, must there be an edge cut which contains exactly one edge in every path from $s$ to $t$? I'm not interested in a minimum cut; any cut would do. If not, how close to "exactly one" can we get?
The question is: We need to design a cache with cache size of 128K bytes, block (line) size of 8 words, and word size of 4 bytes. Consider a computer with 64-bit physical address. The cache is addressed by physical address I need clarification on this: if we have 128k bytes and each block equals 32 bytes (8*4), do we h...
According to the lecture note by Jeff Erickson, the lower bound for finding the third largest element of a set of $n$ distinct elements is open. See the related post: What is the lower bound for finding the third largest in a set of $n$ distinct elements? Given that the tight lower bound is still unknown, I want to kno...
I have to simplify A+C'+B'CD but I don't see how. I had to deduce the expression starting from a logic diagram in which two AND gates were used for the B'CD part. Seeing the diagram all I can think of is to use one AND gate instead of two, but I don't see how the actual boolean expression can be simplified.
I'm little confused with proving if this language is regular: $L=\{a^{n}b^{m}c^{{m}\choose{n}}\}$. What are $n,m$? Are they arbitrary? If yes, this language has only one word and I need to prove or refute that exists FA that accepts this word?
I have an example below which seems to lead to a “useless” production. This is the original grammar: \begin{align*} S&\longrightarrow aX\,|\,Yb\\ X&\longrightarrow S\,|\,\varepsilon\\ Y&\longrightarrow bY\,|\,b \end{align*} Here is the conversion to CNF: Step 1: Make sure the start symbol ...
I stumbled across the following question. Say I have given an arbitrary PDA $P$, NFA $N$, and CFG $G$. My question is then if the following language ($L(P) \cap L(N)) \cup L(G)$ is context-free. How can this be determined?
Aren't these two Modulus equations exactly the same (seems obvious): $ X = 0 \ (mod\ B) $ $ X = B \ (mod\ B) $ The reason for the query is the following NP Complete Problem from Garey and Jhonson: AN2, Simultaneous incongruences. Given a collection $ [(a_1,b_1),…,(a_n,b_n)]$ of ordered pairs of positive integers wi...
How to prove the statement "If the strings of a language $L$ can be enumerated in lexicographically(alphabetic) order, then the language is Recursive but not context free" ? Basically, My point is how can the strings of $a^nb^nc^n$ can be lexicographically enumerated as first $n$ has infinite terms .
All file systems I know make significant efforts to try and allocate files in contiguous blocs on a disk. But if the disk is an SSD using flash technology underneath, is there any benefit to contiguous allocation? The only benefit I can see is in file systems like ext4 which use extents, in which case contiguous alloc...
Some definitions: Consider the unweighted directed graph $G$, where each node is uniquely represented by an $n$-bit vector of $0$'s and $1$'s. Now consider this scenario: we want to 'shrink the dimension' of the index vectors for all nodes. For example, originally, some node has the index vector $\langle 0, 1, 1, 0 \...
How to encode a first order formula into binary string, which I could give as input to Turing machine or program to do something with it (deciding is it satisfiable, or is concrete structure model for it, for example)? I've read that I should first make a tree (which I know how to do) and then encode that tree, which ...
With reference to this PDF discussing Superdense coding, it is mentioned that there are two qubits A and B whose superposition gives the system $\frac{1}{\sqrt{2}}|00\rangle + \frac{1}{\sqrt{2}}|11\rangle$. It is said that Alice has A while Bob has B. What are the individual qubits A and B? Since the system is entangl...
Given a bipartite graph, I need to find for each node, If this node exists in all the possible maximum matchings of the given graph or not. Note that there can be multiple maximum matchings of a given bipartite graph with the same value of matching but different set of edges. What is an efficient way to do this?
Let's say I have an undirected graph with an edge $e = \{a,b\}$ connecting vertices $a$ and $b$. Taking vertex $a$, what is the name of the other vertex? Is it the "co-vertex"? Or simply the "other vertex"? Or the "neighbouring vertex"?
I was reading how to find the Lowest common ancestor in a DAG. A DAG can have scenarios where the LCA yields multiple solutions and I feel the accepted answer explains that pretty well. However, one of the answers also mentions a paper that talks about because of the given scenario above, for DAGs there may be cases wh...
A few weeks ago, I asked this question on the implementation of the shift operator for an architecture that implements boxing. Reviewing my implementation I found out that the division operator wasn't correctly done. My language should implement the construct L3IntDiv that implements floored division in contrast with t...
A deck of cards is 52. A hand is 5 cards from the 52 (cannot have a duplicate). What is the least amount of bits to represent a 5 card hand and how? A hand is NOT order dependent (KQ = QK). 64329 = 96432 Yes, can use 52 bits. That can represent a hand of any number of cards. Given a hand is exactly 5 cards is ther...
What is the Monodic Second Order formula that encodes all binary strings that represent a valid parenthesis matching ? By this I mean 1s represent '(' and 0s represent ')' and at every position, number of 1s in the prefix is greater than or equal to the number of 0s . Can someone tell me how to proceed ? Thanks!
In a recent IT class we got the task of creating a finite state automaton that accepts only the words "auto" "automarke" "tomaten" and "automaten" and no others. Basically the whole class had no problems finding a 17 state solution, except for the guy two seats next to me who is incredibly convinced that its possible i...
I need prove that any red-black tree with at least two elements obtained through the insertion algorithm has at least one red node. For this, I need use Induction. I don't understand how apply induction. (((
I've not been able to find a precise definition of "stack depth" anywhere and have a rather simple question. When dealing with trees I'm used to the maximum depth (or height) of the tree being the longest simple path between the root node and a leaf. For instance, if we had a longest simple path of length $n$, there wo...
Garey and Jhonson mentions that a 3-SAT Problem can be transformed to another NP-Complete Problem - Simultaneous incongruences (AN2): Given a collection $[(a_1,b_1),…,(a_n,b_n)]$ of ordered pairs of positive integers with $a_i≤b_i$ for $1≤i≤n$, is there an integer $x$ such that for all $i$, $x≢a_i(mod\ b_i)$? But I am...
I came across Paul Turner work on increasing efficiency of M:N threading model. I am not able to grasp the concept at slide 18 of LPC-User-Threading It says : for two threads A and B : Minimal scheduling operation. ● B inherits A’s virtual runtime. ● B was not runnable, so we don’t need to remove it from runqueues. ● B...
A tree is balanced if the subtrees of each node differ in height by at most one. How many balanced binary trees can we create from $n$ nodes?
According to source page 20, theorem 1.9, it states that there is a universal Turing machine that can simulate any Turing machine with a time overhead of $O(\log n)$. Can a universal Turing machine exists with less overhead? Can we prove that no such universal Turing machine exists? If not, can we at least prove a low...
At present, I am doing a project on Optical Character Recognition (OCR). I am looking forward to improve the results by checking the output words of my OCR code with existing words from a text file. The file contains all English words. Word is good to go if it exists in the file, but if it doesn't then I want to replac...
The Builder Pattern solves the problem of Telescoping Constructors; that is, having a single constructor for every possible parameter combination (including those combinations for which a parameter is omitted). So for example: public Food(int id, String name) { this(id, name, 0, 0, 0); } public Food(int id, ...
Fix an input and tape alphabet $\Sigma$ and $\Gamma$. Let P be a property of turing machines over these alphabets, i.e., a subset of $\{\langle M \rangle \mid M \text{ is a TM over the alphabets } \Sigma \text{ and } \Gamma\}$. Define COUNT_P to be the function $\mathbb{N} \to \mathbb{N}$ describing the number of $n$-s...
It's a question of a problem set. If I search for all possible cuts on a network graph and return the minimum, (so it will be equal to max flow), what will be the complexity of running this?
I am looking for an encoding algorithm that would have an encoding function with highly expensive computational costs (ideally like scrypt). At the same time its decoding function must be a lot easier to calculate. Computational costs should not depend on the size of the encoded data. The size of the encoded data can ...
This is a question that's been bugging me off and on for years, ever since I took a compiler theory class as an undergraduate. There, we learned how to convert a regular expression into a non-deterministic finite automaton, then convert that into a deterministic finite state machine, then minimize that state machine. ...
Let $x$ be an integer such that $x \in [ - 10,10]$ and $b$ a binary variable. Apply integer programming to express $b = 1 \leftrightarrow x \ge3$ My work: \begin{equation} \begin{cases} \text{if}\,\,\,\,\ b = 1, & \text{then}\,\,\,\,\,\,\ x \ge3 \\ \text{if}\,\,\,\,\ x \ge3, & \text{then}\,\,\,\,\,\,\ b...
The assignment problem is defined as: There are n people who need to be assigned to n jobs, one person per job. The cost that would accrue if the ith person is assigned to the jth job is a known quantity C[i,j] for each pair i, j = 1, 2, ..., n. The problem is to find an assignment with the minimum total cost. There is...
While reading the book theory of computation by Michael Sipser, I did not understand the language given below. I will explain the problem first $$L = \{1^n :n \in \mathbb{Z}\}$$ Where $\mathbb{Z}$ is a set of integers. Question :I am not able to understand the string that belong to the given set will look like. I k...
say, we add the option of allowing let expressions to context free grammars: let defines a variable that defines an expression from a specific Symbol of the grammar, and every instance of the variable has to be the exact same expression eg: T := (let ((z -> U) z + z) U := x | y | Const | U +U | U ∗U | T In the above ...
I have managed to describe a problem in quantum computing as the optimization of a function f(graph,vector), over graphs and real vectors. For a given graph, I can optimize the vector with standard methods (say, gradient descent), but the search over graphs has to be a brute force random search, because I don't know wh...
Assume we have 2 max heaps, each with n nodes. We want to merge these 2 heaps and build a min heap. What is the best way to do this? The easiest way is to consider 2 max heaps an array with $2n$ elements and build a min heap with $O(n)$ complexity. Is there an algorithm with a complexity better than $O(n)$ ?
I'm quite new to computability theory and would be interested in some examples of realistic programming tasks you could encounter when working as a C++ programmer that are not computable.
Given the following recursion, $$T(n)=T(\frac{n}{2})+ aT(\frac{n}{4})+n^2, $$ How can I find the minimal value for $a$ such that ${T(n)=ω(n^2)}$? I tried to do it by tree recursion but I did not succeed to prove it by this method.
If standard function composition is defined as: (define compose { (B → C) → (A → B) → (A → C) } F G -> (λ X (F (G X)))) What type of composition does the below function describe? Is there a particular name for it in category theory? (define compose-2 { (A → (X → C)) → (B → X) ...
I'd like to double-check my understanding of Big-Oh. The definition is that $f(n) = O(g(n))$ if $|f(x)| ≤ M\,|g(x)|$ for a natural number $M$ and for sufficiently large values of $x$. Now, if $g(n) = O(n^2) - O(n^2)$, may we conclude that $g(n) = 0$? If not, what can we say about $g(n)$?
In given: $${T(n)=4T(\frac{n-2}{2}) +n^2 }$$ How can i find ${O(T(n))}$ ?
I want to determine the time and space complexity of the following functions: subs [] = [[]] subs (x:xs) = subs xs ++ map (x:) (subs xs) subs' [] = [[]] subs' (x:xs) = yss ++ map (x:) yss where yss = subs xs The language I'm considering is using (outermost) graph-reduction (also known as call-by-need or call-by-name ...
After running dfs on a graph, we get a list of n post and pre numbers. How do we sort this list in $O(n)$ time instead of $O(n\log n)$ time?
I used networkx to find the diameter of a graph that I have. It gave a diameter of 4. However, I found that between two particular nodes, using networkx's shortest path function, the path length is 5. I also coded dijkstra's algorithm and BFS from scratch and both returned a shortest path length of 5 too. Is anything w...
I am trying to revise for my exams and going through my lecture slides and recordings, my lecturer didn't really give a clear example of why Regular languages are decidable. She mentioned that it was because Regular Languages can be represented in Finite Automata, and can be classified as a subset of regular languages...
Does anyone of you know how to associate an algorithm execution time (of experimental execution) to a well known complexity time? For example, say a divide and conquer algorithm lasts theoretically O(n·logn·n^2) or Ω(n·logn), in a theoretical way, doing reccurence ecuations and all that stuff. But when you plot the dat...
I want to prove that integer factorization is in NP I have a general idea of how to prove this, and was wondering if I could get a sanity check: I'll show it's in NP by using a non-deterministic TM whose longest computational branch runs in polynomial time. The TM will do the following: Given an input (binary) word w o...
Introduction to Algorithm,3rd 9.3 Selection in worst-case linear time I have a question about its proof. I have selected that sentence. I agree that the number of elements larger than x is $$ 3\times(\lceil\frac{1}{2}\times \lceil\frac{n}{5}\rceil \rceil -2) $$ but, I think the number of elements less than x ...
I have this large text file that when unzipped has about 2GB. I split this one into multiple(more than 5 million) files and now I have a folder of about 20GB, how is this possible?
This is a related question poker hand representation and I got a great accepted answer. The problem can be reduced to a virtual 39 card deck that from what I can tell is 16 bits. I have 5 numbers 1-39 with none repeating. I need to uniquely identity those 5 numbers with the smallest possible number and not order depend...
In the first step, I agree that divide n elements into groups take one pass so the time complexity is $$O(n)$$. But if we need to find the median of each 5 elements, we may have to sort them. I know the time complexity of sorting is $$O(nlogn)$$. How to find the median of 5 elements by rote and its time complexity ...
There are many problems that people can solve more easily than a machine learning algorithm. Often this is attributed to the extra context we have access to. Image segmentation is an example of a problem that people are good at, but algorithms are not good at, probably because people have lots of external contextual k...
Okay, so a graph $G = (V, E)$ is (fully) connected if and only if for every pair of vertices $u, v ∈V,$ $u$ and $v$ are connected in $G$. And that if the vertex set is $V = \{0, 1, . . . , n−1\}$, then we can represent a graph in a program as a two-dimensional n-by-n array $A$, where the entry $A[i][j]$ is set to $1$ i...
From a simulation I get 5 numbers 1-13. The nature of the simulation is that I do not get the numbers ordered. The value/rank of the the tuple is not order dependent 5 5 5 2 2 = 2 5 2 5 5. Values can repeat but they can repeat at most 4 times (it is a deck of cards). As it turn out there are 6175 combinations. Calc...
Is the follwing promise problem NP-hard? Input: A system of quadratic equations. Promise: The system has either one or zero solutions. Question: Does the system have a solution?
I have recently thought up the following proof that L=P implies P=NP. Suppose L=P. Let A be a problem in NP. By the verifier definition of NP, each positive solution to A has a witness that can be verified in polynomial time. Since P=L, the same solution can be verified in logarithmic space. Thus NP=NL. But then NL is...
I have to convert this fsa to regular expression but these are too different than i learned... Can you guys help with converting these? Plz!
I know that given a system of multivariate quadratic equations (i.e, of the form $x^T Ax+b^T x=c$), deciding if there's a solution is NP-hard. Is deciding if there's a solution to a single multivariate quadratic equation NP-hard too? I am intersted in the NP-hardness of deciding if there's a solution to a single quadra...
This feels like it would be a well researched (or solved) problem, but I can't find the right words to search for it. Suppose there is a collection of shared resources, and a collection of possible processes. Each process consumes fixed quantities of each resource and provides a fixed benefit. Each process can be appli...
Im trying to prove that $L=\{w\#s : |w|=|s|, w \neq s\} \notin CFL$ using the pumping lemma. So I said, let say $L \in CFL$ so by the pumping exists $p$ which is the pumping length of language $L$, I think $ s = 0^{m}1^{p}\#1^{m}0^{p} \in L$ would be a good word to start with, I can write $s = uvxyz$ and i want $uv^{...
Is there a difference between the set of quantum gates that are: "universal" in the sense that you could calculate anything in BQP with a polynomial number of gates, "universal" in the sense that you could approximate any arbitrary "gate" (unitary transformation) on a set of qubits? And if so, what is the proper term...
I want to prove that the following equation holds using structural induction on (finite) lists subs (map f xs) = map (map f) (subs xs) where subs [] = [[]] (subs.1) subs (x:xs) = subs (xs) ++ map (x:) (subs xs) (subs.2) map f [] = [] ...
I am trying to revise for an exam, I have encountered this question and have seen an example solution, but it was provided by my lecturer, and it was fairly sparse and somewhat incomplete. She jumps straight into a proof that has very little context, then ends it with "see Theorem 5.2" and that is why it is undecidable...
I was recently asked this problem in an algorithmic interview and failed to solve it. Given two values N and M, you have to count the number of permutations of length N (using numbers from 1 to N) such that the absolute difference between any number in the permutation and its position in the permutation is not equal t...
In short, if $x \neq u_i \in \{\pm1 \}^n$ then why is: $$ \langle x, u_i \rangle \leq n-2 $$ but not: $$ \langle x, u_i \rangle \leq n-1 $$ ? To add context: I was reading understanding machine learning from theory to algorithms and it had claim 20.1 section 20.3 on the section of the expressive power of Neural Networ...
In finding the connected components in a graph, why do we use DFS, instead of BFS?
We know $L^+=L^\star\backslash\{\epsilon\}$. How do we interpret that $\{\epsilon\}^+=\{\epsilon\}$?
I need your help with time complexity. I have this recursive function: $$ F(n) = \left\{ \begin{array}{l l} F(n-2) + 10 F\big(\frac{n}{6}\big)^2 + 6 F\big(\frac{n}{7}\big) + \frac{n^4}{5} & \text{if } n > 1\\ 2 & \text{otherwise}\\ \end{array} \right. $$ and I had to do the same thing using recursion in C#, so I came...