Results 1 to 2 of 2

Math Help - Mathematica - Slot (#n)

  1. #1
    Newbie
    Joined
    Oct 2008
    Posts
    5

    Mathematica - Slot (#n)

    I am trying to more easily display a plot of four functions by using slot but I am having trouble getting it to work:

    Plot[PDF[FRatioDistribution[#1, #2], x] &[{1, 10}, {1, 10}], {x, 0, 3}, PlotStyle -> {Red, Green, Blue, Yellow}]

    Basically, I want a plot of four F-distributions with parameters (1,1), (1,10), (10,1), (10,10)

    I almost had it working with another distribution (it works except for the coloring):

    Plot[(E^(-(Sqrt[(2 k)/#1] - #3)^2/(2*(#2)^2)) + E^(-(-Sqrt[((2 k)/#1)] - #3)^2/(2*(#2)^2)))/(2*#2*Sqrt[\[Pi]*#1*k]) &[1, 2, {0, 1, 2}], {k, 0, 4}, PlotRange -> {0, 0.3}, Filling -> Axis, PlotStyle -> {Red, Green, Blue}]

    Oddly, if I evaluate this on separate lines the coloring works correctly:

    (E^(-(Sqrt[(2 k)/#1] - #3)^2/(2*(#2)^2)) + E^(-(-Sqrt[((2 k)/#1)] - #3)^2/(2*(#2)^2)))/(2*#2*Sqrt[\[Pi]*#1*k]) &[1, 2, {0, 1, 2}]

    Plot[%, {k, 0, 4}, PlotRange -> {0, 0.3}, Filling -> Axis, PlotStyle -> {Red, Green, Blue}]

    Any help would be greatly appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Oct 2008
    Posts
    5

    Simpler Question

    Maybe I should attack this question in stages. Does anyone know why this works as I would expect:

    #1 + #2 &[1, {1, 2}]
    ={2, 3}

    but this does not:

    #1 + #2 &[{1, 2}, {1, 2}]
    ={2, 4}

    I would like it to give {2, 3, 4}. I know this can be done with table, but I am trying to learn how to use the power of Slot. Thanks.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: May 2nd 2010, 01:10 PM
  2. Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 24th 2010, 07:13 AM
  3. Mathematica Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 5th 2010, 07:12 AM
  4. 3 Reel slot odds!
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: March 3rd 2010, 04:52 AM
  5. Replies: 2
    Last Post: November 26th 2008, 05:17 PM

Search Tags


/mathhelpforum @mathhelpforum