Wolfram 언어

확률과 통계의 수량

여행 계획

인디애나 주 인디애나 폴리스에서 일리노이 주 시카고까지 차로 이동하는 경우의 평균 속도를 TriangularDistribution으로 나타내봅니다.

In[1]:=
Click for copyable input
speed\[ScriptCapitalD] = TriangularDistribution[{\!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{Typeset`query$$ = "55 mi/h", Typeset`boxes$$ = TemplateBox[{"55", RowBox[{"\"mi\"", " ", "\"/\"", " ", "\"h\""}], "miles per hour", FractionBox["\"Miles\"", "\"Hours\""]}, "Quantity", SyntaxForm -> Mod], Typeset`allassumptions$$ = {}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1, 2}, Typeset`querystate$$ = { "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 3.9373779`8.046752092819743, "Messages" -> {}}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["45", 4, Automatic, Dynamic[Typeset`query$$], Dynamic[Typeset`boxes$$], Dynamic[Typeset`allassumptions$$], Dynamic[Typeset`assumptions$$], Dynamic[Typeset`open$$], Dynamic[Typeset`querystate$$]], StandardForm], ImageSizeCache->{94., {8., 16.}}, TrackedSymbols:>{ Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{Typeset`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{Typeset`query$$ = "82 mph", Typeset`boxes$$ = TemplateBox[{"82", RowBox[{"\"mi\"", " ", "\"/\"", " ", "\"h\""}], "miles per hour", FractionBox["\"Miles\"", "\"Hours\""]}, "Quantity", SyntaxForm -> Mod], Typeset`allassumptions$$ = {}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1, 2}, Typeset`querystate$$ = { "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 0.2656176`6.875801841788495, "Messages" -> {}}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, Dynamic[Typeset`query$$], Dynamic[Typeset`boxes$$], Dynamic[Typeset`allassumptions$$], Dynamic[Typeset`assumptions$$], Dynamic[Typeset`open$$], Dynamic[Typeset`querystate$$]], StandardForm], ImageSizeCache->{94., {8., 16.}}, TrackedSymbols:>{ Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{Typeset`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\)}, \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{Typeset`query$$ = "72 mph", Typeset`boxes$$ = TemplateBox[{"72", RowBox[{"\"mi\"", " ", "\"/\"", " ", "\"h\""}], "miles per hour", FractionBox["\"Miles\"", "\"Hours\""]}, "Quantity", SyntaxForm -> Mod], Typeset`allassumptions$$ = {}, Typeset`assumptions$$ = {}, Typeset`open$$ = {1, 2}, Typeset`querystate$$ = { "Online" -> True, "Allowed" -> True, "mparse.jsp" -> 0.250013`6.8495075848939235, "Messages" -> {}}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 4, Automatic, Dynamic[Typeset`query$$], Dynamic[Typeset`boxes$$], Dynamic[Typeset`allassumptions$$], Dynamic[Typeset`assumptions$$], Dynamic[Typeset`open$$], Dynamic[Typeset`querystate$$]], StandardForm], ImageSizeCache->{94., {8., 16.}}, TrackedSymbols:>{ Typeset`query$$, Typeset`boxes$$, Typeset`allassumptions$$, Typeset`assumptions$$, Typeset`open$$, Typeset`querystate$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{Typeset`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\)]
Out[1]=

속도 분포의 확률 밀도 함수를 알아봅니다.

In[2]:=
Click for copyable input
Plot[PDF[speed\[ScriptCapitalD], Quantity[x, "mph"]], {x, 50, 85}]
Out[2]=

운전을 한다는 가정하에 도시 간의 거리를 계산합니다.

전체 Wolfram 언어 입력 표시하기
In[3]:=
Click for copyable input
GeoGraphics[ Style[Line[ TravelDirections[{Entity[ "City", {"Indianapolis", "Indiana", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}]}]], Thick, Red], GeoBackground -> GeoStyling["StreetMap"], GeoRange -> Quantity[100, "Miles"]]
Out[3]=
In[4]:=
Click for copyable input
distance = TravelDistance[{Entity[ "City", {"Indianapolis", "Indiana", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}]}, TravelMethod -> "Driving"]
Out[4]=

예상 이동 시간을 구합니다.

In[5]:=
Click for copyable input
Expectation[distance/v, v \[Distributed] speed\[ScriptCapitalD]]
Out[5]=

시간과 분으로 변환합니다.

In[6]:=
Click for copyable input
Expectation[distance/v, v \[Distributed] speed\[ScriptCapitalD]]; UnitConvert[%, MixedUnit[{"Hours", "Minutes"}]]
Out[6]=

차량 속도의 함수로 연비 효율이 다음의 보간 함수로 주어진다고 가정하면, 이동에 필요한 휘발유의 기대량은 NExpectation을 사용하여 계산할 수있습니다.

In[7]:=
Click for copyable input
mpg = Interpolation[{Quantity[{40, 50, 60, 70, 80}, "miles per hour"], Quantity[{33, 32, 28, 25, 20}, "miles per gallon"]} // Transpose, InterpolationOrder -> 1];
In[8]:=
Click for copyable input
NExpectation[distance/mpg[v], v \[Distributed] speed\[ScriptCapitalD]]
Out[8]=

관련 예제

de en es fr ja pt-br ru zh