Are symbolic computation and functional programming related? [closed] - functional-programming

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I was wondering if symbolic computation in Computer Algebra System (such as symbolic toolbox in Matlab, Mathematica) and functional programming related and how? Does the former belong to the latter?
Thanks and regards!

They're different beasts. However, one point of overlap is term-rewriting languages such as pure ( http://code.google.com/p/pure-lang/ ). Pure can be used as a purely functional programming language. However, since it is implemented by term rewriting rather than graph reduction, its expressions are always able to be pattern-matched into their bits and transformed. This sort of symbolic manipulation is one of the key features of computer algebra systems. That said, a great deal of the power of computer algebra systems comes from having lots and lots of math baked in, and especially having powerful algorithms baked in for solving various tricky problems. You could write libraries to do that in functional languages (and algebraic data types would make it more pleasant than in imperative ones), but you'd still need to write those libraries.

These two concepts are not necessarily related. However, you might find interesting the fact that the Lisp programming language designed by John McCarthy in 1958 was influenced by the lambda calculus. Also that year, McCarthy published An Algebraic Language for the Manipulation of Symbolic Expressions where a very simple symbolic differentiation program was presented (see Appendix I). Therefore, you can see that the two concepts were very close at the beginning.

Related

Mathematical notation or Pseudocode? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
At this moment I am concerned about which is the best way to explain an algorithm intuitively.
I have try to read some pseudocode an wow it may be complex for some cases (specially for math applications even more than the formulas itself or pure code like in PHP, C++ or Py). I have thought how about describe algorithms from mathematical notation in a way such that a mathematician could understand it and a web developer too.
Do you think it is a good idea ? (IF all the grammars and structure, symbols and modelings of it will be well explained and it is compact)
Example:
Binary Search
It even could help to simplify algorithm complexity if a mathematical analysis is done (I think)
Depends on the algorithm. For me, I know I would have never gotten the concept of trees if I didn't get a visual drawing. Also the concept of nodes, while a drawing is good, actually seeing the data structure written down is better for that case.
It's student to student basis. I personally see that example of the Binary Search as the worst type of example but am sure some math individual would maybe understand that better.

Exactly what type of programming language is R? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Like for example, python is fundamentally an object oriented language, i.e. everything including it's fundamental data types are objects. It supports all OO concepts like encapsulation, inheritance etc. Then on top of it has emulated procedural constructs and half-baked functional programming constructs like higher order functionals.
C is fundamentally a portable assembly language that allow abstract notions of targeting and manipulating memory using it's pointer language.
Wolfram language is fundamentally a term rewriter where it's fundamental data structure is expression with head and parts. It uses full pattern matching language like regex to define rules for it's expressions and uses infinite evaluation until its expressions stops changing, i.e. a fixed point is reached. Its general term rewrite allow it to emulate full procedural and functional language.
Now my question is what exactly is R language at a fundamental level? Does it have a fundamental representation of it's data types and everything? What is it's primary programming paradigm and what other paradigm it is just emulating? What programming constructs are completely available and what are half-baked?

Explain how the functional programming model differs from the procedural or object orientated models [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can anyone explain how the functional programming model differs from the procedural or object orientated models.
I cannot conclude a good answer myself.
in my opinion FP is about pure functions (that is functions in a mathematical sense) - which implies referential transparency and, if you continue the thouhgt, immutable data.
This is the biggest difference I see: you don't mutate data - and most other aspects either directly follow from this or from cool type-systems (which are not necessary for a language to be called functional) and the academic nature.
But of course there is far more to it and you can read papers, complete books or just wikipedia about it.
please note that you can dispute the pure property and then things get a lot more fuzzy ... which should not surprise you, as most functional languages in wide to allow for mutation (Clojure, Scala, F#, Ocaml, ...) and there are not many pure ones.
In this case the biggest difference might be the way you abstract things with higher-order-functions (at least functions should be first class citizens - meaning you can pass them around and have them as values).
But overall this question is really opinionated and will very likely be closed as to broad or something - maybe you should ask for details instead of the big picture

From an application programmer's perspective - Can Functional Programming be used to program Quantum Computers? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm not an expert in Functional Programming (FP). In fact, I just started learning it.
So, here is the real question: Since, FP is derived from Mathematics and not from von. Neumann machine, can this programming style/paradigm be used to program Quantum Computers? This is more from an application programmer's perspective since low-level machine instructions may be completely different.
No. Functional programs still perform classical computation. The functional style as we currently define it has nothing resembling superposition, quantum mechanical gates, or interference. While it is possible to transport the general idea of higher-order and first-class functions into the realm of quantum computation (and people are researching that right now), just as there are quantum Turing machines, as far as I can tell the results are as different from classical functional programming as quantum algorithms are from classical algorithms. For example, in QML if ... then ... else ... is removed in favor of a similar conditional where the condition is a qbit and the result is a superposition of the then and else values.
Now, of course quantum computers are Turing-complete and could, in theory, execute any classical algorithm. But why on earth would you do that? We already have classical computers, and they are (and will always be) much more efficient at executing classical computations. The only reason to program a quantum computer is to make it run an algorithm that exploits in a nontrivial way the weirdness of quantum effects. To even express that, one needs a very different language regardless of the level of abstraction at which you work.

Coming to Ocaml from Ruby, Lisp, Haskell, and Erlang [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I've been reading about Ocaml's consistent speed, rapid prototyping ability, and excellent memory management, and decided to take it up.
As I've already got Ruby, *lisp, Haskell, and Erlang under my belt, I'm interested specifically in what KISS-violating features I should look out for in Ocaml.
If you've started Ocaml with a background in the above languages, what was the most frustrating thing to grok? How did you get around this difficulty? What analogies helped you get into the flow of the language?
I'd also be interested in knowing whether you have done more than simply learn Ocaml, and have actually converted to it for a large percentage of your coding problems.
I found an excellent resource on Ocaml and its relation to most other languages: http://www.soton.ac.uk/~fangohr/software/ocamltutorial/lecture1.html
Not only does it explain the why, it also explains many of the little quirks likely to snag you as you begin.
Ah, I found a cheatsheet highlighting almost all of its syntactic weirdnesses.
I have heard the APress Practical OCaml is awful as well.
Introduction to Objective Caml is excellent and specifically addresses a few anti-KISS gotchas, such as ways the type-system can be unforgiving.
Coming to OCaml from a C++ background, I found replacing classes with variant types to be the hardest transition (and it was easy!).
There is a book about Ocaml "Practical Ocaml" it's not a really good book, but at least for getting started it's good enough. It's a quite practical language, which unfortunatly a "strange" syntax. If you like to see some "real" Ocaml then just look at the Shootout pages.
Regards
Friedrich

Resources