Skip to content

Instantly share code, notes, and snippets.

@krishnanraman
Last active August 29, 2015 13:55
Show Gist options
  • Save krishnanraman/8703014 to your computer and use it in GitHub Desktop.
Save krishnanraman/8703014 to your computer and use it in GitHub Desktop.
Number of Times an Average American has sex per year, based on their age, gender & political affiliation.
Age Female,Conservative Female,Liberal MALE
18 133 124 128
19 128 119 124
20 124 115 120
21 120 112 116
22 116 108 113
23 112 104 109
24 108 100 106
25 104 97 102
26 100 93 99
27 96 90 96
28 93 87 93
29 89 84 90
30 86 80 87
31 83 77 84
32 79 74 81
33 76 72 79
34 73 69 76
35 70 66 73
36 67 63 71
37 64 61 69
38 62 58 66
39 59 56 64
40 56 54 62
41 54 52 60
42 51 49 58
43 49 47 56
44 47 45 55
45 45 44 53
46 43 42 51
47 41 40 50
48 39 38 48
49 37 37 47
50 35 35 46
51 33 34 45
52 32 33 43
53 30 32 42
54 29 30 42
55 27 29 41
56 26 28 40
57 25 28 39
58 24 27 39
59 23 26 38
60 22 25 38
61 21 25 37
62 20 24 37
63 20 24 37
64 19 24 37
65 19 24 37
66 18 23 37
67 18 23 37
68 18 23 37
69 17 24 38
70 17 24 38
71 17 24 38
72 17 24 39
73 18 25 40
74 18 25 40
75 18 26 41
76 19 27 42
77 19 28 43
78 20 28 44
79 20 29 45
80 21 30 47
81 22 32 48
82 23 33 49
83 24 34 51
84 25 35 52
85 26 37 54
86 27 38 56
87 29 40 58
88 30 42 60
89 32 44 62
scala> (18 to 89).foreach { Age =>
printf("%3d\t%3d\t\t\t\t%3d\t\t\t\t%3d\n", Age, (210 * (((Age - 18)/71.0)*((Age - 18)/71.0)) - (311*(Age - 18)/71.0) + 133).toInt, ((210 * ((Age - 18)/71.0)*((Age - 18)/71.0)) - (290*(Age - 18)/71.0) + 124).toInt, ((210 * ((Age - 18)/71.0)*((Age - 18)/71.0)) - (276*(Age - 18)/71.0) + 128).toInt)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment