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 - Michigan

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

 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?

 
 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.

 
 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.

 

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
* Acme Township * Acme, unincorporated community * Ada Township * Addison, village * Adrian, city * Afton, unincorporated community * Ahmeek, village * Akron, village * Alanson, village * Alba, unincorporated community * Albion, city * Alden, unincorporated community * Alger, unincorporated community * Algonac, city * Allegan Township * Allegan, city * Allen, village * Allen Park, city * Allendale, unincorporated community * Allenton, unincorporated community * Allouez Township * Alma, city * Almont Township * Almont, village * Alpena, city * Alpha, village * Alto, unincorporated community * Amasa, unincorporated community * Anchorville, unincorporated community * Ann Arbor, city * Applegate, village * Arcadia, unincorporated community * Argyle, unincorporated community * Armada, village * Arnold, unincorporated community * Ashley, village * Athens, village * Atlanta, unincorporated community * Atlantic Mine, unincorporated community * Atlas, unincorporated community * Attica Township * Au Gres, city * Au Train, unincorporated community * Auburn, city * Auburn Hills, city * Augusta, village * Avoca, unincorporated community * Azalia, unincorporated community * Bad Axe, city * Bailey, unincorporated community * Baldwin, village * Bancroft, village * Bangor, city * Bannister, unincorporated community * Baraga, village * Barbeau, unincorporated community * Bark River, unincorporated community * Baroda, village * Barryton, village * Barton City, unincorporated community * Bath, unincorporated community * Battle Creek, city * Bay City, city * Bay Port * Bay Shore * Bay View * Beacon Hill, unincorporated community * Beal City, unincorporated community * Bear Lake * Beaver Island * Beaverton * Bedford Charter Township * Bedford Township * Belding * Bellaire * Belleville * Bellevue * Belmont * Bentley * Benton Harbor * Benzonia * Bergland * Berkley * Berrien Center * Berrien Springs * Bessemer * Beulah * Beverly Hills * Big Bay * Big Rapids * Bingham Farms * Birch Run * Birmingham * Bitely * Black River * Blanchard * Blissfield * Bloomfield Hills * Bloomfield Charter Township * Bloomingdale * Boon * Boyne City * Boyne Falls * Bradley * Branch * Brant * Breckenridge * Breedsville * Brethren * Bridgeport * Bridgewater * Bridgman * Brighton * Brimley * Britton * Brohman * Bronson * Brooklyn * Brown City * Bruce Crossing * Brutus * Buchanan * Buckley * Burlington * Burnips * Burr Oak * Burt * Burt Lake * Burton * Byron * Byron Center * Cadillac * Caledonia * Calumet * Camden * Cannonsburg * Canton * Capac * Carleton * Carney * Caro * Carp Lake * Carrollton * Carson City * Carsonville * Casco * Caseville * Casnovia * Caspian * Cass City * Cassopolis * Cedar * Cedar Lake * Cedar River * Cedar Springs * Cedarville * Cement City * Center Line * Central Lake * Centreville * Ceresco * Champion * Channing * Charlevoix * Charlotte * Chase * Chassell * Chatham * Cheboygan * Chelsea * Chesaning * Chesterfield * Chippewa Lake * Chocolay Charter Township * Christmas * Clare * Clarklake * Clarkston * Clarksville * Clawson * Clayton * Clifford * Climax * Clinton * Clio * Cloverdale * Cohoctah * Coldwater * Coleman * Coloma * Colon * Columbiaville * Columbus, unincorporated community * Comins * Commerce * Comstock * Comstock Park * Concord * Conklin * Constantine * Conway * Cooks * Coopersville * Copemish * Copper City * Copper Harbor * Coral * Cornell * Corunna * Covert * Covington * Cross Village * Croswell * Crystal * Crystal Falls * Curran * Curtis * Custer * Cutlerville * Dafter * Daggett * Dansville * Davisburg * Davison * De Tour Village * Dearborn * Dearborn Heights * Decatur * Decker * Deckerville * Deerfield * Deerton * Deford * Delton * Detroit * DeWitt * Dexter * Dimondale * Dollar Bay * Dorr * Douglas * Dowagiac * Dowling * Drayton Plains * Drummond Island * Dryden * Dundee * Durand * Eagle * Eagle River * East China * East Grand Rapids * East Jordan * East Lansing * East Leroy * East Tawas * Eastlake * Eastpointe * Eastport * Eaton Rapids * Eau Claire * Eben Junction * Eckerman * Ecorse * Edenville * Edgemere * Edmore * Edwardsburg * Elberta * Elk Rapids * Elkton * Ellsworth * Elm Hall * Elmira * Elsie * Elwell * Emmett * Empire * Engadine * Erie * Escanaba * Essexville * Eureka * Evart * Ewen * Fair Haven * Fairgrove * Fairview * Falmouth * Farmington * Farmington Hills * Farwell * Felch * Fennville * Fenton * Fenwick * Ferndale * Ferrysburg * Fife Lake * Filer City * Filion * Flat Rock * Flint * Flushing * Forestville * Fort Gratiot * Foster City * Fostoria * Fountain * Fowler * Fowlerville * Frankenmuth * Frankfort * Franklin * Fraser * Frederic * Free Soil * Freeland * Freeport * Fremont * Frontier * Fruitport * Fulton * Gaastra * Gagetown * Gaines * Galesburg * Galien * Garden * Garden City * Gaylord * Genesee * Germfask * Gilford * Gladstone * Gladwin * Glen Arbor * Glenn * Glennie * Gobles * Goetzville * Good Hart * Goodells * Goodrich * Gould City * Gowen * Grand Blanc * Grand Haven * Grand Junction * Grand Ledge * Grand Marais * Grand Rapids * Grandville * Grant * Grass Lake * Grawn * Grayling * Greenbush * Greenland * Greenville * Gregory * Grosse Ile Township * Grosse Pointe * Grosse Pointe Farms * Grosse Pointe Park * Grosse Pointe Shores * Grosse Pointe Woods * Gulliver * Gwinn * Hadley * Hagar Shores * Hale * Hamburg * Hamilton * Hamtramck * Hancock * Hanover * Harbert * Harbor Beach * Harbor Point * Harbor Springs * Harper Woods * Harrietta * Harris * Harrison, city in Clare County * Harrison Charter Township in Macomb County * Harrisville * Harsens Island * Hart * Hartford * Hartland * Harvey * Haslett * Hastings * Hawks * Hazel Park * Hell, unincorporated community * Hemlock * Henderson * Hermansville * Herron * Hersey * Hesperia * Hessel * Hickory Corners * Higgins Lake * Highland * Highland Park * Hillman * Hillsdale * Holland * Holly * Holt * Holton * Homer * Honor * Hope * Hopkins * Horton * Houghton * Houghton Lake * Houghton Lake Heights * Howard City * Howell * Hubbard Lake * Hubbardston * Hubbell * Hudson * Hudsonville * Hulbert * Huntington Woods * Ida * Idlewild * Imlay City * Indian River * Ingalls * Inkster * Interlochen * Ionia * Iron Mountain * Iron River * Irons * Ironwood * Ishpeming * Ithaca * Jackson * Jamestown * Jasper * Jeddo * Jenison * Jerome * Johannesburg * Jones * Jonesville * Kalamazoo * Kaleva * Kalkaska * Kawkawlin * Kearsarge * Keego Harbor * Kendall * Kent City * Kenton * Kentwood * Kewadin * Kimball * Kincheloe * Kinde * Kingsford * Kingsley * Kingston * Kinross * L'Anse * La Salle * Lachine * Lacota * Laingsburg * Lake * Lake Ann * Lake City * Lake George * Lake Leelanau * Lake Linden * Lake Odessa * Lake Orion * Lakeland * Lakeside * Lakeview * Lakeville * Lambertville * Lamont * Lansing * Lapeer * Lathrup Village * Laurium * Lawrence * Lawton * Le Roy * Leland * Lennon * Leonard * Leonidas * Leslie * Levering * Lewiston * Lexington * Lincoln * Lincoln Park * Linden * Linwood * Litchfield * Little Lake * Livonia * Long Lake * Loretto * Lovells * Lowell * Ludington * Luna Pier * Lupton * Luther * Luzerne * Lyons * Macatawa * Mackinac Island * Mackinaw City * Macomb * Madison Heights * Mancelona * Manchester * Manistee * Manistique * Manitou Beach * Manton * Maple City * Maple Rapids * Marcellus * Marenisco * Marine City * Marion * Marlette * Marne * Marquette * Marshall * Martin * Marysville * Mason * Mass City * Mattawan * Maybee * Mayfield * Mayville * McBain * McBrides * McMillan * Mears * Mecosta * Melvin * Melvindale * Memphis * Mendon * Menominee * Merrill * Merritt * Mesick * Metamora * Michigamme * Michigan Center * Middleton * Middleville * Midland * Mikado * Milan * Milford * Millersburg * Millington * Minden City * Mio * Mohawk * Moline * Monroe * Montague * Montgomery * Montrose * Moorestown * Moran * Morenci * Morley * Morrice * Moscow * Mosherville * Mount Clemens * Mount Morris * Mount Pleasant * Muir * Mullett Lake * Mulliken * Munger * Munising * Munith * Muskegon * Muskegon Heights * Nadeau * Nahma * Napoleon * Nashville * National City * National Mine * Naubinway * Nazareth * Negaunee * New Baltimore * New Boston * New Buffalo * New Era * New Haven * New Hudson * New Lothrop * New Troy * Newaygo * Newberry * Newport * Niles * Nisula * North Adams * North Branch * North Lake * North Muskegon * North Star * North Street * Northeast * Northland * Northport * Northville * Northwest * Norton Shores * Norvell * Norway * Nottawa * Novi * Nunica * Oak Grove * Oak Park * Oakland * Oakley * Ocqueoc Township * Oden * Okemos * Old Mission * Olivet * Omena * Omer * Onaway * Onekama * Onondaga * Onsted * Ontonagon * Orchard Lake * Orion * Orleans * Ortonville * Oscoda * Oshtemo * Osseo * Ossineke * Otisville * Otsego * Ottawa Lake * Otter Lake * Ovid * Owendale * Owosso * Oxford * Painesdale * Palmer * Palmyra * Palo * Paradise * Parchment * Paris * Parma * Paw Paw * Pearl Beach * Peck * Pelkie * Pellston * Pennfield * Pentwater * Perkins * Perrinton * Perronville * Perry * Petersburg * Petoskey * Pewamo * Pickford * Pierson * Pigeon * Pinckney * Pinconning * Pittsford * Plainwell * Pleasant Lake * Pleasant Ridge * Plymouth * Pointe Aux Pins * Pompeii * Pontiac * Port Austin * Port Hope * Port Huron * Port Sanilac * Portage * Portland * Posen * Potterville * Powers * Prescott * Presque Isle * Prudenville * Pullman * Quincy * Quinnesec * Ralph * Ramsay * Rapid City * Rapid River * Ravenna * Ray * Reading * Redford Township * Reed City * Reese * Remus * Republic * Rhodes * Richland * Richmond * Richville * Ridgeway * Riga * River Rouge * Riverdale * Riverside * Riverview * Rives Junction * Rochester * Rochester Hills * Rock * Rockford * Rockland * Rockwood * Rodney * Rogers City * Rollin * Romeo * Romulus * Roosevelt Park * Roscommon * Rose City * Rosebush * Roseville * Rothbury * Royal Oak * Ruby * Rudyard * Rumely * Ruth * Saginaw * Sagola * Saint Charles * Saint Clair * Saint Clair Shores * Saint Helen * Saint Ignace * Saint Johns * Saint Joseph * Saint Louis * Salem * Saline * Samaria * Sand Creek * Sand Lake * Sandusky * Sanford * Saranac * Saugatuck * Sault Sainte Marie * Sawyer * Schoolcraft * Scotts * Scottville * Sears * Sebewaing * Seneca * Seney * Shaftsburg * Shelby Charter Township in Macomb County * Shelby village in Oceana County * Shelbyville * Shepherd * Sheridan * Sherwood * Shingleton * Sidnaw * Sidney * Silverwood * Six Lakes * Skandia * Skanee * Skidway Lake * Smiths Creek * Smyrna * Snover * Sodus * Somerset * Somerset Center * South Boardman * South Branch * South Haven * South Lyon * South Range * South Rockwood * Southeast * Southfield * Southgate * Spalding * Sparta * Spring Arbor * Spring Lake * Springfield * Springport * Spruce * Stambaugh * Standish * Stanton * Stanwood * Stephenson * Sterling * Sterling Heights * Stevensville * Stockbridge * Strongs * Sturgis * Sumner * Sunfield * Suttons Bay * Swartz Creek * Sylvan Lake * Tawas City * Taylor * Tecumseh * Tekonsha * Temperance * Thompsonville * Three Oaks * Three Rivers * Tipton * Toivola * Topinabee * Tower * Traverse City * Trenary * Trenton * Trout Creek * Trout Lake * Troy * Trufant * Turner * Tuscola * Tustin * Twin Lake * Twining * Ubly * Union * Union City * Union Lake * Union Pier * Unionville * University Center * Utica * Vandalia * Vanderbilt * Vassar * Vermontville * Vernon * Vestaburg * Vicksburg * Vulcan * Wabaningo * Wacousta * Wakefield * Waldron * Walhalla * Walker * Walkerville * Wallace * Walled Lake * Walloon Lake * Warren * Washington Township, Gratiot County * Washington Township, Macomb County * Washington Township, Sanilac County * Waterford * Waters * Watersmeet Township * Watervliet * Watton * Wayland * Wayne * Webberville * Weidman * Wells Township, Delta County * Wells Township, Marquette County * Wells Township, Tuscola County * Wellston * Wequetonsing * West Bloomfield Township * West Branch * West Olive * Westland * Weston * Westphalia * Westwood * Wetmore * Wheeler * White Cloud * White Lake Township * White Pigeon * White Pine * Whitehall * Whitmore Lake * Whittaker * Whittemore * Williamsburg * Williamston * Willis * Wilson Township, Alpena County * Wilson Township, Charlevoix County * Winn * Wixom * Wolverine * Woodhaven * Woodland * Wyandotte * Wyoming * Yale * Ypsilanti * Zeeland