Mathematica Asked by RajanArak on July 24, 2020
I have defined a set function and an average. If you need help understanding my definitions, let me know. I will do my best to explain.
How do I use Mathematica to apply my definition of average and solve
$$f(x)=begin{cases}
x & xin mathbb{Q}cap[1,2]
sin(x)+1 & x in left(lnleft(mathbb{Q}right)setminusleft{1right}right)cap[1,2]
end{cases}$$
I tried defining $f(x)$
f[x_] := x /; MatchQ[x, Between[_Rational, {0, 1}]] && Sin[x] + 1 /;
MatchQ[x, Between[Remove[Log[_Rational], 1], {0, 1}]]
But when I entered $f(1)$, I got
Piecewise[{1, 1 [Element] Between[Rationals, {0, 1}]}, {Sin[1] + 1,
1 [Element] Between[Remove[Log[Rationals], 1], {0, 1}]}]
So I tried another approach. I defined the sub-functions and their sub-domains
f1[x_] := x;
f2[x_] := Sin[x] + 1;
B1[a_, b_] :=
Select[Flatten[Table[c/d, {d, 1, b}, {c, 1, a}]],
Between[#, {1, 2}] &];
B2[a_, b_] :=
DeleteCases[
Select[Flatten[Table[N[Log[c/d], 8], {d, 1, b}, {c, 1, a}]],
Between[#, {1, 2}] &], 1, 2];
B1[100, 10];
B2[100, 10];
As $d/cto infty$ and $cto infty$, B1
starts to resemble $mathbb{Q}cap[1,2]$ and B2
starts to resemble $(ln(mathbb{Q})setminus {1})cap[1,2]$.
We then have to divide $[1,2]$ into $r$ sub-intervals and ignore the sub-intervals without a defined point.
The problem is I don’t know how to take $mu$ of the remaining sub-intervals as well as $mu$ of $A$.
For each of the remaining $r^{prime}$ sub-intervals (out of $r$ sub-intervals), how do we take the smallest sum of the length of $m^{prime}$ sub-intervals, out of $m$ sub-intervals which are sub-intervals of one of $r^{prime}$ sub-interval), where $S$ is uncountable and $A$ is uncountable or $S$ is countable/uncountable and $A$ is countable.
[out of topic]
Hi, I spent quite some time writting that for you:
Which should cover a good deal of the math and presentation part (the presentation part got better in the meantime).
Since you deleted your account there and I can't DM via Steack Exchange and does not have the right to comment, an answer is all I get. So I might as well write a proper one.
[back on topic]
From the look of it, you spent hours inventing and writting new, clean math definitions. Likely, translating them to code will take hours as well, if not more. I'm not sure what kind of help your expecting from stack exchange, but, without being too familiar with mathematica, I'd surmise there is no easy way to solve your problem. Maybe you're expecting something similar to integration tools, but you're most likely in the position where you have to build new tools, not merely using existing ones.
With that out of the way, I'd start simple. For example, f_1 and f_2 could be constant functions without changing the gist of the issue IIUC. B_1 and B_2 could be the sets of decimal numbers with odd and even numerator for example. Only then move on to more complicated examples.
I'd also try to do it by hand, hence an even bigger need for simplistic examples. If you can't explain a program with words, it's even less possible that you can code it.
Then I'd try with a very small bit: can you compute the sum in your µ? I don't understand it so I can't help, but if you can't compute that small part, you can't compute the rest.
From my understanding, Mathematica provides support for existing mathmetical notions. Depending on your goals and how gritty it gets, you might have to code for good in a "real" programming language, maybe connecting mathematica to a library you built.
To know what you have to invent and what you don't, I'd try cutting the question in very small bits. It's necessary both for you and for asking around here (or elsewhere for what matters).
Answered by 4xel on July 24, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP