Questions tagged [computer-science]

All mathematical questions about computer science, including theoretical computer science, formal methods, verification, and artificial intelligence. For questions about Turing computability, please use the (computability) tag instead. For numerical analysis, use the (numerical-methods) tag. For questions from scientific computing, use (computational-mathematics).

Computer science is the study of the theory, experimentation, and engineering that form the basics for the design and use of computers. It is the scientific and practical approach to computation and its applications and the systematic study of the feasibility, structure, expression, and mechanization of the methodical procedures (or algorithms) that underlie the acquisition, representation, processing, storage, communication of, and access to information. An alternate, more succinct definition of computer science is the study of automating algorithmic processes that scale.

Some fields of computer science such as computational complexity theory (which explores the fundamental properties of computational and intractable problems) are highly abstract, while fields such as computer graphics emphasize real-world visual applications.

5523 questions
1
vote
2 answers

integer valued vector data type

What is the difference between integer valued and real valued vectors, in the mathematics and programming senses? For example, since certain binary operations on vectors, such as "angleBetween()" return a real, does that mean that the type of…
bootchk
  • 111
1
vote
0 answers

Remiander except 0

I know this is a simple question but I am thinking if there is a better way to do so. I want to calculate the value of a deck of cards. Every card is associated with a number, i.e. there are 1 to 52 cards. I would like to extract the value of a card…
Www
  • 176
  • 11
1
vote
0 answers

Primitive recursive function for $\left[\frac{x}{2}\right] = max\{z ∈ N0 \ | \ 2 · z ≤ x\} $

I need to find a primitive recursive function for $t(x) = \left[\frac{x}{2}\right] = max\{z \in \ N0 \ | \ 2 · z ≤ x\}$ Unfortunately whatever I come up with isn't primitive recursive. I have also tried "splitting" this but that didn't help me…
Wiers
  • 11
1
vote
1 answer

If $h(x)$ is the integer $n$ such that $n \leq (1+\sqrt{2})x < n+1$, show that $h$ is primitive recursive

I can solve this for $n \leq \sqrt{2}x < n +1$: $$n \leq \sqrt{2}x < n +1 \iff n^2 \leq 2x^2 < n^2 + 2n + 1$$ We're looking for $$h(x)=\min_{n\leq 2x} \big( 2x^2 - n^2 > 0 \lor 2x^2=n^2 \big)$$ But I don't know how to do it when I can't get rid of…
1
vote
1 answer

NP-Complete Problem

Consider the following NP problem called A: its input is a graph G and a number k > 1. Its witness, if there is one, is a pair $S;T$ of sets of points in $G$ such that S is an independent set of size $k$ and $T$ is a clique of size $k$. Show that…
Mike
  • 11
1
vote
3 answers

Find the missing term

The sequence $10000, 121, 100, 31, 24, n, 20$ represents a number $x$ with respect to different bases. What is the missing number, $n$? This is from my elementary computer aptitude paper. Is there any way to solve this quickly?
Quixotic
  • 22,431
1
vote
1 answer

Raytracing a parallelogram (ray parallelogram intersection)

How do you find the intersection of a ray and a parallelogram given the corner and three vertices of the parallelogram? Can we break this parallelogram into two triangles and perform ray triangle intersection instead?
1
vote
1 answer

Question about ambiguity of BNF

The BNF is defined as follows: -> aa | b This is my review question for a quiz, and according to my teacher, this grammar is ambiguous. However, I realized this grammar is not. For example, given a sentence: babababab There are…
roxrook
  • 12,081
1
vote
0 answers

What are the areas of mathematics in which a computer scientist must focus on?

I am studying mathematics and I am very interested in computer science but I want to know in what areas of mathematics must I focus on.
Lemark
  • 13
1
vote
0 answers

A Context free grammar question and how to approach it

I would like to know how to approach a problem like this please, like what steps to consider first? The question is as follows: what is the language over a,b defined by this CFG S ->AS S ->1A S ->1S A ->AA A ->0A1 A ->1A0 A ->e (blank) Please…
user413841
  • 21
  • 1
1
vote
1 answer

Round numbers in a set of limits

I'm trying to create a mathematical operation that help me to resolve this scenario. I have a list of "limits" as show below: 0---4---8---12... (n + 4) Suppose that we have a software that "read" a number, an it determines what is the previous…
manix
  • 155
1
vote
1 answer

How do I calculate scalar curvature?

How can I calculate the scalar curvature of an object? Maybe a tennis ball? I'm quite new to this stuff. And I have a problem understanding things I believe maybe complex... Like, when I looked up how can I calculate scalar curvature, one question…
1
vote
1 answer

How many distinct Boolean operators are there that take three inputs?

From what I know, boolean operators are the likes of AND, OR, XOR, NOT, NAND and NOR. So does this mean that there are actually 6 distinct boolean operators that can take three inputs?
1
vote
0 answers

What does the "£" symbol mean for the following equation?

In reference to Hamming Code: (n + 1) x 2^m £ 2^n (2^m is "2 to the power m") In context: a code with words consisting of m data bits and r check bits Each valid code word has n bits, and an error could occur in any of these n positions. Thus, each…
k050
  • 21
1
vote
1 answer

Does $\mathrm{Inf}=\{\langle M\rangle\mid L(M)= \infty\} \notin R$? My attempt for writing reduction

I'm trying to prove that $\mathrm{Inf}=\{\langle M\rangle\mid L(M)= \infty\} \notin R$ where $R$ is the group of all decidable languages. I'm trying to make a reduction from The acceptance problem $A_{TM}=\{\langle M,w\rangle\mid $ $M$ accepts $ …
Joni
  • 189