# Cartesian Product Calculator AI Agent Connect

> Cartesian Product Calculator MCP gives your agent the ability to work with finite sets. It handles cardinality calculations, tuple enumeration, and logical filtering. You can switch between strict set behavior and multiset logic to match your specific mathematical requirements.

## Overview
- **Category:** mathematics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_nkYDYJLM38EstJSCHQPEB44zKBSQ20TIkj8Fr9F2/ai-agent-connect
- **Tags:** math, sets, cartesian-product, cardinality, combinatorics

## Description

You can now give your AI client the ability to solve combinatorial problems without manual calculation. This MCP handles the heavy lifting of set theory by providing direct tools for Cartesian products. If you need to know the total size of a product, you can get the cardinality instantly. If you need to see the actual elements, you can enumerate the specific tuples. You can also narrow down results by selecting specific dimensions or applying logical filters to subsets. It works with both standard sets and multisets, making it useful for everything from basic probability to advanced discrete mathematics. Instead of asking your agent to guess the math, you give it the exact tools to compute it.

## Tools

### apply_projection
This tool extracts specific dimensions from a Cartesian product. It lets your agent isolate certain elements from the full set of tuples.

### enumerate_tuples
This tool generates the actual ordered tuples of a Cartesian product. Use it when you need the full list of elements rather than a count.

### filter_tuples
This tool returns a subset of the Cartesian product based on a logical condition. It is how your agent finds specific elements that meet your criteria.

### get_product_cardinality
This tool determines the total theoretical size of the Cartesian product. It provides the count of all possible combinations without listing them.

## Prompt Examples

**Prompt:** 
```
What is the total size of the Cartesian product of sets [1, 2] and [3, 4, 5] using strict mode?
```

**Response:** 
```
The total size of the Cartesian product is 6.
```

**Prompt:** 
```
List the first 2 tuples for the sets [[A, B], [1, 2]] in multiset mode.
```

**Response:** 
```
The first 2 tuples are ['A', 1] and ['A', 2].
```

**Prompt:** 
```
Filter the product of [[1, 2], [3, 4]] where the first element is greater than 1.
```

**Response:** 
```
The filtered tuples are ['2', 3] and ['2', 4].
```

## Capabilities

### Cardinality Calculation
Your agent calculates the total number of combinations in a product.

### Tuple Enumeration
The MCP generates the full list of ordered elements for any given sets.

### Dimensional Projection
Your agent can pull specific dimensions out of a larger product.

### Logical Filtering
The tool extracts subsets that satisfy specific mathematical conditions.

### Multiset Support
Your agent can perform operations using multiset logic instead of strict sets.

## Use Cases

### Combinatorial Analysis
Calculate the total number of possible outcomes for a set of independent events.

### State Space Modeling
Enumerate all possible states in a system defined by multiple variables.

### Database Query Logic
Model the results of cross joins and filters using set theory tools.

### Probability Theory
Find the size of sample spaces to determine the likelihood of specific events.

## Benefits

- Eliminates manual calculation errors in combinatorial math.
- Provides exact tuple lists instead of probabilistic guesses.
- Supports both strict and multiset logic for varied math problems.
- Enables complex filtering of large product sets via your agent.

## How It Works

Connecting this MCP to your AI client gives your agent immediate access to mathematical set tools.

1. Connect the MCP to your client through Vinkius.
2. Ask your agent a question involving sets or Cartesian products.
3. Your agent selects the appropriate math tool from the MCP.
4. The tool executes the calculation or enumeration.
5. Your agent receives the exact result and presents it to you.

## Frequently Asked Questions

**How do I use this Cartesian Product Calculator with Claude?**
You connect the MCP through the Vinkius platform. Once connected, Claude can see and use the math tools directly in your chat.

**Does this MCP support multisets?**
Yes, the tools support both strict set behavior and multiset logic.

**Can I filter results based on specific conditions?**
Yes, you can use the filter_tuples tool to extract subsets that meet your logical requirements.

**What is the difference between enumeration and cardinality?**
Cardinality gives you the total count of elements, while enumeration gives you the actual list of tuples.

**Do I need to host this myself?**
No, Vinkius hosts and manages the MCP for you. You connect your client and start working.

**What is the difference between strict and multiset modes?**
In strict mode, duplicate elements in input sets are collapsed into unique elements. In multiset mode, duplicates are treated as distinct entities, affecting the total cardinality.

**How can I limit the number of tuples returned?**
You can use the `enumerate_tuples` tool and provide a `limit` parameter to restrict the number of generated tuples.

**Can I select only specific columns from the product?**
Yes, use the `apply_projection` tool by providing the zero-based indices of the dimensions you wish to keep.
