# Tabulating and visualizing the expression 0.905*(0.1^n)/n!

I need help tabulating and visualizing the expression, 0.905*0.1^n)/n!, where n goes from 0 to 100.

I want to store all the values, and use those values to plot a histogram.

I have used NsolveValues[{(0.905*0.1^n)/n!}], but am having issues extracting the data and then using that data to draw a histogram. Please help? I am a beginner so help would be much appreciated!

• Welcome to the Mathematica Stack Exchange. Please write a short descriptive title and describe the problem you face in the post body itself. Include enough Mathematica code in copy-paste-able form so that respondents can replicate your problem. The word Dataset has specialized meaning in Mathematica. As a starting point, you can explore the Table command. You can edit your post by clicking on the Edit link under your post and format code using the { } icon once you are in the Edit window. Thanks.
– Syed
Mar 27, 2022 at 5:31
• NDSolveValue is a command for differential equations. What you have provided is not. Is it possible that you forgot to copy some terms in your expression?
– bmf
Mar 27, 2022 at 5:33
• Table command worked, thanks! would appreciate help in plotting the histogram. Mar 27, 2022 at 5:42
• You should look up Histogram
– bmf
Mar 27, 2022 at 5:43
• @NarenViswanathanNarenKumar and since I had a look at the data generated by the expression you gave -it's not an equation- I think you will find Chop very useful
– bmf
Mar 27, 2022 at 5:44

Clear["Global*"]

data = Table[{n, 0.905*0.1^n/n!}, {n, 0, 100}];


Looking at the first elements of the data list

data[[;; 4]]

(* {{0, 0.905}, {1, 0.0905}, {2, 0.004525}, {3, 0.000150833}} *)


There are several ways to plot the data or the function

ListLogPlot[data, Joined -> True]


ListLinePlot[data, ScalingFunctions -> "Log"]


LogPlot[0.905*0.1^n/n!, {n, 0, 100}]


Plot[0.905*0.1^n/n!, {n, 0, 100},
ScalingFunctions -> "Log"]


DiscretePlot[0.905*0.1^n/n!, {n, 0, 100},
ScalingFunctions -> "Log"]


• (+1) I like your creativity and imagination. You demonstrated many useful ways of presenting the data. Out of curiosity, why didn't you do the histogram?
– bmf
Mar 27, 2022 at 5:57
• @bmf - I didn't consider a histogram an appropriate way to reflect the data or the function. Mar 27, 2022 at 6:01
• Neither did I, but the author wanted that for some reason. That's why I asked. In any case, nicely done!!!
– bmf
Mar 27, 2022 at 6:02
• Thanks for all the help!! Mar 27, 2022 at 15:26

Check out the answer by @Bob Hanlon for various pictorial representations of the data generated by your expression. Make sure to upvote it as well!!!

Below I am showing you a histogram.

data = Table[(0.9050 .1^n)/n!, {n, 0, 100}] // Chop[#, 10^-5] &;


The above generates data from the expression given and Chops numbers that are $$10^{-5}$$.

data

{0.905, 0.0905, 0.004525, 0.000150833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
In order to get a Histogram
Histogram[data]
`