Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Simple java homework help

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator


"Write a program to calculate the probability that a family with two children
will consist of two boys, a boy and a girl, or two girls."

these are my instructions. i am supposed to write a program to calculate the probability of a family having two children. i am okay importing the file, but the file that i am supposed to import is like this: bb gg bg, representing boy and girl outcomes, but i dont know how to implement that into a program that is supposed to predict the probability of a couple's child combination. thank you for any help.
__________________
 
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Do you understand the laws of probability enough to work it out on paper? That should be quick and easy, if you understand probability. Maybe that will help you work out the code to do it automatically.
 
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
How many posts are you planning to open for this single problem? Please continue to post in one of your previous topics.
 
This one time, at bandcamp, I had relations with a tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic