Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speaking computer science in mathematicalese

I am in the process of writing a fairly long monograph on a computer science topic. However, I usually find myself in a position of having to write some computer science concept in mathematical terms, and it is difficult to me. For instance, say I want to write a for-loop or a void function. I do most of the time go to my Knuth or Cormen or Sedgewick, but they are not enough now. Is there a "manual" or some text I can take as example to translate computer science into mathematics?

Edit

Let me be more specific (thanks, Uri). What I mean is: For example, I have a function that is void, and it returns a random string of length n. This caused my curiosity, I don't even know how to represent void function in in math... but again, this is just an example.

like image 709
Dervin Thunk Avatar asked Jul 29 '10 01:07

Dervin Thunk


People also ask

How computer science is related to mathematics?

Math matters for computer science because it teaches students how to use abstract language, work with algorithms, self-analyze their computational thinking, and accurately modeling real-world solutions.

What type of math is used in computer science?

Discrete mathematics, linear algebra, number theory, and graph theory are the math courses most relevant to the computer science profession. Different corners of the profession, from machine learning to software engineering, use these types of mathematics.

How is computer programming used in mathematics?

It focuses on graphs and equations and the ability to solve equations for unknown variables. Algebra is used in computer programming to develop algorithms and software for working with math functions. It is also involved in design programs for numerical programs.


1 Answers

Summation or product notation can probably replace some for-loops. Others can probably be expressed as logical quantifiers ("There exists i such that a[i] has some property" or "a[i] has some property for all i"). (Sorry I don't know how to render these in Markdown...hope you get the idea.)

"Void functions"...hmmm, maybe some convenient logical notation to state preconditions and postconditions, since such functions are only useful for their side effects?

But I think most mathematicians will be familiar enough with descriptions of algorithms to understand any halfway reasonable pseudocode convention. Just try to stay away from anything that requires a "language-lawyer" skill level in some particular programming language.

like image 191
Jim Lewis Avatar answered Oct 03 '22 06:10

Jim Lewis