Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6984647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:34:34+00:00 2026-05-27T18:34:34+00:00

I’m having a hard time to understand how I could use binomial and normal

  • 0

I’m having a hard time to understand how I could use binomial and normal ( gaussian ) distributions in boost. I need to get a single values from these functions. I’m sure I’m probably trying to use these functions wrongly at the moment but here is what I have so far:

#include <boost/math/distributions.hpp>
#include <boost/math/tools/roots.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/random.hpp>

//valueH is assigned before
int value;
/* Should this assign value to "value" ?*/
value = boost::math::binomial_distribution<> value(1,valueH);

and normal distribution as

normal norm;

double someValue = boost::math::pdf(norm, (value1*value2+value3)/(value1*sqrt(value2)));

or should I use boost::math::normal_distribution<> here or how this works ? I’ve read boost documentation and still I don’t get how I could assign values from distributions. I’ve also read
C++ TR1: how to use the normal_distribution? so do I need to use some random number generator and generate numbers as the link shows and does that allow me to assign single values to variables ?

I’m sorry if this a bit messy message but anyway thanks !

Okay so far I have understood binomial and got it working, now I need to get normal distribution to work… Referring to link above, my situation differs from that I just need a one value but I would like to call normal distribution with a value. Like “give me N(0.1) with number 2 or so.

Well I thought this was getting easier but seems it isn’t I would like to use boost bisection function Bisection but the problems is that sometimes I have only function, min and max, and the bisection function needs at least 4 arguments 4th argument is Tol tol.. which is some kind of tolerance but could I just assign it to 0 if I want to find an absolute value or do I need to write my own bisection with 3 arguments ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:34:35+00:00Added an answer on May 27, 2026 at 6:34 pm

    Random number generation using C++ TR1
    http://www.johndcook.com/cpp_TR1_random.html

    Boost Bisection example:
    http://www.cplusplus.com/forum/general/50136/

    See also Boost TOMS748 example:
    http://programmingexamples.net/wiki/CPP/Boost/Math/Tools/TOMS748

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.