NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home / News / Webmaster / Tips and Tricks

Tips and Tricks


A Binomial Coefficient Calculator with JavaScript

Recursive calculation of factorial numbers

By Catalin Bocanu, Web News Editor

13th of May 2008, 15:54 GMT

Adjust text size:



Enlarge picture
The web based calculators are widely used due to the fact that they usually do not require the installation of a third party software in neither of the known operating systems. Calculators that come with client side programming languages as JavaScript imply the execution of the code on the client side and they require only a compatible web browser.



There are many free JavaScript calculators that perform almost any type of mathematical or statistical operations, like the value of factorial function for various integer numbers. A factorial number is defined as follows: n! = 1 x 2 x 3 x ... x (n-1) x n, where n is an integer.

In case you want to automate the calculation of binomial coefficient values with the help of JavaScript, an efficient algorithm must be chosen. The most common used algorithm in calculation of factorial value is recursion. In any recursion method a function is generated during an iteration. As a consequence, the factorial of n can be defined recursively like: n!=(n-1)! X n.

The binomial coefficient is defined as C(n,k)=n!/(k! X (n-k)!). The next JavaScript code will allow you to calculate the value of any binomial coefficient in case of integers:

CODE

function fact(n)
{ if (n

TAGS:

JavaScript Calculator | Calculator Tool | Binomial Coefficient | Statistical Calculations | Javascript Tutorial
Read by 3,859 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Good (3.8/5) 7 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2009 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


Graphs and Charts with FusionCharts

The Most Popular Free WYSIWYG Editors

Random Webpages

Free Download Jabber Clients Made With Javascript

Elegant Solutions for Online Stores

Automatic Text Translation with Javascript

Get A Free Flash Image Gallery

Selenium Tests

Jaxer AJAX Server

Methods To Promote Websites on Digg

User opinions:

No user comments yet.
Be the first to express your opinion using the form below!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM