public paste
2ifX-BmYNz
—4 views4,929 chars4.83 KB
stdout
Paste content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Venn Diagram Sets & Probability Calculator</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #24292e;
max-width: 750px;
margin: 30px auto;
padding: 20px;
background-color: #f6f8fa;
}
.container {
background: #ffffff;
border: 1px solid #e1e4e8;
border-radius: 8px;
padding: 32px;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
h1 {
color: #0366d6;
font-size: 24px;
border-bottom: 1px solid #e1e4e8;
padding-bottom: 10px;
margin-top: 0;
}
p {
margin: 16px 0;
}
.calculator-box {
background: #f1f8ff;
border: 1px solid #c8e1ff;
border-radius: 6px;
padding: 20px;
margin: 24px 0;
}
.calculator-box h3 {
margin-top: 0;
color: #0366d6;
font-size: 16px;
}
.form-group {
margin-bottom: 12px;
}
label {
display: inline-block;
width: 140px;
font-weight: 600;
font-size: 14px;
}
input[type="number"] {
width: 100px;
padding: 6px 10px;
border: 1px solid #d1d5da;
border-radius: 4px;
font-size: 14px;
}
button {
background-color: #2ea44f;
color: white;
border: none;
padding: 8px 16px;
font-size: 14px;
font-weight: 600;
border-radius: 4px;
cursor: pointer;
margin-top: 8px;
}
button:hover {
background-color: #2c974b;
}
.result {
margin-top: 15px;
font-size: 15px;
font-weight: bold;
color: #1b7c54;
}
.external-link {
background-color: #fffbdd;
border: 1px solid #ffeef0;
border-left: 4px solid #d93f0b;
padding: 12px 16px;
margin-top: 24px;
font-size: 14px;
}
a {
color: #0366d6;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>Quick Venn Diagram & Set Intersection Tool</h1>
<p>When solving probability problems involving overlapping sets, calculating the cardinality of unions and intersections manually can be time-consuming. Use this quick widget to compute the size of the set union \(|A \cup B|\) using the Inclusion-Exclusion Principle:</p>
<!-- Interactive Widget -->
<div class="calculator-box">
<h3>2-Set Inclusion-Exclusion Calculator</h3>
<div class="form-group">
<label for="sizeA">Size of Set A — |A|:</label>
<input type="number" id="sizeA" value="45" min="0">
</div>
<div class="form-group">
<label for="sizeB">Size of Set B — |B|:</label>
<input type="number" id="sizeB" value="30" min="0">
</div>
<div class="form-group">
<label for="sizeIntersect">Overlap — |A ∩ B|:</label>
<input type="number" id="sizeIntersect" value="12" min="0">
</div>
<button onclick="calculateUnion()">Calculate |A ∪ B|</button>
<div class="result" id="output">Union Size |A ∪ B| = 63</div>
</div>
<p>This simple formula follows: <code>|A ∪ B| = |A| + |B| - |A ∩ B|</code>.</p>
<!-- Active Link Box -->
<div class="external-link">
Need full set visualizers, 3-set diagrams, or probability distributions? Try the complete online
<a href="https://statscalculator.org/venn-diagram-calculator/" target="_blank" rel="noopener">Venn Diagram Calculator</a>
for multi-set analysis and graphical outputs.
</div>
</div>
<script>
function calculateUnion() {
const a = parseFloat(document.getElementById('sizeA').value) || 0;
const b = parseFloat(document.getElementById('sizeB').value) || 0;
const intersect = parseFloat(document.getElementById('sizeIntersect').value) || 0;
const union = a + b - intersect;
document.getElementById('output').innerText = "Union Size |A ∪ B| = " + union;
}
</script>
</body>
</html>$ tail -f comments.log
Comments [0]
// no comments yet