Select your font size 
 
about us products & services consulting & support news & events contact us
Paul Meagher gives an example of calculating conditional probability using the set enumeration method.

Conditional probability - Kansas

print this article 
 
1

A conditional probability refers to the probability of observing an event A given that you have observed a separate event B. The mathematical shorthand for expressing this idea is:

P(A | B)

Imagine that A refers to "customer buys product A" and B refers to "customer buys product B". P(A | B) would then read as the "probability that a customer will buy product A given that they have bought product B." If A tends to occur when B occurs, then knowing that B has occurred allows you to assign a higher probability to A's occurrence than in a situation in which you did not know that B occurred.

More generally, if A and B systematically co-vary in some way, then P(A | B) will not be equal to P(A). Conversely, if A and B are independent events, then P(A | B) would be expected to equal P(A).

The need to compute a conditional probability thus arises any time you think the occurence of some event has a bearing on the probability of another event's occurring.

The most basic and intuitive method for computing P(A | B) is the set enumeration method. Using this method, P(A | B) can be computed by counting the number of times A and B occur together {A & B} and dividing by the number of times B occurs :

P(A | B) = {A & B} /

If you observe that 12 customers to date bought product B and of those 12, 10 also bought product A, then P(A | B) would be estimated at 10/12 or 0.833. In other words, the probability of a customer buying product A given that they have purchased product B can be estimated at 83 percent by using a method that involves enumerating relative frequencies of A and B events from the data gathered to date.

You can compute a conditional probability using the set enumeration method with the following PHP code:

Listing 1. Computing conditional probability using set enumeration


Page: 1 2 3 4 5 6 7 8 9 10 11 Next Page: Learning from experience

 

The content shown in this page was first published by IBM developerWorks and is reprinted with permission from Paul Meagher (www.datavore.com)

 


Most Recent Website and Regional Updates

 High Scalability - Large Systems Optimization
Transparen Corporation lends its expertise to clients experiencing rapid and sudden growth in traffic or server utilization, bottlenecks, systems instability, downtime during peak traffic, or which would like to plan to avoid such issues.

 
 Throughput (or Bandwidth) vs. Latency
This document uses the example of Bill Gates purchasing Google to explain the difference between bandwidth (or throughput) and latency.

 
 Avoidance of Magic - Informal Survey Results
Joe the IT Director phones up high-traffic websites to ask them if they used magic.

 
 Transparen Toronto Office Locations
Addresses of Transparen Corporation offices in Toronto.

 
 Emergency Management Services
The prototypical emergency involves a shutdown of essential services for a finite period of time. What will your organization do when a world-wide financial crisis strikes?

 
 Fast RAID Server Data Recovery Service
Transparen's Vancouver International Response Team provides the option in Canada and USA to get a raid server back running in hours - eliminating costly waiting associated with typical RAID recoveries.

 
 Data Recovery Service
Have you deleted a mission critical file? Accidentally dropped a computer, or formatted a hard drive? No recent backup? Mistakes can happen, but the data might still be there.

 
 About Transparen
Transparen is committed to serving its clients.

 
 Research Tools
Measure human resource allocation and collect data with the goal of determining patterns that will bring forward actionable insights which may lead to policy changes, saving money and improving quality of service.

 
 'Mammygate' Settlement Pitch Sparks Council Ire
A proposal to settle the lawsuit over whether Mayor Mark Funkhouser's wife, Gloria Squitiro, used a racial slur against a city employee meets angry reaction during a Kansas City Council meeting.

 
 Secret Santa Hands Out Money In Sedalia
It may be the first week in December, but Santa came a little early to Sedalia.

 
 Teen Plays Violin To Buy Sick Kids Gifts
A Warrensburg teenager raises money to buy Christmas presents for sick children by playing his violin.

 
 Mo. Lawmakers To Consider Cell Phone Ban
Missouri is considering a law restricting cell phone use while driving.

 
 911 Caller Who Promised Murder Gets Prison
A man who called 911 and promised to kill someone will spend the rest of his life in prison.

 
 Complaints About Restaurant Tip-Jacking Filed
A local man said he's a victim of tip-jacking.

 
 Mom Crashes Into House, Charged With DUI
An Overland Park woman faces drunken driving charges after crashing her car into a house while taking her four children to school.

 
 Water Bills May Spike Ahead Of Sewer Repairs
The city took a big step on Thursday toward raising the cost of your water bill, even if you don't live in Kansas City.

 
 Woman Says She Was Raped At Downtown Bar
An investigation is under way into a reported rape in the bathroom of the Howl at the Moon piano bar in the Power & Light District in downtown Kansas City.

 
 Fairfax Bridge To Close In January For Repairs
The Fairfax Bridge will be closed for two weeks in January so that crews can make repairs.

 
 Senators Confident In Biothreat Lab Funding
Kansas' two U.S. senators said the nation's struggling economy should not hinder federal funding of a $450 million biothreat lab at Kansas State University.

 
 KCMO School Board Elects Two New Members
The Kansas City, Mo., School Board elected two new members Thursday night.

 
 Head Of Missouri Dems Stepping Down
The head of the Missouri Democratic Party is quitting.

 
 More Sites Offering Online Shopping Deals
KMBC's Dion Lim finds bargains through online games and offers.

 
 Missing Cameron Girl Found Safe In Indiana
A missing 14-year-old Cameron girl has been found safe in Indiana.

 
 Police Check For Body After Car Found In Lake
Crews pulled an abandoned car out of Blue Valley Lake to see whether a body was inside.

 
 Teen's Mom Jailed On Porn Charges
A southwest Missouri woman is in custody and her husband is expected to turn himself in on charges of smoking pot and watching pornography with their teenage son.

 
 Suspects Use Stun Gun On Wal-Mart Worker
Two suspected shoplifters are arrested after one of them zapped a Wichita Wal-Mart employee with a Taser.

 
 How To Set Up Digital Box For Antenna
KMBC's Kris Ketz and Jerry Agresti show how easy it can be to hook up a digital converter box for antennas.

 
 Woman Facing Charges After Lawrence Chase
A Topeka woman is facing 11 charges and is jailed in $350,000 bond after a high-speed police chase that left a Lawrence officer injured.

 
 Woman Amazed By Response To Dinner Offer
An Olathe woman posts an offer on Craigslist to make Christmas dinner for a family in need, and said she was overwhelmed with the response she received.

 

Google
 
Web transparen.com

Contact Information

Related Information

 
   
 
E C M | © 2003-2007 Transparen Corp.      

Standardized Services: Data Recovery Service / Creative Services / Premium Web Hosting Services / System Administration Tech Support Services
Recent Projects: Full-Service Mortgage and Financing Company / System to manage flights from Vancouver to Tofino / Photo exchange verification service
Our Vancouver BC Server Proudly Hosts: automated parking and revenue control systems, leafside lane at southlands, cost effective alternative power sources, Higher Grade Learning Centres, pacific forage bag supply, sunburst medical, neosonic design, roger mahler photography - passionate, intriguing, desirable, the connection between east and west, affordable flights to victoria and tofino, low interest mortgage brokers in vancouver, richmond, surrey, toronto, Toronto Calgary and Vancouver IT staffing and talent search
* Abbyville * Abilene * Admire * Agenda * Agra * Albert * Alden * Alexander * Allen * Alma * Almena * Altamont * Alta Vista * Alton * Altoona * Americus * Andale * Andover * Anthony * Arcadia * Argonia * Arkansas City * Arlington * Arma * Ashland * Assaria * Atchison * Athol * Atlanta * Attica * Atwood * Auburn * Augusta * Aurora * Axtell * Baldwin City * Barnard * Barnes * Bartlett * Basehor * Bassett * Baxter Springs * Bazine * Beattie * Bel Aire * Belle Plaine * Belleville * Beloit * Belpre * Belvue * Benedict * Bennington * Bentley * Benton * Bern * Beverly * Bird City * Bison * Blue Mound * Blue Rapids * Bluff City * Bogue * Bonner Springs * Brewster * Bronson * Brookville * Brownell * Bucklin * Buffalo * Buhler * Bunker Hill * Burden * Burdett * Burlingame * Burlington * Burns * Burr Oak * Burrton * Bushong * Bushton * Byers * Caldwell * Cambridge * Caney * Canton * Carbondale * Carlton * Cassoday * Cawker City * Cedar * Cedar Point * Cedar Vale * Centralia * Chanute * Chapman * Chase * Chautauqua * Cheney * Cherokee * Cherryvale * Chetopa * Cimarron * Circleville * Claflin * Clay Center * Clayton * Clearwater * Clifton * Climax * Clyde * Coats * Coffeyville * Colby * Coldwater * Collyer * Colony * Columbus * Colwich * Concordia * Conway Springs * Coolidge * Copeland * Corning * Cottonwood Falls * Council Grove * Courtland * Coyville * Cuba * Cullison * Culver * Cunningham * Damar * Danville * Dearing * Deerfield * Delia * Delphos * Denison * Denton * Derby * De Soto * Dexter * Dighton * Dodge City * Dorrance * Douglass * Downs * Dresden * Dunlap * Durham * Dwight * Earlton * Eastborough * Easton * Edgerton * Edmond * Edna * Edwardsville * Effingham * Elbing * El Dorado * Elgin * Elk City * Elk Falls * Elkhart * Ellinwood * Ellis * Ellsworth * Elmdale * Elsmore * Elwood * Emmett * Emporia * Englewood * Ensign * Enterprise * Erie * Esbon * Eskridge * Eudora * Eureka * Everest * Fairview * Fairway * Fall River * Florence * Fontana * Ford * Formoso * Fort Scott * Fowler * Frankfort * Frederick * Fredonia * Freeport * Frontenac * Fulton * Galatia * Galena * Galesburg * Galva * Garden City * Garden Plain * Gardner * Garfield * Garnett * Gas * Gaylord * Gem * Geneseo * Geuda Springs * Girard * Glade * Glasco * Glen Elder * Goddard * Goessel * Goff * Goodland * Gorham * Gove City * Grainfield * Grandview Plaza * Great Bend * Greeley * Green * Greenleaf * Greensburg * Grenola * Gridley * Grinnell * Gypsum * Haddam * Halstead * Hamilton * Hamlin * Hanover * Hanston * Hardtner * Harper * Hartford * Harveyville * Havana * Haven * Havensville * Haviland * Hays * Haysville * Hazelton * Hepler * Herington * Herndon * Hesston * Hiawatha * Highland * Hill City * Hillsboro * Hoisington * Holcomb * Hollenberg * Holton * Holyrood * Hope * Horace * Horton * Howard * Hoxie * Hoyt * Hudson * Hugoton * Humboldt * Hunnewell * Hunter * Huron * Hutchinson * Independence * Ingalls * Inman * Iola * Isabel * Iuka * Jamestown * Jennings * Jetmore * Jewell * Johnson City * Junction City * Kanopolis * Kanorado * Kansas City * Kechi * Kensington * Kill Creek * Kincaid * Kingman * Kinsley * Kiowa * Kirwin * Kismet * Labette * La Crosse * La Cygne * La Harpe * Lake Quivira * Lakin * Lancaster * Lane * Langdon * Lansing * Larned * Latham * Latimer * Lawrence * Leavenworth * Leawood * Lebanon * Lebo * Lecompton * Lehigh * Lenexa * Lenora * Leon * Leona * Leonardville * Leoti * Le Roy * Lewis * Liberal * Liberty * Liebenthal * Lincoln Center * Lincolnville * Lindsborg * Linn * Linn Valley * Linwood * Little River * Logan * Lone Elm * Longford * Long Island * Longton * Lorraine * Lost Springs * Louisburg * Louisville * Lucas * Luray * Lyndon * Lyons * McCracken * McCune * McDonald * McFarland * Macksville * McLouth * McPherson * Madison * Mahaska * Maize * Manchester * Manhattan * Mankato * Manter * Maple Hill * Mapleton * Marion * Marquette * Marysville * Matfield Green * Mayetta * Mayfield * Meade * Medicine Lodge * Melvern * Menlo * Meriden * Merriam * Milan * Mildred * Milford * Miltonvale * Minneapolis * Minneola * Mission * Mission Hills * Mission Woods * Moline * Montezuma * Moran * Morganville * Morland * Morrill * Morrowville * Moscow * Mound City * Moundridge * Mound Valley * Mount Hope * Mulberry * Mullinville * Mulvane * Munden * Muscotah * Narka * Nashville * Natoma * Neodesha * Neosho Falls * Neosho Rapids * Ness City * Netawaka * New Albany * New Cambria * New Strawn * Newton * Nickerson * Niotaze * Norcatur * North Newton * Norton * Nortonville * Norwich * Oak Hill * Oakley * Oberlin * Offerle * Ogden * Oketo * Olathe * Olivet * Olmitz * Olpe * Olsburg * Onaga * Oneida * Osage City * Osawatomie * Osborne * Oskaloosa * Oswego * Otis * Ottawa * Overbrook * Overland Park * Oxford * Ozawkie * Palco * Palmer * Paola * Paradise * Park * Park City * Parker * Parkerville * Parsons * Partridge * Pawnee Rock * Paxico * Peabody * Penalosa * Perry * Peru * Phillipsburg * Pittsburg * Plains * Plainville * Pleasanton * Plevna * Pomona * Portis * Potwin * Powhattan * Prairie View * Prairie Village * Pratt * Prescott * Preston * Pretty Prairie * Princeton * Protection * Quenemo * Quinter * Radium * Ramona * Randall * Randolph * Ransom * Rantoul * Raymond * Reading * Redfield * Republic * Reserve * Rexford * Richfield * Richmond * Riley * Robinson * Roeland Park * Rolla * Rose Hill * Roseland * Rossville * Rozel * Rush Center * Russell * Russell Springs * Sabetha * St. Francis * St. George * St. John * St. Marys * St. Paul * Salina * Satanta * Savonburg * Sawyer * Scammon * Scandia * Schoenchen * Scott City * Scottsville * Scranton * Sedan * Sedgwick * Selden * Seneca * Severance * Severy * Seward * Sharon * Sharon Springs * Shawnee * Silver Lake * Simpson * Smith Center * Smolan * Soldier * Solomon * South Haven * South Hutchinson * Spearville * Speed * Spivey * Spring Hill * Stafford * Stark * Sterling * Stockton * Strong City * Sublette * Summerfield * Sun City * Susank * Sylvan Grove * Sylvia * Syracuse * Tampa * Tescott * Thayer * Timken * Tipton * Tonganoxie * Topeka * Toronto * Towanda * Treece * Tribune * Troy * Turon * Tyro * Udall * Ulysses * Uniontown * Utica * Valley Center * Valley Falls * Vermillion * Victoria * Vining * Viola * Virgil * WaKeeney * Wakefield * Waldo * Waldron * Wallace * Walnut * Walton * Wamego * Washington * Waterville * Wathena * Waverly * Webber * Weir * Wellington * Wellsville * West Mineral * Westmoreland * Westphalia * Westwood * Westwood Hills * Wetmore * Wheaton * White City * White Cloud * Whitewater * Whiting * Wichita * Willard * Williamsburg * Willis * Willowbrook * Wilmore * Wilsey * Wilson * Winchester * Windom * Winfield * Winona * Woodbine * Woodston * Yates Center * Zenda * Zurich