# -*- coding: utf-8 -*-
# Program Name: pokemon_ratio_fraction_basics_all_pokemon.py
# ポケモンを使った割合・比・分数の基礎問題まとめ
# 基本① ピカチュウの長さ比較
pikachu_length1 = 10 # 10m
pikachu_length2 = 4 # 4m
pikachu_ratio = pikachu_length1 / pikachu_length2
print("基本①: 10mのピカチュウは4mの何倍? =", pikachu_ratio, "倍")
# 基本② カビゴンの体重割合
snorlax_weight_1 = 6 # kg
snorlax_weight_2 = 9 # kg
snorlax_ratio = snorlax_weight_1 / snorlax_weight_2
print("基本②: 6kgは9kgの何倍? =", snorlax_ratio, "倍")
# 基本③ コジロウのバッジ枚数(お母さんの2/9)
jessie_badges = 36
james_ratio = 2 / 9
james_badges = jessie_badges * james_ratio
print("基本③: コジロウのバッジの数 =", int(james_badges), "個")
# 基本④ トゲピ―のリボン使用量
total_ribbon = 2 + 2/9 # m
used_ratio = 3 / 8
used_ribbon = total_ribbon * used_ratio
print("基本④: トゲピ―が使ったリボン =", round(used_ribbon, 2), "m")
# 基本⑤ ハルカとマサトのポケモンカード
masato_cards = 32
haruka_ratio = 0.8
haruka_cards = masato_cards / haruka_ratio
print("基本⑤: ハルカのカードの枚数 =", int(haruka_cards), "枚")
# 基本⑥ ヒカリの所持金
group_3_yen = 450
one_group_yen = group_3_yen / 3
group_count = 5
total_money = one_group_yen * group_count
print("基本⑥: ヒカリの所持金 =", int(total_money), "円")
# 基本⑦-1 タケシが飲んだジュースの割合
juice_total_dl = 4
juice_drank_dl = 1.6
juice_ratio_drank = juice_drank_dl / juice_total_dl
print("基本⑦(1): タケシが飲んだ割合 =", round(juice_ratio_drank, 2))
# 基本⑦-2 残ったジュースの割合
juice_remain = juice_total_dl - (1.6 + 1)
juice_ratio_remain = juice_remain / juice_total_dl
print("基本⑦(2): 残ったジュースの割合 =", round(juice_ratio_remain, 2))
# 基本⑧-1 トモコのCDの価格(8分割中3個分)
tomoko_money = 2800
cd_ratio = 3 / 8
cd_price = tomoko_money * cd_ratio
print("基本⑧(1): トモコが買ったCDの価格 =", int(cd_price), "円")
# 基本⑧-2 トモコの残金と本購入後の残り
remaining_money = tomoko_money - cd_price
book_ratio = 3 / 7
book_price = remaining_money * book_ratio
final_money = remaining_money - book_price
print("基本⑧(2): 本を買った後の残金 =", int(final_money), "円")
# -*- coding: utf-8 -*-
# Program Name: pokemon_fraction_math_adventure.py
# ポケモンの世界を使った文章題(分数・割合・速さ・距離)の一体型Pythonプログラム
# --- 基本①(1): 距離と倍の関係(ピカチュウのジャンプ) ---
pikachu_jump_5m = 5
pikachu_jump_4x = pikachu_jump_5m * 4
pikachu_jump_ratio = 20 / 5
pikachu_jump_half_ratio = 10 / 4
# --- 基本①(2): 割合(カビゴンの重さ比較) ---
kabigon_weight_total = 9
kabigon_weight_part = 6
kabigon_ratio = kabigon_weight_part / kabigon_weight_total
# --- 基本①(3): 割合逆算(コイキングとギャラドスの進化比) ---
mother_age = 36
koiking_ratio = 2 / 9
koiking_age = mother_age * koiking_ratio
# --- 基本①(4): 分数乗算(ミミッキュのリボン使用量) ---
ribbon_length_total = 2 + 2/9
ribbon_used_ratio = 3 / 8
ribbon_used = ribbon_length_total * ribbon_used_ratio
# --- 基本①(5): 逆算(兄弟のまい数、ポケモンカード) ---
younger_cards = 32
younger_ratio = 0.8
elder_cards = younger_cards / younger_ratio
# --- 基本①(6): 山分け(モンスターボール) ---
total_group_value = 450
one_group_value = total_group_value / 3
full_amount = one_group_value * 5
# --- 基本②: ジュースの割合(ヤドンのジュース飲み量) ---
juice_total = 4
juice_drunk = 1.6
juice_ratio = juice_drunk / juice_total
juice_remaining = juice_total - (1.6 + 1)
juice_remaining_ratio = juice_remaining / juice_total
# --- 基本③: 所持金の分配(トモキ君とCDと本) ---
tomoki_money = 2800
cd_fraction = 3 / 8
cd_cost = tomoki_money * cd_fraction
money_after_cd = tomoki_money - cd_cost
book_fraction = 3 / 7
book_cost = money_after_cd * book_fraction
money_remaining = money_after_cd - book_cost
# --- 基本④: ページと読書(リョウスケの冒険本) ---
total_parts = 12
parts_read = 5
parts_remaining = total_parts - parts_read
remaining_ratio = parts_remaining / total_parts
one_part_page = 35 / 7
total_pages = one_part_page * total_parts
# --- 練習①: 男子女子の比(会場の人数) ---
boys = 48
girls = boys * 1.5
total = boys + girls
girls_ratio = girls / total
# --- 練習④(1): 棒の長さ(水に浮いた部分) ---
bar_b_above = 20
bar_b_fraction_above = 2 / 5
bar_b_one_unit = bar_b_above / bar_b_fraction_above
bar_b_full_length = bar_b_one_unit
bar_a_fraction_above = 1 / 6
bar_a_length = bar_b_one_unit * (1 / bar_a_fraction_above)
# --- 練習④(2): 棒の長さ(水面下) ---
depth = 30
bar_a_units_below = 3
bar_a_unit_length = depth / bar_a_units_below
bar_a_full = 6 * bar_a_unit_length
# --- 練習⑤(1): ボールの落下距離(山) ---
mountain_height = 150
ball_falls_ratio = 2 / 3
ball_falls_distance = mountain_height * ball_falls_ratio
# 結果の表示
print("\n\u2605 Pokemon Fraction Math Adventure Results")
print("Pikachu Jump 4x:", pikachu_jump_4x)
print("Pikachu Ratio:", pikachu_jump_ratio)
print("Pikachu Half Ratio:", pikachu_jump_half_ratio)
print("Kabigon Ratio:", kabigon_ratio)
print("Koiking Age:", koiking_age)
print("Ribbon Used (m):", round(ribbon_used, 2))
print("Elder's Cards:", elder_cards)
print("Total Amount (Ball):", full_amount)
print("Juice Ratio:", round(juice_ratio, 2))
print("Juice Remaining Ratio:", round(juice_remaining_ratio, 2))
print("CD Cost:", cd_cost)
print("Money After CD:", money_after_cd)
print("Book Cost:", book_cost)
print("Money Remaining:", money_remaining)
print("Remaining Page Ratio:", remaining_ratio)
print("Total Book Pages:", total_pages)
print("Girls Ratio:", girls_ratio)
print("Bar A Length (Full):", bar_a_length)
print("Bar A Length (Water Included):", bar_a_full)
print("Ball Fall Distance:", ball_falls_distance)
# -*- coding: utf-8 -*-
# Program Name: pokemon_speed_fraction_combined.py
# ポケモンの世界で速さ・分数・割合・時間・距離などを一体的に扱うPythonプログラム
# --- 基本①(1): ポケモンレースの速さ計算(リザードン) ---
distance_m1 = 1200
time_min1 = 5
speed_per_min1 = distance_m1 / time_min1
# --- 基本①(2): ピチューのえんぴつ購入(本数→合計) ---
unit_price = 40
quantity = 14
total_cost = unit_price * quantity
# --- 基本①(3): モンスターボール購入数(逆算) ---
budget = 900
price_per_ball = 75
ball_count = budget // price_per_ball
# --- 基本①(4): ピジョットの秒速(距離÷秒) ---
distance_cm = 200
time_sec = 25
speed_cm_per_sec = distance_cm / time_sec
# --- 基本①(5): ケッキングの分速→距離(時速を分単位に換算) ---
minutes = 12
minutes_to_hour = minutes / 60
speed_kmph = 25
distance_km = speed_kmph * minutes_to_hour
# --- 基本①(6): カラカラの移動時間→秒数 ---
distance_total = 200
distance_per_minute = 250
time_min = distance_total / distance_per_minute
time_sec_total = 60 * time_min
# --- 基本②(1): ミジュマルの秒速→分速(×60) ---
speed_m_per_sec = 6
speed_m_per_min = speed_m_per_sec * 60
# --- 基本②(2): ジバコイルの時速→分速(÷60) ---
speed_kmph_jibacoil = 21
speed_m_per_min_jibacoil = (speed_kmph_jibacoil * 1000) / 60
# --- 基本②(3): ラプラスの距離(1時間で) ---
speed_m_per_sec_lapras = 1.5
distance_in_hour_lapras = speed_m_per_sec_lapras * 60 * 60
distance_km_lapras = distance_in_hour_lapras / 1000
# --- 基本②(4): スイクンの秒速(90km/h) ---
speed_kmph_suicune = 90
speed_mps_suicune = (speed_kmph_suicune * 1000) / 3600
# 結果表示(Google Colab向け表示形式)
import pandas as pd
result_dict = {
"リザードン分速 (m/min)": speed_per_min1,
"ピチュー合計距離 (mとして)": total_cost,
"モンスターボールの数": ball_count,
"ピジョット秒速 (cm/sec)": speed_cm_per_sec,
"ケッキングの走行距離 (km)": distance_km,
"カラカラの移動時間 (秒)": time_sec_total,
"ミジュマルの分速 (m/min)": speed_m_per_min,
"ジバコイルの分速 (m/min)": speed_m_per_min_jibacoil,
"ラプラスの走行距離 (km)": distance_km_lapras,
"スイクンの秒速 (m/sec)": speed_mps_suicune,
}
df = pd.DataFrame(result_dict.items(), columns=["問題(ポケモン)", "結果"])
df