Softpedia
 

NEWS CATEGORIES:



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

May 13th, 2008, 15:54 GMT · By Catalin Bocanu

A Binomial Coefficient Calculator with JavaScript

SHARE:

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:

TELL US WHAT YOU THINK:

7,059 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ 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

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM