Socket
Book a DemoInstallSign in
Socket

math_probability

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math_probability

1.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

MathProbability

Build Status Coverage Status Code Climate

Quickly find factorals, summations, permutations, combanations and probability answers

Installation

Add this line to your application's Gemfile:

gem 'math_probability'

And then execute:

$ bundle

Or install it yourself as:

$ gem install math_probability

Usage

General Usage:

5.factoral
=> 120
prob = MathProbability::Probability

Sigma(Summation) | Usage: sigma(start, end, formula)

prob.sigma(1,4,"4*x-3")
=> 28

Permutation without repeating | Usage permutation_no_repeat(objects, at_a_time)

prob.permutations_no_repeat(8,5)
=> 6720

Permutation with repeating | Usage permutation_no_repeat(objects, at_a_time)

prob.permutations_with_repeat(8,5)
=> 32768

Combinations | Usage combinations(objects, at_a_time)

prob.combinations(10,4)
=> 210

Probability | Usage probability(choices, outcomes, reduce=true)

prob.probability(1,4)
=> {:decimal=> 0.25, :percentage=>"25.0%", :fraction=>"1/4"}
prob.probability(2,4)
=> {:decimal=> 0.5, :percentage=>"50.0%", :fraction=>"1/2"}
prob.probability(2,4,false)
=> {:decimal=> 0.5, :percentage=>"50.0%", :fraction=>"2/4"}

Running tests

$ git clone git://github.com/polysaturate/math_probability.git
$ bundle install
$ rake   

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 11 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.