What is Functional: Definition and 414 Discussions

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.
In functional programming, functions are treated as first-class citizens, meaning that they can be bound to names (including local identifiers), passed as arguments, and returned from other functions, just as any other data type can. This allows programs to be written in a declarative and composable style, where small functions are combined in a modular manner.
Functional programming is sometimes treated as synonymous with purely functional programming, a subset of functional programming which treats all functions as deterministic mathematical functions, or pure functions. When a pure function is called with some given arguments, it will always return the same result, and cannot be affected by any mutable state or other side effects. This is in contrast with impure procedures, common in imperative programming, which can have side effects (such as modifying the program's state or taking input from a user). Proponents of purely functional programming claim that by restricting side effects, programs can have fewer bugs, be easier to debug and test, and be more suited to formal verification.Functional programming has its roots in academia, evolving from the lambda calculus, a formal system of computation based only on functions. Functional programming has historically been less popular than imperative programming, but many functional languages are seeing use today in industry and education, including Common Lisp, Scheme, Clojure, Wolfram Language, Racket, Erlang, Elixir, OCaml, Haskell, and F#. Functional programming is also key to some languages that have found success in specific domains, like JavaScript in the Web, R in statistics, J, K and Q in financial analysis, and XQuery/XSLT for XML. Domain-specific declarative languages like SQL and Lex/Yacc use some elements of functional programming, such as not allowing mutable values. In addition, many other programming languages support programming in a functional style or have implemented features from functional programming, such as C++11, Kotlin, Perl, PHP, Python, Go, Rust, Raku, Scala, and Java (since Java 8).

View More On Wikipedia.org
  1. M

    Is this the correct way to find the Euler equation (strong form)?

    By the Euler's equation of the functional, we have ## J(\mathrm u)=\int ((\mathrm{u})^{2}+e^{\mathrm{u}}) \, dx ##. Then ## J(\mathrm{u}+\epsilon\eta)=\int ((\mathrm{u}'+\epsilon\eta')^{2}+e^{\mathrm{u}+\epsilon\eta}) \, dx=\int...
  2. C

    Help Needed Proving Implication for Linear Functional on Banach Space

    Dear everybody, I am having some trouble proving the implication (or the forward direction.) Here is my work: Suppose that we have an arbitrary linear functional ##l## on a Banach Space ##B## is continuous. Since ##l## is continuous linear functional on B, in other words, we want show that...
  3. P

    Biology Which organs/parts of the body are only functional on glucose?

    Hi everyone! Do you have an idea which organs/parts of the body are ONLY functional on glucose? I would say the brain, pancreas, liver and kidney, but I have to take into account only those organs that are ONLY functional on glucose
  4. M

    How to find the Gateaux differential of this functional?

    I am not sure if this is correct, but here is my work by using the definition of the Gateaux differential: \begin{align*} &dS(y; \psi)=\lim_{\tau\rightarrow 0}\frac{S(y+\tau\psi)-S(y)}{\tau}=\frac{d}{d\tau}S(y+\tau\psi)\biggr\rvert_{\tau=0}\\...
  5. Y

    Functional representation of the oscillating graph

    Hi; This is in fact not a homework question, but it rather comes out of personal curiosity. If you look at the graph of the two functions in the image attached, what is the simplest functional representation for such a symmetrical pattern?
  6. Euge

    POTW Minimizers of an Energy Functional

    Let ##U## be a bounded open subset of ##\mathbb{R}^n##. Given a continuous function ##\phi : \overline{U} \to \mathbb{R}##, show that any real-valued function ##u## of class ##C^2(\overline{U})## such that ##\Delta u = \phi## in ##U## and ##u|_{\partial U} = 0## is a minimizer of the energy...
  7. MexChemE

    Analysis Study plan for Functional Analysis - Recommendations and critique

    Hello, PF! It’s been a while since I last posted. I am looking for a critique and recommendations regarding my study plan towards Functional Analysis and applications (convex optimization, optimal control), but first, some background: - This plan is in preparation for my master’s thesis, I...
  8. M

    A Sampling Electrons from a 2D Projection: Is There a Functional Form?

    Hello! I have some electrons produced from a 3D gaussian source isotropically inside a uniform electric field. The electric field guides them towards a position sensitive detector and I end up with an image like the one below (with more electrons on the edge and fewer as you move towards the...
  9. P

    I Definition of functional derivative

    In the book Quantum Field Theory for the Gifted Amateur, they define the functional derivative as: $$ \frac{\delta F}{\delta f(x))} = \lim_{\epsilon\to 0} \frac{F[f(x') + \delta(x'-x)) ] - F[ f(x') ]}{\epsilon} $$ Why do they use the delta function and not some other arbitrary function?
  10. chopnhack

    Comp Sci Functional Dependency Solving Algorithm for Minimal Cover

    Step 1: Reduce RHS into singletons F = {AB->C, C->A, BC->D, ACD->B, D->E, D->G, BE->C, CG->B, CG->D, CE->G} Step 2: Reduce LHS redundant attributes ACD->B has closure of A: A, C: C,A and D: D,E,G since A is in the closure of C we can remove A from ACD->B making it CD->B no other LHS could be...
  11. M

    MHB Functional dependencies

    Hey! 😊 Given the relational scheme $R = (A, B, C, D)$ with the set of functional dependencies $F =\{AB \rightarrow C, \ BC \rightarrow D, \ CD \rightarrow A, \ AD \rightarrow B\}$. 1. Give all non-trivial dependencies that can be derived from F. Justify your derived dependencies. 2. What are...
  12. G

    Functional Analysis exchange year at Imperial

    Hey, I would like to do an exchange year at Imperial. I would like to follow as a physicist the Functional Analysis course. However, I have not heard the best things about this peculiar course. What is the audience opinion on that?
  13. T

    Medical Limb Regeneration and Functional Recovery in adult Xenopus laevis

    Amputated hind legs were sucessfully regrown and functional in adult frogs. "Here, we demonstrate long-term (18 months) regrowth, marked tissue repatterning, and functional restoration of an amputated X. laevis hindlimb following a 24-hour exposure to a multidrug, pro-regenerative treatment...
  14. anemone

    MHB Find Sum of Solutions to Functional Equation

    Given that $(x+1)f(x^2+7x+10)+\left(\dfrac{1-x}{4x}\right)f(x^2+11x+24)=\dfrac{100(x^2+4)}{x}$, find $f(2)+f(3)+\cdots+f(400)$.
  15. J

    Doubt regarding functional derivative for the Thomas Fermi kinetic energy

    I have some doubts with respect on how the functional derivative for the kinetic energy in density functional theory is obtained. I have been looking at this article in wikipedia: https://en.wikipedia.org/wiki/Functional_derivative In particular, I'm interested in how to get the...
  16. JD_PM

    Deriving Feynman rules out of a generating functional

    To approach the problem I first studied section 1.3 and, more importantly, 1.4 of Osborn's notes. We first need to compute ##\partial_j \omega_i (x)## and ##\omega_i (x)\omega_i (x)## \begin{equation*} \partial_j \omega_i (x) = \delta_{ij} + \underbrace{\partial_j (g_{ilm})}_{=0}x_l x_m +...
  17. anemone

    MHB Solve Functional Equation on $\mathbb{Z}$

    Let $ \mathbb{Z} $ be the set of integers. Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z} $ such that, for all integers $a$ and $b$, $f(2a)+2f(b)=f(f(a+b))$.
  18. LCSphysicist

    Solve this functional equation

    $$f(xf(y) + f(x)) + f(y^2) = f(x) + yf(x + y)$$ A tricky question, i think. First fact i found was: f(f(0)) = 0 So i separate it in two types of functions f(0) = 0 and f(0) = u. I was trying to analyzing both cases, with the cases where x = y and x = -y but is is rather extended way, so i...
  19. LCSphysicist

    I Square of a differentiable functional

    I will consider first the case of ## \left [ J \right ] = \int f(x,y,y') ##, if it is right believe is easy to generalize... $$ \Delta J $$ $$\int (f(x,y+h,y'+h'))^2 - (f(x,y,y'))^2 $$ $$\int \sim [f(x,y,y') + f_{y}(x,y,y')h + f_{y'}(x,y,y')h']^2 - [f(x,y,y')]^2$$ to first order: $$\int \sim...
  20. LCSphysicist

    Changing functional variables

    Be ##x = x(u,v) y = y(u,v)##, if ##F = \int f(x,y,y')dx## and the Jacobian's determinant different of zero, ##v = v(u)## ##{\Large {J = \int F[x,y,y']dx ---> \int F[x(u,v),y(u,v),\frac{y_{u} + y_{v}v'}{x_{u} + x_{v}v'}](x_{u} + x_{v}v')du}}## The last term in the bracket is confusing me, how to...
  21. dRic2

    I Minimize grand potential functional for density matrix

    I'd like to show that, by minimizing this functional $$\Omega[\hat \rho] = \text{Tr} \hat \rho \left[ \hat H - \mu \hat N + \frac 1 {\beta} \log \hat \rho \right]$$ I get the well known expression $$\Omega[\hat \rho_0] = - \frac 1 {\beta} \log \text{Tr} e^{-\beta (\hat H - \mu \hat N )}$$ I'm...
  22. Mr Green T

    Can machine learning design living organisms?

    Pop culture interpretation: Machine learning reveals recipe for building artificial proteins Actual Study: Evolution-based design of chorismate mutase enzymes Using Boltzmann machine learning to design enzymes with evolutionary compatible statistical constraints is possible now. How much...
  23. Yellotherephysics

    A Functional Determinant of a system of differential operators?

    So in particular, how could the determinant of some general "operator" like $$ \begin{pmatrix} f(x) & \frac{d}{dx} \\ \frac{d}{dx} & g(x) \end{pmatrix} $$ with appropriate boundary conditions (especially fixed BC), be computed? And assuming that it diverges, would it be valid in a stationary...
  24. caffeinemachine

    MHB Is $f(x) = xf(1)$ the only solution to the given functional equation?

    Let $f:\mathbb R\to \mathbb R$ be a function satisfying $f(x+y+2xy) = f(x)+f(y) + 2f(xy)$ for all $x, y\in\mathbb R$. Then I need to show that $f(2017 x) = 2017 f(x)$ for all $x\in \mathbb R$. I am not sure where to start. All I could note is that $f(0)=0$ which one obtains by susbtituing...
  25. U

    I Proof involving functional graphs and the injective property

    Definition: Let ##G## be a graph. ##G## is a functional graph if and only if ##(x_1,y_1) \in G## and ##(x_1,y_2) \in G## implies ##y_1=y_2##. Problem statement, as written: Let ##G## be a functional graph. Prove that ##G## is injective if and only if for arbitrary graphs ##J## and ##H##, ##G...
  26. D

    Solution of the f_1(x)-f_1(x-pi)=f_2(x) functional equation

    Laplace transform of eq. [1] [4] F1(p)-exp{-pi*p}*F1(p) = F2(p) Rearranging eq. [4] [5] F1(p) = frac{1}{1-exp{-pi*p}}*F2(p) Inverse LT of eq. [5]
  27. U

    I Proof involving functional graphs and the injective property

    My only qualm is that the statement “Let G be a functional graph” never came into play in my proof, although I believe it to be otherwise consistent. Can someone take a look and let me know if I missed something, please? Or is there another reason to include that piece of information?
  28. filip97

    Sincov's functional equation

    I read Aczel book "Lectures of functional equations an their applications". On page 223. (Sincov's equation) is equation : ##F(x,y)+F(y,z)=F(x,z)## and general solution of this ##F(x,y)=g(x)−g(y)## , but how I prove that this function satisfies conditions ##F(x,y)=F(0,y−x)## ??
  29. Arman777

    I Taking the partial time derivative of a functional

    Let us suppose we have a functional of f such that ##f=f((\vec{r}(t),t)## where ##\vec{r}(t) = a(t)\vec{x}(t)##. I am trying to derive an equation such that $$\left.\frac{\partial}{\partial t}\right|_r = \left.\frac{\partial }{\partial t}\right|_x + \left.\frac{\partial \vec{x}}{\partial...
  30. P

    A Calculating Functional Derivatives: -1≤xₒ≤1 vs -1<xₒ<1

    ##\frac {\delta I[f]} {\delta f(x_o)} = \int_a ^b \delta(x-x_o) \, dx## with a=-1 and b=+1 ## -1 \leq x_o \leq +1 ## vs ## -1 \lt x_o \lt +1 ##, 0 otherwise. Which is correct and does it matter when doing integration by parts?
  31. T

    I Functional equations as global formulas

    In page 9 it says: "It is interesting to note that Riemann does not speak of the “analytic continuation” of the function beyond the halfplane Re s > 1, but speaks rather of finding a formula for it which “remains valid for all s.” [...]. The view of analytic continuation in terms of chains of...
  32. G

    Calculus What is the best book for learning functional calculus for physicists?

    Hi, I'm looking for a book that explains more deeply (and a little bit more formal) the functional calculus than the typical introductions that I find in QFT books (like Peskin or Hatfield). Is there any good book for physicists to learn the mathematics behind functional calculus? Thanks
  33. The black vegetable

    I Functional Derivatives: Overview & Tips

    Hi In the last sentence I mean you do include constant terms like I have done when taking the product above?
  34. T

    A Stuck on evaluating this functional determinant

    I am trying to show that given the following stochastic differential equation: ##\dot{x} = W(x(\tau))+\eta(\tau),## we have ##det|\frac{d\eta(\tau)}{dx(\tau')}| = exp^{\int_{0}^{T}d\tau \,Tr \ln([\frac{d}{d\tau}-W'(x(\tau))]\delta (\tau - \tau'))} = exp^{\frac{1}{2}\int_{0}^{T}d\tau...
  35. M

    What is the name of the C=N+=C functional group?

    I know R4N+ is a quaternary ammonium, R2C=N+R2 is an iminium, and R-C≡N+-R is a nitrilium, but what is an R2C=N+=CR2 cation called?
  36. binbagsss

    A QHE ' the effective action should be a local functional'

    ' Finally, if we care only about long distances, the effective action should be a local functional, meaning that we can write is as ##S_{eff}[A]=\int d^d x...## ' Where does this come from and what does it mean? This isn't at all familiar with me, and I don't recall ever seeing anything...
  37. Q

    A Functional Derivatives in Q.F.T.

    I'm can't seem to figure out how to functionally differentiate a functional such as Z(J)= e^{\frac{i}{2} \int \mathrm{d}^4y \int \mathrm{d}^4x J(y) G_F (x-y) J(x)} with respect to J(x) . I know the answer is \frac{\delta Z(J)}{\delta J(x)}= -i \int \mathrm{d}^4y J(y) G(x-y) but I'm struggling...
  38. Calculuser

    I Question: What book would you recommend for reading about mathematical logic?

    While I was studying Propositional Calculus from Elliott Mendelson's "Introduction to Mathematical Logic," I came across, on page 18, the proof of functional completeness of \neg, \wedge, \lor logical connectives as shown below: The part that does not make sense to me starts from "Then C_{k}...
  39. M

    A What do the notations in functional analysis mean for a given function?

    Hi PF! Can someone help me understand the notation here (I've looked everywhere but can't find it): given a function ##f:G\to \mathbb R## I'd like to know what ##C(G),C(\bar G),L_2(G),W_2^1(G),\dot W_1^2(G)##. I think ##C(G)## implies ##f## is continuous on ##G## and that ##C(\bar G)## implies...
  40. J

    A Lattice parameter difference: PBE vs PBE-D3 functional

    Hi guys! Does anyone know why the lattice parameters of a crystal calculated with PBE-D3 functional are lower than those calculated with PBE? Thanks in advance! :)
  41. chmodfree

    I Generalized Momentum is a linear functional of Velocity?

    Generalized momentum is covariant while velocity is contravariant in coordinate transformation on configuration space, thus they are defined in the tangent bundle and cotangent bundle respectively. Question: Is that means the momentum is a linear functional of velocity? If so, the way to...
  42. M

    MHB Logarithm properties in functional equations Show that f(1/a) = -f(a)

    Suppose that we have a function f(x) such that f(ab) = f(a)+f(b) for all rational numbers a and b. (a) Show that f(1) = 0. (b) Show that f(1/a) = -f(a). (c) Show that f(a/b) = f(a) - f(b). (d) Show that f(an) = nf(a) for every positive integer a. For (a), if ab = 1 then a = 1/b and b = 1/a. Not...
  43. binbagsss

    QFT - Generating Functional

    Homework Statement Hi I am looking at the attached question part c) Homework Equations belowThe Attempt at a Solution so if i take ##\frac{\partial^{(n-1)}}{\partial_{(n-1)}} ## of (2) it is clear I can get the ##\frac{i}{h} (\lambda_2 +\lambda_4 )## like-term, but I am unsure about...
  44. binbagsss

    Quantum field theory and generating functional

    Homework Statement Hi, I am looking at the attached question, parts a) and b).Homework Equations The Attempt at a Solution so for part a) it vanishes because in the ##lim \epsilon \to 0 ## we have a complete derivative: ## \int d\phi \frac{d}{d\phi} (Z[J]) ## for part b) we attain part a)...
  45. MermaidWonders

    MHB Thioester Isomer Count: ${C}_{4}{H}_{8}OS$ - 4 Possibilities

    How many isomers are there with the following description? - Thioesters with the formula ${C}_{4}{H}_{8}OS$? I was able to draw 2 of them, but apparently, the answer key showed and stated that there are 4. I am confused about why the following two are possibliities: I thought that thioesters...
  46. C

    Analysis Rudin Functional vs Conway Functional

    I can’t decide which of these two books I should start reading. They are structured very differently so it’s hard to compare them before reading them. Can anyone fill me in on there experience with these books or maybe what things one has that the other doesn’t.
  47. fsonnichsen

    I Determining functional relation of two dependant variables

    I have a pair of correlated datasets that I collected in the lab for temperature and conductivity of a solution vs time. I want to determine the functional relation between the two. (see attached plot-an interesting lead/lag in the phase difference). If I were trying to determine this...
  48. Physiona

    Functional Graphical Equation

    Shown below is the graph of The graph interests the axis at 3 points, B, C and D. Given the points of intersection, and the brackets below, form and expand an equation for the graph of ATTEMPT: I've assumed to involve the points of intersection for the x-axis...
  49. C

    Proving Snell's law using Euler-Lagrange equations

    Homework Statement Prove that snell's law ## {n_1}*{sin(\theta_1)} ={n_2}*{sin(\theta_2)} ## is derived from using euler-lagrange equations for the time functionals that describe the light's propagation, As described in the picture below. Given data: the light travels in two mediums , one is...
  50. H

    I Correct notation for some functional expressions

    Having some trouble determining the most mathematically correct way to express something I understand only numerically and physically. Basically I am modeling radiation within a volume. 1. For each point dV within a volume V there is a scalar value e(dV), which is an amount of radiation emitted...
Back
Top