Questions tagged [computation]

Computation is paramount to the discipline of computer science, and deals with the type and use of computing technology in information processing, in particular, in the context of an algorithm, or a protocol.

From Wiki

In the theory of computation, a diversity of mathematical models of computers have been developed. Typical mathematical models of computers are the following:

  • State models including Turing machine, push-down automaton, finite state automaton, and PRAM
  • Functional models including lambda calculus
  • Logical models including logic programming
  • Concurrent models including actor model and process calculi
404 questions
29
votes
24 answers

When is theoretical computer science useful?

In class, we learned about the halting problem, Turing machines, reductions, etc. A lot of classmates are saying these are all abstract and useless concepts, and there's no real point in knowing them (i.e., you can forget them once the course is…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
27
votes
8 answers

Node.js vs C++ for mathematic

I have to write a server program that implements some fuzzy logic and I choose to write it in Node.js to take advantage of its event orientation. I have to work with difficult mathematic computational problem, and I don't know what's the best way to…
Pablosproject
  • 1,374
  • 3
  • 13
  • 33
17
votes
3 answers

Computation Constructs (Monads, Arrows, etc.)

I have become rather interested in how computation is modeled in Haskell. Several resources have described monads as "composable computation" and arrows as "abstract views of computation". I've never seen monoids, functors or applicative functors…
Doug Moore
  • 1,028
  • 2
  • 10
  • 20
15
votes
5 answers

Haskell: Computation "in a monad" -- meaning?

In reading about monads, I keep seeing phrases like "computations in the Xyz monad". What does it mean for a computation to be "in" a certain monad? I think I have a fair grasp on what monads are about: allowing computations to produce outputs that…
gwideman
  • 2,705
  • 1
  • 24
  • 43
14
votes
1 answer

For loop in c# vs For loop in python

I was writing a method that would calculate the value of e^x. The way I implemented this in python was as follows. import math def exp(x): return sum([ x**n/math.factorial(n) for n in range(0, 100) ]) This would return the…
Seeker
  • 270
  • 1
  • 7
11
votes
3 answers

Best practice for holding huge lists of data in Java

I'm writing a small system in Java in which i extract n-gram feature from text files and later need to perform Feature Selection process in order to select the most discriminators features. The Feature Extraction process for a single file return a…
10
votes
5 answers

Which java-library computes the cumulative standard normal distribution function?

For a project I have a specification with formulas, I have to implement. In these formulas a cumulative standard normal distribution function exists, that takes a float and outputs a probability. The function is symbolized by a Φ. Exists a…
Mnementh
  • 50,487
  • 48
  • 148
  • 202
9
votes
2 answers

How to resolve integer overflow errors in R estimation

I'm trying to estimate a model using speedglm in R. The dataset is large (~69.88 million rows and 38 columns). Multiplying the number of rows and columns results in ~2.7 billion which is outside the integer limit. I can't provide the data, but the…
James
  • 123
  • 1
  • 5
8
votes
1 answer

Find whether each character in 1 string is exist in another string, faster than O(n^2)

Given that 2 strings: String stringA = "WHATSUP"; String stringB = "HATS"; I want to find out whether each character in stringB H A T S exists in stringA In a junior approach, the process can be done within a nested for-loop which its computation…
Kone Man
  • 374
  • 1
  • 2
  • 8
7
votes
2 answers

Computing the approximate population of a bloom filter

Given a bloom filter of size N-bits and K hash functions, of which M-bits (where M <= N) of the filter are set. Is it possible to approximate the number of elements inserted into the bloom filter? Simple Example I've been mulling over the following…
Xander Tulip
  • 1,438
  • 2
  • 17
  • 32
7
votes
2 answers

Three questions about doing lots of calculations

This is just a series of questions regarding doing lots of computations. Either I couldn't find the answers online or I still need clarification. Is it faster to pass (float, float, float) as method parameters vs (float[]) where the array has three…
kexu
  • 304
  • 2
  • 8
7
votes
3 answers

language over {1} which is recognizable but not decidable?

What is an example of a language over the alphabet {1}* which is recognizable but not decidable? I have troubles finding an example of this. After a long search, I am still curious for the answer though. A hint would be very welcome.
user1870864
  • 181
  • 1
  • 7
7
votes
2 answers

Using TTR package to calculate Exponential moving average

Curious if anyone used it. I did a simple EMA operation on a time series. But wasn't able to reconcile very well. I read that the value of the update constant = 2/(N+1). I defined x = 1:20, and did EMA(x,5). Then I did an EMA computation using the…
ganesh reddy
  • 1,842
  • 7
  • 23
  • 38
6
votes
4 answers

Python: how so fast?

The period of the Mersenne Twister used in the module random is (I am told) 2**19937 - 1. As a binary number, that is 19937 '1's in a row (if I'm not mistaken). Python converts it to decimal pretty darned fast: $ python -m timeit…
telliott99
  • 7,762
  • 4
  • 26
  • 26
5
votes
3 answers

Kernel methods for large scale dataset

Kernel-based classifier usually requires O(n^3) training time because of the inner-product computation between two instances. To speed up the training, inner-product values can be pre-computed and stored in a two-dimensional array. However when the…
developer.cyrus
  • 903
  • 2
  • 7
  • 18
1
2 3
26 27