File:Condorcet’s jury theorem graph.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 375 × 375 pixels, file size: 37 KB)

Captions

Captions

A graph of cumulative binomial distributions corresponding to few example realizations of Condorcet’s Jury Theorem

Summary[edit]

Description
English: Graph of selected CDF for binomial distributions that illustrate Condorcet’s Jury Theorem. Created in R using the following code:

 # cf. e.g. 
 # Odd case: DOI:10.1016/0176-2680(93)90010-R
 # Even case with coinflip ties: DOI:10.1007/BF01718092
 library(tidyverse); options(scipen=999); library(ggthemes); library(extrafont)
 theme_set(theme_minimal()); theme_update(legend.position = "bottom", text=element_text(family="Lato"))
 
 f <- function(n,p) {
   h=floor(n/2)+1
   if(n %% 2) {
     return(sum(choose(n,seq(h,n)) * p^seq(h,n) * (1-p)^(n-seq(h,n))))
   } else {
     return((sum(choose(n,seq(h,n)) * p^seq(h,n) * (1-p)^(n-seq(h,n)))) +
       (choose(n,n/2) * p^(n/2) * (1-p)^(n/2)) * 1/2) 
   }
 }
 df = tibble(p = seq(0,1,0.01)) %>% rowwise() %>% 
   mutate("1" = f(1,p), "3" = f(3,p), "12" = f(12,p), "100" = f(100,p)) %>% 
   pivot_longer(c("1","3","12","100"), names_to="N", values_to="pg")
 
 df %>% ggplot(aes(p, pg, color=N)) + geom_line() +
   labs(title = element_blank(), x = element_blank(), y = element_blank()) + 
   scale_color_colorblind(breaks=c(1,3,12,100))
 
 ggsave("cjt.svg", width=1000, height=1000, units="px")
Date
Source Own work
Author Jaszczuroczłek

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:42, 25 October 2021Thumbnail for version as of 18:42, 25 October 2021375 × 375 (37 KB)Jaszczuroczłek (talk | contribs)improved legibility for classic Wikipedia; final version for now
18:40, 25 October 2021Thumbnail for version as of 18:40, 25 October 2021938 × 938 (37 KB)Jaszczuroczłek (talk | contribs)fixed background glitch
18:36, 25 October 2021Thumbnail for version as of 18:36, 25 October 2021300 × 300 (11 KB)Jaszczuroczłek (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata